[Svn] r4422 - in trunk/roundcubemail: . program/js program/steps/settings

trac at roundcube.net trac at roundcube.net
Mon Jan 17 19:26:24 CET 2011


Author: alec
Date: 2011-01-17 12:26:24 -0600 (Mon, 17 Jan 2011)
New Revision: 4422

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/steps/settings/folders.inc
Log:
- Fix impossible to subscribe to protected folders (#1487656)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-01-17 13:36:51 UTC (rev 4421)
+++ trunk/roundcubemail/CHANGELOG	2011-01-17 18:26:24 UTC (rev 4422)
@@ -5,6 +5,7 @@
 - Require PHP 5.2.1 or greater
 - Fix %h/%z variables in username_domain option (#1487701)
 - Workaround for setting charset in case of malformed bodystructure response (#1487700)
+- Fix impossible to subscribe to protected folders (#1487656)
 
 RELEASE 0.5
 -----------

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2011-01-17 13:36:51 UTC (rev 4421)
+++ trunk/roundcubemail/program/js/app.js	2011-01-17 18:26:24 UTC (rev 4422)
@@ -4309,6 +4309,14 @@
     }
   };
 
+  // disables subscription checkbox (for protected folder)
+  this.disable_subscription = function(folder)
+  {
+    var id = this.get_folder_row_id(folder);
+    if (id)
+      $('input[name="_subscribed[]"]', $('#'+id)).attr('disabled', true);
+  };
+
   this.folder_size = function(folder)
   {
     var lock = this.set_busy(true, 'loading');

Modified: trunk/roundcubemail/program/steps/settings/folders.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/folders.inc	2011-01-17 13:36:51 UTC (rev 4421)
+++ trunk/roundcubemail/program/steps/settings/folders.inc	2011-01-17 18:26:24 UTC (rev 4422)
@@ -42,8 +42,16 @@
             }
         }
 
-        if ($result)
+        if ($result) {
+            // Handle subscription of protected folder (#1487656)
+            if ($CONFIG['protect_default_folders'] == true
+                && in_array($mbox, $CONFIG['default_imap_folders'])
+            ) {
+                $OUTPUT->command('disable_subscription', $mbox);
+            }
+
             $OUTPUT->show_message('foldersubscribed', 'confirmation');
+        }
         else
             rcmail_display_server_error('errorsaving');
     }
@@ -294,13 +302,16 @@
             $noselect = in_array('\\Noselect', $opts);
         }
 
+        $disabled = (($protected && $subscribed) || $noselect);
+
         $table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes)));
     
         $table->add('name', $display_folder);
         $table->add('subscribed', $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''),
-            array('value' => $folder_utf8, 'disabled' => ($protected || $noselect) ? 'disabled' : '')));
+            array('value' => $folder_utf8, 'disabled' => $disabled ? 'disabled' : '')));
 
-        $a_js_folders['rcmrow'.$idx] = array($folder_utf8, Q($display_folder), $protected || $folder['virtual']);
+        $a_js_folders['rcmrow'.$idx] = array($folder_utf8,
+            Q($display_folder), $protected || $folder['virtual']);
     }
 
     $RCMAIL->plugins->exec_hook('folders_list', array('table' => $table));

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list