From f98bdce9d79d1b5fad44c8c8845ec36b5b3cd009 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 30 Nov 2009 14:30:58 -0700 Subject: [PATCH] Add label entry to accounts data --- imp/lib/Accounts.php | 1 + imp/lib/Application.php | 7 +++++++ imp/templates/prefs/accountsmanagement.inc | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/imp/lib/Accounts.php b/imp/lib/Accounts.php index 96d5c61b2..483bcffaa 100644 --- a/imp/lib/Accounts.php +++ b/imp/lib/Accounts.php @@ -92,6 +92,7 @@ class IMP_Accounts * * @param array $config The necessary config: *
+     * 'label' - (string) The human-readable label for this account.
      * 'port' - (integer) The remote port.
      * 'secure' -(string) Either 'auto', 'no', or 'yes'.
      * 'server' - (string) The server hostspec.
diff --git a/imp/lib/Application.php b/imp/lib/Application.php
index 122b10e66..76950840d 100644
--- a/imp/lib/Application.php
+++ b/imp/lib/Application.php
@@ -929,8 +929,15 @@ class IMP_Application extends Horde_Registry_Application
                         $port = ($vars->accounts_type == 'imap') ? 143 : 110;
                     }
 
+                    /* Label is not required. */
+                    $label = $vars->accounts_label;
+                    if (!strlen($label)) {
+                        $label = $vars->accounts_server . ':' . $port . ' [' . $vars->accounts_type . ']';
+                    }
+
                     $imp_accounts = IMP_Accounts::singleton();
                     $imp_accounts->addAccount(array(
+                        'label' => $label,
                         'port' => $port,
                         'secure' => $vars->accounts_secure,
                         'server' => $vars->accounts_server,
diff --git a/imp/templates/prefs/accountsmanagement.inc b/imp/templates/prefs/accountsmanagement.inc
index 89b55b0f4..b24817ab9 100644
--- a/imp/templates/prefs/accountsmanagement.inc
+++ b/imp/templates/prefs/accountsmanagement.inc
@@ -4,6 +4,11 @@
 
 
+  
+  
+  
+ 
+ 
:
: + @@ -68,6 +74,7 @@ $delete_img = Horde::img('delete.png'); $val): ?> + -- 2.11.0