From: Michael J. Rubinsky Date: Sat, 2 Oct 2010 22:30:48 +0000 (-0400) Subject: Ask for an auth factory if that's what is returned... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5119c0b8e88220c9a0ac1bbdf2c75c55cd608653;p=horde.git Ask for an auth factory if that's what is returned... --- diff --git a/ansel/perms.php b/ansel/perms.php index 9eab7594e..cc49ce966 100644 --- a/ansel/perms.php +++ b/ansel/perms.php @@ -19,7 +19,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('ansel'); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $form = null; $reload = false; diff --git a/ansel/scripts/all_images_exif_to_tags.php b/ansel/scripts/all_images_exif_to_tags.php index 53391f566..8b7a7c70d 100755 --- a/ansel/scripts/all_images_exif_to_tags.php +++ b/ansel/scripts/all_images_exif_to_tags.php @@ -56,7 +56,7 @@ Horde_Registry::appInit('ansel', array('authentication' => 'none')); // Login to horde if username & password are set. if (!empty($username) && !empty($password)) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $cli->fatal(_("Username or password is incorrect.")); } else { diff --git a/ansel/scripts/ansel.php b/ansel/scripts/ansel.php index 4e53cca2d..aa796dd9e 100755 --- a/ansel/scripts/ansel.php +++ b/ansel/scripts/ansel.php @@ -88,7 +88,7 @@ foreach ($opts as $opt) { // Login to horde if username & password are set. if (!empty($username) && !empty($password)) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $error = _("Login is incorrect."); Horde::logMessage($error, 'ERR'); diff --git a/ansel/scripts/recursive_import.php b/ansel/scripts/recursive_import.php index 698609cd8..820f056d8 100755 --- a/ansel/scripts/recursive_import.php +++ b/ansel/scripts/recursive_import.php @@ -66,7 +66,7 @@ foreach ($opts as $opt) { // Login to horde if username & password are set. if (!empty($username) && !empty($password)) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $cli->fatal(_("Username or password is incorrect.")); } else { diff --git a/ansel/xppublish.php b/ansel/xppublish.php index 897a754d7..cc6a9f960 100644 --- a/ansel/xppublish.php +++ b/ansel/xppublish.php @@ -36,7 +36,7 @@ if ($cmd == 'login') { $username = Horde_Util::getFormData('username'); $password = Horde_Util::getFormData('password'); if ($username && $password) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if ($auth->authenticate($username, array('password' => $password))) { $cmd = 'list'; diff --git a/beatnik/scripts/export_config.php b/beatnik/scripts/export_config.php index 254681d84..93a3681c2 100644 --- a/beatnik/scripts/export_config.php +++ b/beatnik/scripts/export_config.php @@ -93,7 +93,7 @@ if (!empty($rpc)) { // Login to horde if username & password are set and load module. } elseif (!empty($username) && !empty($password)) { require_once HORDE_BASE . '/lib/base.php'; - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $error = _("Login is incorrect."); Horde::logMessage($error, 'ERR'); diff --git a/folks/account/resetpassword.php b/folks/account/resetpassword.php index 323abada4..623abaca9 100644 --- a/folks/account/resetpassword.php +++ b/folks/account/resetpassword.php @@ -34,7 +34,7 @@ if ($registry->isAuthenticated()) { } // Make sure auth backend allows passwords to be reset. -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('resetpassword')) { $notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error'); $registry->authenticateFailure('folks'); diff --git a/folks/account/signup.php b/folks/account/signup.php index 1869f87af..75ead722f 100644 --- a/folks/account/signup.php +++ b/folks/account/signup.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/tabs.php'; -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); // Make sure signups are enabled before proceeding if ($conf['signup']['allow'] !== true || diff --git a/folks/account/tabs.php b/folks/account/tabs.php index a3967009d..8799c20ec 100644 --- a/folks/account/tabs.php +++ b/folks/account/tabs.php @@ -13,7 +13,7 @@ $folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $vars = Horde_Variables::getDefaultVariables(); $tabs = new Horde_Core_Ui_Tabs('what', $vars); diff --git a/folks/edit/password.php b/folks/edit/password.php index 06a2a9b2b..36cb93d41 100644 --- a/folks/edit/password.php +++ b/folks/edit/password.php @@ -16,7 +16,7 @@ require_once 'tabs.php'; /* // Make sure auth backend allows passwords to be updated. -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('resetpassword')) { $notification->push(_("Cannot update password, contact your administrator."), 'horde.error'); $registry->authenticateFailure('folks'); diff --git a/folks/lib/Friends.php b/folks/lib/Friends.php index 2445a914a..a0eb899df 100644 --- a/folks/lib/Friends.php +++ b/folks/lib/Friends.php @@ -220,7 +220,7 @@ class Folks_Friends { } // Check if users exits - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->exists($user)) { return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $user)); } @@ -289,7 +289,7 @@ class Folks_Friends { } // Check if users exits - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->exists($friend)) { return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $friend)); } diff --git a/folks/perms.php b/folks/perms.php index 4cbfc648e..5d7c7c987 100644 --- a/folks/perms.php +++ b/folks/perms.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; $shares = $injector->getInstance('Horde_Share_Factory')->getScope(); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $reload = false; $actionID = Horde_Util::getFormData('actionID', 'edit'); diff --git a/folks/rss/activity.php b/folks/rss/activity.php index 36fb0f837..8963a13a9 100644 --- a/folks/rss/activity.php +++ b/folks/rss/activity.php @@ -14,7 +14,7 @@ $folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$GLOBALS['registry']->getAuth() && (!isset($_SERVER['PHP_AUTH_USER']) || !$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) { diff --git a/folks/rss/friends.php b/folks/rss/friends.php index d735c1f34..58553351e 100644 --- a/folks/rss/friends.php +++ b/folks/rss/friends.php @@ -14,7 +14,7 @@ $folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$GLOBALS['registry']->getAuth() && (!isset($_SERVER['PHP_AUTH_USER']) || !$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) { diff --git a/folks/rss/know.php b/folks/rss/know.php index 4f3e00ebf..908911bf0 100644 --- a/folks/rss/know.php +++ b/folks/rss/know.php @@ -14,7 +14,7 @@ $folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$GLOBALS['registry']->getAuth() && (!isset($_SERVER['PHP_AUTH_USER']) || !$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) { diff --git a/folks/scripts/mail.php b/folks/scripts/mail.php index d2690fb86..a17d8e5d9 100644 --- a/folks/scripts/mail.php +++ b/folks/scripts/mail.php @@ -62,7 +62,7 @@ foreach ($opts as $opt) { // Login to horde if username & password are set. if (!empty($username) && !empty($password)) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $error = _("Login is incorrect."); Horde::logMessage($error, 'ERR'); diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php b/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php index 5aab09eaa..64f066f48 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php @@ -67,7 +67,7 @@ class Horde_ActiveSync_Driver_Horde extends Horde_ActiveSync_Driver_Base { $this->_logger->info('Horde_ActiveSync_Driver_Horde::logon attempt for: ' . $username); parent::logon($username, $password, $domain); - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); return $auth->authenticate($username, array('password' => $password)); } diff --git a/framework/Core/lib/Horde/Core/Auth/Ldap.php b/framework/Core/lib/Horde/Core/Auth/Ldap.php index a2fef38a8..d1abfd646 100644 --- a/framework/Core/lib/Horde/Core/Auth/Ldap.php +++ b/framework/Core/lib/Horde/Core/Auth/Ldap.php @@ -25,7 +25,7 @@ class Horde_Core_Auth_Ldap extends Horde_Auth_Ldap */ public function addUser($userId, $credentials) { - list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); parent::addUser($userId, $credentials); } @@ -41,7 +41,7 @@ class Horde_Core_Auth_Ldap extends Horde_Auth_Ldap */ public function updateUser($oldID, $newID, $credentials) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); list($oldID, $old_credentials) = $auth->runHook($oldID, $credentials, 'preauthenticate', 'admin'); if (isset($old_credentials['ldap'])) { @@ -64,7 +64,7 @@ class Horde_Core_Auth_Ldap extends Horde_Auth_Ldap */ public function removeUser($userId) { - list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : null); } diff --git a/framework/Core/lib/Horde/Core/Auth/Msad.php b/framework/Core/lib/Horde/Core/Auth/Msad.php index 34adb5153..17f6e79c8 100644 --- a/framework/Core/lib/Horde/Core/Auth/Msad.php +++ b/framework/Core/lib/Horde/Core/Auth/Msad.php @@ -25,7 +25,7 @@ class Horde_Core_Auth_Msad extends Horde_Auth_Msad */ public function addUser($userId, $credentials) { - list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); parent::addUser($userId, $credentials); } @@ -41,7 +41,7 @@ class Horde_Core_Auth_Msad extends Horde_Auth_Msad */ public function updateUser($oldID, $newID, $credentials) { - list($oldId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->runHook($oldId, $credentials, 'preauthenticate', 'admin'); + list($oldId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->runHook($oldId, $credentials, 'preauthenticate', 'admin'); parent::updateUser($oldID, $newID, $credentials); } @@ -55,7 +55,7 @@ class Horde_Core_Auth_Msad extends Horde_Auth_Msad */ public function removeUser($userId) { - list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : null); } diff --git a/framework/Core/lib/Horde/Core/Binder/AuthFactory.php b/framework/Core/lib/Horde/Core/Binder/AuthFactory.php new file mode 100644 index 000000000..a6c592553 --- /dev/null +++ b/framework/Core/lib/Horde/Core/Binder/AuthFactory.php @@ -0,0 +1,18 @@ +getUserPermissions(); $this->_form->setSection('users', _("Individual Users"), Horde::img('user.png'), false); - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if ($auth->hasCapability('list')) { /* The auth driver has list capabilities so set up an array which * the matrix field type will recognise to set up an enum box for diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index d2ae23f2f..7ed77f6ec 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -267,7 +267,7 @@ class Horde_Registry 'Horde_Ajax_Factory' => 'Horde_Core_Binder_AjaxFactory', 'Horde_Ajax_Imple_Factory' => 'Horde_Core_Binder_ImpleFactory', 'Horde_Alarm' => 'Horde_Core_Binder_Alarm', - 'Horde_Auth' => 'Horde_Core_Binder_Auth', + 'Horde_Auth_Factory' => 'Horde_Core_Binder_AuthFactory', // 'Horde_Browser' - initialized below 'Horde_Cache_Factory' => 'Horde_Core_Binder_CacheFactory', 'Horde_Core_Auth_Signup' => 'Horde_Core_Binder_AuthSignup', @@ -1322,7 +1322,7 @@ class Horde_Registry * application auth != Horde admin auth. And there can *never* be * non-SHOW access to an application that requires authentication. */ if (!$this->isAuthenticated(array('app' => $app, 'notransparent' => !empty($params['notransparent']))) && - $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth($app)->requireAuth() && + $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth($app)->requireAuth() && ($perms != Horde_Perms::SHOW)) { return false; } @@ -1790,7 +1790,7 @@ class Horde_Registry if (!$this->getAuth()) { $this->getCleanSession(); } - return $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth($app)->transparent(); + return $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth($app)->transparent(); } return false; @@ -1860,7 +1860,7 @@ class Horde_Registry if (!isset($options['reason'])) { // TODO: This only returns the error for Horde-wide // authentication, not for application auth. - $options['reason'] = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->getError(); + $options['reason'] = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->getError(); } if (empty($options['app']) || @@ -1883,7 +1883,7 @@ class Horde_Registry $params['logout_reason'] = $options['reason']; if ($options['reason'] == Horde_Auth::REASON_MESSAGE) { $params['logout_msg'] = empty($options['msg']) - ? $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->getError(true) + ? $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->getError(true) : $options['msg']; } } @@ -2119,7 +2119,7 @@ class Horde_Registry */ public function checkExistingAuth() { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!empty($GLOBALS['conf']['auth']['checkip']) && !empty($_SESSION['horde_auth']['remoteAddr']) && diff --git a/framework/Core/package.xml b/framework/Core/package.xml index ad1a3b218..241d8b31e 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -111,7 +111,7 @@ Application Framework. - + @@ -435,7 +435,7 @@ Application Framework. - + diff --git a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php index 0079bbb60..5d8f0c254 100644 --- a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php +++ b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php @@ -185,7 +185,7 @@ class Kolab_Resource $calendar_user = $conf['kolab']['filter']['calendar_id'] . '@' . $domain; /* Load the authentication libraries */ - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(isset($conf['auth']['driver']) ? null : 'kolab'); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(isset($conf['auth']['driver']) ? null : 'kolab'); $authenticated = $auth->authenticate($calendar_user, array('password' => $conf['kolab']['filter']['calendar_pass']), false); diff --git a/framework/Rpc/lib/Horde/Rpc.php b/framework/Rpc/lib/Horde/Rpc.php index b56b99b12..261a5a67e 100644 --- a/framework/Rpc/lib/Horde/Rpc.php +++ b/framework/Rpc/lib/Horde/Rpc.php @@ -115,7 +115,7 @@ class Horde_Rpc } // @TODO: inject this - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); $serverVars = $this->_request->getServerVars(); if ($serverVars['PHP_AUTH_USER']) { $user = $serverVars['PHP_AUTH_USER']; diff --git a/framework/Rpc/lib/Horde/Rpc/Webdav.php b/framework/Rpc/lib/Horde/Rpc/Webdav.php index a9f533dc3..b41e109af 100644 --- a/framework/Rpc/lib/Horde/Rpc/Webdav.php +++ b/framework/Rpc/lib/Horde/Rpc/Webdav.php @@ -825,7 +825,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc */ function check_auth($type, $username, $password) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); return $auth->authenticate($username, array('password' => $password)); } diff --git a/framework/SyncML/SyncML/Backend/Horde.php b/framework/SyncML/SyncML/Backend/Horde.php index 769a38be6..96e258df8 100644 --- a/framework/SyncML/SyncML/Backend/Horde.php +++ b/framework/SyncML/SyncML/Backend/Horde.php @@ -477,7 +477,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { */ function _checkAuthentication($username, $password) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); return $auth->authenticate($username, array('password' => $password)) ? $GLOBALS['registry']->getAuth() : false; @@ -865,7 +865,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { } /* Get an Auth object. */ - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); /* Make this user an admin for the time beeing to allow deletion of * user data. */ @@ -912,7 +912,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { { /* Get an Auth object. */ try { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); } catch (Horde_Exception $e) { // TODO } diff --git a/hermes/lib/Forms/Search.php b/hermes/lib/Forms/Search.php index 0dd400526..53db1c046 100644 --- a/hermes/lib/Forms/Search.php +++ b/hermes/lib/Forms/Search.php @@ -164,7 +164,7 @@ class SearchForm extends Horde_Form { $criteria = array(); if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) { if (!empty($info['employees'])) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('list')) { $criteria['employee'] = explode(',', $info['employees']); } else { diff --git a/hermes/lib/Forms/Time.php b/hermes/lib/Forms/Time.php index 11f3715a6..23da1c4b2 100644 --- a/hermes/lib/Forms/Time.php +++ b/hermes/lib/Forms/Time.php @@ -285,7 +285,7 @@ class TimeReviewForm extends TimeForm { $employees = array(); require_once 'Horde/Identity.php'; - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); $users = $auth->listUsers(); if (!is_a($users, 'PEAR_Error')) { foreach ($users as $user) { diff --git a/hermes/lib/Hermes.php b/hermes/lib/Hermes.php index 8bb91296a..d2f0f5dac 100644 --- a/hermes/lib/Hermes.php +++ b/hermes/lib/Hermes.php @@ -163,7 +163,7 @@ class Hermes { */ public static function getEmployeesType($enumtype = 'multienum') { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('list')) { return array('text', array()); } diff --git a/horde/admin/groups.php b/horde/admin/groups.php index 60b828a37..dfd3f1662 100644 --- a/horde/admin/groups.php +++ b/horde/admin/groups.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('admin' => true)); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $form = null; $reload = false; diff --git a/horde/admin/signup_confirm.php b/horde/admin/signup_confirm.php index 8a4e64202..d3fb78edd 100644 --- a/horde/admin/signup_confirm.php +++ b/horde/admin/signup_confirm.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/base.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); // Make sure signups are enabled before proceeding -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if ($conf['signup']['allow'] !== true || !$auth->hasCapability('add')) { throw new Horde_Exception(_("User Registration has been disabled for this site.")); diff --git a/horde/admin/user.php b/horde/admin/user.php index ef5f6b17b..2f857eed0 100644 --- a/horde/admin/user.php +++ b/horde/admin/user.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('admin' => true)); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if ($conf['signup']['allow'] && $conf['signup']['approve']) { $signup = $injector->getInstance('Horde_Core_Auth_Signup'); diff --git a/horde/lib/Prefs/Ui.php b/horde/lib/Prefs/Ui.php index 9faf6f576..c1e0e12cd 100644 --- a/horde/lib/Prefs/Ui.php +++ b/horde/lib/Prefs/Ui.php @@ -95,7 +95,7 @@ class Horde_Prefs_Ui /* Hide appropriate prefGroups. */ try { - $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth()->hasCapability('update'); + $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth()->hasCapability('update'); } catch (Horde_Exception $e) { $ui->suppressGroups[] = 'forgotpass'; } diff --git a/horde/login.php b/horde/login.php index 1d817972a..9201ee391 100644 --- a/horde/login.php +++ b/horde/login.php @@ -68,7 +68,7 @@ if (!$is_auth) { } /* Get an Auth object. */ -$auth = $injector->getInstance('Horde_Auth')->getAuth(($is_auth && $vars->app) ? $vars->app : null); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(($is_auth && $vars->app) ? $vars->app : null); /* Build the list of necessary login parameters. */ $loginparams = array( diff --git a/horde/scripts/cookie_login.php b/horde/scripts/cookie_login.php index 0267509b6..a20fd4297 100644 --- a/horde/scripts/cookie_login.php +++ b/horde/scripts/cookie_login.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); // Check for COOKIE auth. if (empty($_COOKIE['user']) || diff --git a/horde/scripts/get_login.php b/horde/scripts/get_login.php index cb6ededda..bfbe09b54 100644 --- a/horde/scripts/get_login.php +++ b/horde/scripts/get_login.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); // Check for GET auth. if (empty($_GET['user']) || diff --git a/horde/scripts/http_login_refer.php b/horde/scripts/http_login_refer.php index a52432145..552cee96a 100644 --- a/horde/scripts/http_login_refer.php +++ b/horde/scripts/http_login_refer.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); // Check for HTTP auth. if (empty($_SERVER['PHP_AUTH_USER']) || diff --git a/horde/services/changepassword.php b/horde/services/changepassword.php index 8e91448c3..25d571d35 100644 --- a/horde/services/changepassword.php +++ b/horde/services/changepassword.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('nologintasks' => true)); // Make sure auth backend allows passwords to be reset. -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('update')) { $notification->push(_("Changing your password is not supported with the current configuration. Contact your administrator."), 'horde.error'); Horde::getServiceLink('login')->add('url', Horde_Util::getFormData('url'))->redirect(); diff --git a/horde/services/resetpassword.php b/horde/services/resetpassword.php index 3ee7d5eed..beb59ebb1 100644 --- a/horde/services/resetpassword.php +++ b/horde/services/resetpassword.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); // Make sure auth backend allows passwords to be reset. -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->hasCapability('resetpassword')) { $notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error'); Horde::getServiceLink('login')->add('url', Horde_Util::getFormData('url'))->redirect(); diff --git a/horde/services/shares/edit.php b/horde/services/shares/edit.php index 1247ebb78..816ede511 100644 --- a/horde/services/shares/edit.php +++ b/horde/services/shares/edit.php @@ -26,7 +26,7 @@ $fieldsList = array( $app = Horde_Util::getFormData('app'); $shares = $injector->getInstance('Horde_Share_Factory')->getScope($app); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $help = $registry->hasMethod('shareHelp', $app) ? $registry->callByPackage($app, 'shareHelp') : null; diff --git a/horde/signup.php b/horde/signup.php index 1941edb15..d4e505e58 100644 --- a/horde/signup.php +++ b/horde/signup.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); // Make sure signups are enabled before proceeding if ($conf['signup']['allow'] !== true || diff --git a/koward/lib/Koward.php b/koward/lib/Koward.php index ebce4d385..64deb9041 100644 --- a/koward/lib/Koward.php +++ b/koward/lib/Koward.php @@ -35,7 +35,7 @@ class Koward { $this->registry = &$registry; $this->notification = &$notification; - $this->auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $this->auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); $this->conf = Horde::loadConfiguration('conf.php', 'conf'); $this->objects = Horde::loadConfiguration('objects.php', 'objects'); diff --git a/koward/lib/Koward/Cli.php b/koward/lib/Koward/Cli.php index 520863afb..4af5c38d0 100644 --- a/koward/lib/Koward/Cli.php +++ b/koward/lib/Koward/Cli.php @@ -81,7 +81,7 @@ class Koward_Cli extends Horde_Controller_Request_Base /* Authenticate the user if possible. */ if ($this->_argv->user) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($this->_argv->user, array('password' => $this->_argv->pass))) { throw new InvalidArgumentException('Failed to log in!'); diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index 36d34a4cd..7ce6178ef 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -38,7 +38,7 @@ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) sprintf(_("Permission denied for the requested feed (%s)."), htmlspecialchars($calendar))); } else { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (isset($_SERVER['PHP_AUTH_USER'])) { $user = $_SERVER['PHP_AUTH_USER']; $pass = $_SERVER['PHP_AUTH_PW']; diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 658ef6515..965f243ee 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1721,7 +1721,7 @@ class Kronolith */ public static function readPermsForm($share) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); $perm = $share->getPermission(); $errors = array(); diff --git a/kronolith/perms.php b/kronolith/perms.php index a2590c57a..29c6150e6 100644 --- a/kronolith/perms.php +++ b/kronolith/perms.php @@ -23,7 +23,7 @@ if (!empty($conf['share']['no_sharing'])) { $shares = $injector->getInstance('Horde_Share_Factory')->getScope(); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); $reload = false; $actionID = Horde_Util::getFormData('actionID', 'edit'); diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index 3ba9e5d09..68c4cb159 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -1,5 +1,5 @@ getInstance('Horde_Auth')->getAuth(); +$auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); $horde_groups = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = array(); diff --git a/turba/scripts/upgrades/public_to_horde_share.php b/turba/scripts/upgrades/public_to_horde_share.php index 5be8a7500..cb1805011 100755 --- a/turba/scripts/upgrades/public_to_horde_share.php +++ b/turba/scripts/upgrades/public_to_horde_share.php @@ -33,7 +33,7 @@ if (!$sure) { // get the list of all users if we can. If your site // has a *large* number of users, you may want to comment // out this section to avoid unnecessary overhead. -$auth = $injector->getInstance('Horde_Auth')->getAuth(); +$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if ($auth->hasCapability('list')) { $users = $auth->listUsers(); } diff --git a/whups/lib/Forms/Admin/User.php b/whups/lib/Forms/Admin/User.php index c72f119ae..2bafccc80 100644 --- a/whups/lib/Forms/Admin/User.php +++ b/whups/lib/Forms/Admin/User.php @@ -22,7 +22,7 @@ class AddUserForm extends Horde_Form { global $conf, $whups_driver; - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if ($auth->hasCapability('list')) { $queue = $vars->get('queue'); $current = $whups_driver->getQueueUsers($queue); diff --git a/whups/lib/Mail.php b/whups/lib/Mail.php index ff1ce4b04..56cc913a4 100644 --- a/whups/lib/Mail.php +++ b/whups/lib/Mail.php @@ -208,7 +208,7 @@ class Whups_Mail { */ static protected function _findAuthUser($from) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); if ($auth->hasCapability('list')) { foreach ($auth->listUsers() as $user) { diff --git a/wicked/scripts/wicked.php b/wicked/scripts/wicked.php index 9e403093b..d73f2e9ed 100755 --- a/wicked/scripts/wicked.php +++ b/wicked/scripts/wicked.php @@ -77,7 +77,7 @@ foreach ($opts as $opt) { // Login to horde if username & password are set. if (!empty($username) && !empty($password)) { - $auth = $injector->getInstance('Horde_Auth')->getAuth(); + $auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); if (!$auth->authenticate($username, array('password' => $password))) { $error = _("Login is incorrect."); Horde::logMessage($error, 'ERR');