Add config option to disable remote accounts
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Nov 2009 20:28:03 +0000 (13:28 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 3 Dec 2009 21:53:39 +0000 (14:53 -0700)
imp/config/conf.xml
imp/config/prefs.php.dist
imp/filterprefs.php
imp/lib/Application.php

index 42aa742..b97e5cd 100644 (file)
@@ -3,6 +3,8 @@
 <configuration>
  <configtab name="user" desc="User Capabilities and Constraints">
   <configsection name="user">
+   <configboolean name="allow_accounts" desc="Should we allow users to add
+   remote accounts?">false</configboolean>
    <configswitch name="allow_folders" desc="Should we allow users to use
    folders at all? NOTE: setting this to false will mean there is no place to
    save sent-mail or postponed messages, along with the obvious effects of
index a96eb09..42a1f8e 100644 (file)
@@ -54,12 +54,14 @@ if (!$is_pop3) {
               'purge_spam_keep'));
 }
 
-$prefGroups['accounts'] = array(
-    'column' => _("General Options"),
-    'label' => _("Additional Accounts"),
-    'desc' => _("Configure additional mail accounts to display."),
-    'members' => array('accountsmanagement')
-);
+if (!empty($GLOBALS['conf']['user']['allow_accounts'])) {
+    $prefGroups['accounts'] = array(
+        'column' => _("General Options"),
+        'label' => _("Additional Accounts"),
+        'desc' => _("Configure additional mail accounts to display."),
+        'members' => array('accountsmanagement')
+    );
+}
 
 $prefGroups['compose'] = array(
     'column' => _("Message Options"),
index 348a0ae..57bdad6 100644 (file)
@@ -96,10 +96,13 @@ if (!$blacklist_link && !$whitelist_link && !$filters_link) {
         'display' => array('g' => _("Apply filter rules whenever Inbox is displayed?"), 'p' => 'filter_on_display', 'h' => 'filter-on-display', 'l' => $display_locked),
         'sidebar' => array('g' => _("Apply filter rules whenever sidebar is refreshed?"), 'p' => 'filter_on_sidebar', 'h' => 'filter-on-sidebar', 'l' => $sidebar_locked),
         'any_mailbox' => array('g' => _("Allow filter rules to be applied in any mailbox?"), 'p' => 'filter_any_mailbox', 'h' => 'filter-any-mailbox', 'l' => $anymailbox_locked),
-        'menuitem' => array('g' => _("Show the filter icon on the menubar?"), 'p' => 'filter_menuitem', 'l' => $menuitem_locked));
+        'menuitem' => array('g' => _("Show the filter icon on the menubar?"), 'p' => 'filter_menuitem', 'l' => $menuitem_locked)
+    );
+
     if ($_SESSION['imp']['protocol'] == 'pop') {
         unset($options_array['any_mailbox']);
     }
+
     $opts = array();
     foreach ($options_array as $key => $val) {
         if (!$val['l']) {
index 8ba9af3..122b10e 100644 (file)
@@ -652,7 +652,7 @@ class IMP_Application extends Horde_Registry_Application
 
         case 'accountsmanagement':
             $GLOBALS['prefsui_no_save'] = true;
-            return true;
+            return !empty($GLOBALS['conf']['user']['allow_accounts']);
 
         default:
             return true;