Index: /branches/release-0.7/CHANGELOG
===================================================================
--- /branches/release-0.7/CHANGELOG	(revision 5756)
+++ /branches/release-0.7/CHANGELOG	(revision 5757)
@@ -2,4 +2,8 @@
 ===========================
 
+- Fix failure on MySQL database upgrade from 0.7 - text column can't have default value (#1488300)
+
+RELEASE 0.7.1
+-------------
 - Fix bug in handling of base href and inline content (#1488290)
 - Fix SQL Error when saving a contact with many email addresses (#1488286)
Index: /branches/release-0.7/SQL/mysql.initial.sql
===================================================================
--- /branches/release-0.7/SQL/mysql.initial.sql	(revision 5756)
+++ /branches/release-0.7/SQL/mysql.initial.sql	(revision 5757)
@@ -102,5 +102,5 @@
  `del` tinyint(1) NOT NULL DEFAULT '0',
  `name` varchar(128) NOT NULL DEFAULT '',
- `email` text NOT NULL DEFAULT '',
+ `email` text NOT NULL,
  `firstname` varchar(128) NOT NULL DEFAULT '',
  `surname` varchar(128) NOT NULL DEFAULT '',
Index: /branches/release-0.7/SQL/mysql.update.sql
===================================================================
--- /branches/release-0.7/SQL/mysql.update.sql	(revision 5756)
+++ /branches/release-0.7/SQL/mysql.update.sql	(revision 5757)
@@ -216,7 +216,9 @@
 -- Updates from version 0.7
 
+/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
+
 ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
 ALTER TABLE `contacts` DROP INDEX `user_contacts_index`;
-ALTER TABLE `contacts` MODIFY `email` text NOT NULL DEFAULT '';
+ALTER TABLE `contacts` MODIFY `email` text NOT NULL;
 ALTER TABLE `contacts` ADD INDEX `user_contacts_index` (`user_id`,`del`);
 ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
@@ -232,2 +234,4 @@
 ALTER TABLE `identities` ALTER `user_id` DROP DEFAULT;
 ALTER TABLE `searches` ALTER `user_id` DROP DEFAULT;
+
+/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
Index: /branches/release-0.7/installer/rcube_install.php
===================================================================
--- /branches/release-0.7/installer/rcube_install.php	(revision 5756)
+++ /branches/release-0.7/installer/rcube_install.php	(revision 5757)
@@ -519,5 +519,5 @@
         '0.5-beta', '0.5', '0.5.1',
         '0.6-beta', '0.6',
-        '0.7-beta', '0.7',
+        '0.7-beta', '0.7', '0.7.1'
     ));
     return $select;
Index: /branches/release-0.7/plugins/acl/acl.js
===================================================================
--- /branches/release-0.7/plugins/acl/acl.js	(revision 5756)
+++ /branches/release-0.7/plugins/acl/acl.js	(revision 5757)
@@ -2,5 +2,5 @@
  * ACL plugin script
  *
- * @version 0.6.3
+ * @version @package_version@
  * @author Aleksander Machniak <alec@alec.pl>
  */
@@ -180,7 +180,6 @@
             users.push(selection[n]);
         }
-        else {
-            row = list.rows[selection[n]].obj;
-            cell = $('td.user', row);
+        else if (row = list.rows[selection[n]]) {
+            cell = $('td.user', row.obj);
             if (cell.length == 1)
                 users.push(cell.text());
@@ -194,8 +193,15 @@
 rcube_webmail.prototype.acl_remove_row = function(id)
 {
-    this.acl_list.remove_row(id);
+    var list = this.acl_list;
+
+    list.remove_row(id);
+    list.clear_selection();
+
     // we don't need it anymore (remove id conflict)
     $('#rcmrow'+id).remove();
     this.env.acl[id] = null;
+
+    this.enable_command('acl-delete', list.selection.length > 0);
+    this.enable_command('acl-edit', list.selection.length == 1);
 }
 
@@ -260,5 +266,5 @@
 rcube_webmail.prototype.acl_init_form = function(id)
 {
-    var ul, row, val = '', type = 'user', li_elements, body = $('body'),
+    var ul, row, td, val = '', type = 'user', li_elements, body = $('body'),
         adv_ul = $('#advancedrights'), sim_ul = $('#simplerights'),
         name_input = $('#acluser');
@@ -287,8 +293,9 @@
     li_elements.attr('checked', false);
 
-    if (id) {
-        row = this.acl_list.rows[id].obj;
+    if (id && (row = this.acl_list.rows[id])) {
+        row = row.obj;
         li_elements.map(function() {
-            var val = this.value, td = $('td.'+this.id, row);
+            val = this.value;
+            td = $('td.'+this.id, row);
             if (td && td.hasClass('enabled'))
                 this.checked = true;
@@ -300,4 +307,7 @@
             type = id;
     }
+    // mark read (lrs) rights by default
+    else
+        li_elements.filter(function() { return this.id.match(/^acl([lrs]|read)$/); }).prop('checked', true);
 
     name_input.val(val);
Index: /branches/release-0.7/plugins/acl/acl.php
===================================================================
--- /branches/release-0.7/plugins/acl/acl.php	(revision 5756)
+++ /branches/release-0.7/plugins/acl/acl.php	(revision 5757)
@@ -442,24 +442,35 @@
         $oldid = trim(get_input_value('_old', RCUBE_INPUT_GPC));
 
-        $acl = array_intersect(str_split($acl), $this->rights_supported());
-
-        if (!empty($this->specials) && in_array($user, $this->specials)) {
-            $username = $this->gettext($user);
-        }
-        else {
-            if (!strpos($user, '@') && ($realm = $this->get_realm())) {
-                $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm));
-            }
-            $username = $user;
-        }
-
-        if ($acl && $user && $user != $_SESSION['username'] && strlen($mbox)) {
-            $result = $this->rc->imap->set_acl($mbox, $user, $acl);
+        $acl   = array_intersect(str_split($acl), $this->rights_supported());
+        $users = $oldid ? array($user) : explode(',', $user);
+
+        foreach ($users as $user) {
+            $user = trim($user);
+
+            if (!empty($this->specials) && in_array($user, $this->specials)) {
+                $username = $this->gettext($user);
+            }
+            else {
+                if (!strpos($user, '@') && ($realm = $this->get_realm())) {
+                    $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm));
+                }
+                $username = $user;
+            }
+
+            if (!$acl || !$user || !strlen($mbox)) {
+                continue;
+            }
+
+            if ($user != $_SESSION['username'] && $username != $_SESSION['username']) {
+                if ($this->rc->imap->set_acl($mbox, $user, $acl)) {
+                    $ret = array('id' => html_identifier($user),
+                         'username' => $username, 'acl' => implode($acl), 'old' => $oldid);
+                    $this->rc->output->command('acl_update', $ret);
+                    $result++;
+                }
+            }
         }
 
         if ($result) {
-            $ret = array('id' => html_identifier($user),
-                 'username' => $username, 'acl' => implode($acl), 'old' => $oldid);
-            $this->rc->output->command('acl_update', $ret);
             $this->rc->output->show_message($oldid ? 'acl.updatesuccess' : 'acl.createsuccess', 'confirmation');
         }
@@ -480,4 +491,5 @@
 
         foreach ($user as $u) {
+            $u = trim($u);
             if ($this->rc->imap->delete_acl($mbox, $u)) {
                 $this->rc->output->command('acl_remove_row', html_identifier($u));
Index: /branches/release-0.7/program/js/list.js
===================================================================
--- /branches/release-0.7/program/js/list.js	(revision 5756)
+++ /branches/release-0.7/program/js/list.js	(revision 5757)
@@ -183,6 +183,10 @@
 remove_row: function(uid, sel_next)
 {
-  if (this.rows[uid].obj)
-    this.rows[uid].obj.style.display = 'none';
+  var obj = this.rows[uid] ? this.rows[uid].obj : null;
+
+  if (!obj)
+    return;
+
+  obj.style.display = 'none';
 
   if (sel_next)
