Move authCredentials() into Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:59:15 +0000 (14:59 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:59:15 +0000 (14:59 -0600)
imp/lib/Api.php
imp/lib/Application.php

index cfc2911..f90dd63 100644 (file)
@@ -45,44 +45,6 @@ class IMP_Api extends Horde_Registry_Api
         );
     }
 
-    /**
-     * Returns a list of authentication credentials, i.e. server settings that
-     * can be specified by the user on the login screen.
-     *
-     * @return array  A hash with credentials, suited for the preferences
-     *                interface.
-     */
-    public function authCredentials()
-    {
-        $app_name = $GLOBALS['registry']->get('name');
-
-        $servers = IMP_Imap::loadServerConfig();
-        $server_list = array();
-        foreach ($servers as $key => $val) {
-            $server_list[$key] = $val['name'];
-        }
-        reset($server_list);
-
-        $credentials = array(
-            'username' => array(
-                'desc' => sprintf(_("%s for %s"), _("Username"), $app_name),
-                'type' => 'text'
-            ),
-            'password' => array(
-                'desc' => sprintf(_("%s for %s"), _("Password"), $app_name),
-                'type' => 'password'
-            ),
-            'server' => array(
-                'desc' => sprintf(_("%s for %s"), _("Server"), $app_name),
-                'type' => 'enum',
-                'enum' => $server_list,
-                'value' => key($server_list)
-            )
-        );
-
-        return $credentials;
-    }
-
     /* IMP-specific functions. */
 
     /**
index ad9887d..ef3842c 100644 (file)
@@ -746,4 +746,44 @@ class IMP_Application extends Horde_Registry_Application
         $GLOBALS['imp_search']->initialize(true);
     }
 
+    /* Horde_Prefs_Credentials:: methods. */
+
+    /**
+     * Returns a list of authentication credentials, i.e. server settings that
+     * can be specified by the user on the login screen.
+     *
+     * @return array  A hash with credentials, suited for the preferences
+     *                interface.
+     */
+    public function authCredentials()
+    {
+        $app_name = $GLOBALS['registry']->get('name');
+
+        $servers = IMP_Imap::loadServerConfig();
+        $server_list = array();
+        foreach ($servers as $key => $val) {
+            $server_list[$key] = $val['name'];
+        }
+        reset($server_list);
+
+        $credentials = array(
+            'username' => array(
+                'desc' => sprintf(_("%s for %s"), _("Username"), $app_name),
+                'type' => 'text'
+            ),
+            'password' => array(
+                'desc' => sprintf(_("%s for %s"), _("Password"), $app_name),
+                'type' => 'password'
+            ),
+            'server' => array(
+                'desc' => sprintf(_("%s for %s"), _("Server"), $app_name),
+                'type' => 'enum',
+                'enum' => $server_list,
+                'value' => key($server_list)
+            )
+        );
+
+        return $credentials;
+    }
+
 }