From: Michael J. Rubinsky Date: Thu, 7 Oct 2010 21:54:05 +0000 (-0400) Subject: Use Horde_Core_Factory_Auth directly, change name of factory method to create() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f4f153147c89de458e435625189b68f05cf8ac4c;p=horde.git Use Horde_Core_Factory_Auth directly, change name of factory method to create() --- diff --git a/ansel/perms.php b/ansel/perms.php index cc49ce966..5ea772fec 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $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 8b7a7c70d..2c38753fa 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 aa796dd9e..84ba350c0 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 164535069..9e2b43216 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 64e0a3ed8..2e74f5fea 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); if ($auth->authenticate($username, array('password' => $password))) { $cmd = 'list'; diff --git a/beatnik/scripts/export_config.php b/beatnik/scripts/export_config.php index 93a3681c2..7f06cf1e2 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 623abaca9..7882be757 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 75ead722f..25a21d6d2 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); // 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 8799c20ec..42f5b2aa2 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $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 36cb93d41..e29dc2fed 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 69bea8505..2afd7c958 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 54f4e61d7..d33e940ba 100644 --- a/folks/perms.php +++ b/folks/perms.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; $shares = $injector->getInstance('Horde_Core_Factory_Share')->create(); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $reload = false; $actionID = Horde_Util::getFormData('actionID', 'edit'); diff --git a/folks/rss/activity.php b/folks/rss/activity.php index 8963a13a9..d3beb62b8 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 58553351e..0c56abd01 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 908911bf0..920a30199 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 e183d4c37..5880fa482 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 64f066f48..4acc12433 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 d1abfd646..c56fb5a2f 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_Factory')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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_Factory')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->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 17f6e79c8..d5c1cb395 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_Factory')->getAuth()->runHook($userId, $credentials, 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->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_Factory')->getAuth()->runHook($oldId, $credentials, 'preauthenticate', 'admin'); + list($oldId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->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_Factory')->getAuth()->runHook($userId, array(), 'preauthenticate', 'admin'); + list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($userId, array(), 'preauthenticate', 'admin'); parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : null); } diff --git a/framework/Core/lib/Horde/Core/Binder/Auth.php b/framework/Core/lib/Horde/Core/Binder/Auth.php deleted file mode 100644 index 51731a844..000000000 --- a/framework/Core/lib/Horde/Core/Binder/Auth.php +++ /dev/null @@ -1,18 +0,0 @@ -getUserPermissions(); $this->_form->setSection('users', _("Individual Users"), Horde::img('user.png'), false); - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 a61b6306e..057225426 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -250,7 +250,6 @@ class Horde_Registry /* Define binders. */ $binders = array( - 'Horde_Auth_Factory' => new Horde_Core_Binder_AuthFactory(), 'Horde_Core_Auth_Signup' => new Horde_Core_Binder_AuthSignup(), ); @@ -1344,7 +1343,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_Factory')->getAuth($app)->requireAuth() && + $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create($app)->requireAuth() && ($perms != Horde_Perms::SHOW)) { return false; } @@ -1758,7 +1757,7 @@ class Horde_Registry if (!$this->getAuth()) { $this->getCleanSession(); } - return $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth($app)->transparent(); + return $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create($app)->transparent(); } return false; @@ -1828,7 +1827,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_Factory')->getAuth()->getError(); + $options['reason'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->getError(); } if (empty($options['app']) || @@ -1851,7 +1850,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_Factory')->getAuth()->getError(true) + ? $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->getError(true) : $options['msg']; } } @@ -2087,7 +2086,7 @@ class Horde_Registry */ public function checkExistingAuth() { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); if (!empty($GLOBALS['conf']['auth']['checkip']) && !empty($_SESSION['horde_auth']['remoteAddr']) && diff --git a/framework/Core/package.xml b/framework/Core/package.xml index 69eda8739..4ed31e19e 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -110,10 +110,7 @@ Application Framework. - - - @@ -420,10 +417,7 @@ Application Framework. - - - diff --git a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php index 8fcf83077..0e8837c95 100644 --- a/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php +++ b/framework/Kolab_Resource/lib/Horde/Kolab/Resource.php @@ -182,7 +182,7 @@ class Kolab_Resource $calendar_user = $conf['kolab']['filter']['calendar_id'] . '@' . $domain; /* Load the authentication libraries */ - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(isset($conf['auth']['driver']) ? null : 'kolab'); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(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 261a5a67e..547f824b8 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); $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 7af46c948..157cad414 100644 --- a/framework/Rpc/lib/Horde/Rpc/Webdav.php +++ b/framework/Rpc/lib/Horde/Rpc/Webdav.php @@ -818,7 +818,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc */ function check_auth($type, $username, $password) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); return $auth->authenticate($username, array('password' => $password)); } diff --git a/framework/SyncML/SyncML/Backend/Horde.php b/framework/SyncML/SyncML/Backend/Horde.php index 82f3a0611..f9616d351 100644 --- a/framework/SyncML/SyncML/Backend/Horde.php +++ b/framework/SyncML/SyncML/Backend/Horde.php @@ -461,7 +461,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { */ function _checkAuthentication($username, $password) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); return $auth->authenticate($username, array('password' => $password)) ? $GLOBALS['registry']->getAuth() : false; @@ -849,7 +849,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { } /* Get an Auth object. */ - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); /* Make this user an admin for the time beeing to allow deletion of * user data. */ @@ -896,7 +896,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { { /* Get an Auth object. */ try { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); } catch (Horde_Exception $e) { // TODO } diff --git a/hermes/lib/Forms/Search.php b/hermes/lib/Forms/Search.php index 53db1c046..53441a169 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 23da1c4b2..3d6453fab 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); $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 a39bea0dd..6ce80d03c 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); if (!$auth->hasCapability('list')) { return array('text', array()); } diff --git a/horde/admin/groups.php b/horde/admin/groups.php index f193659bb..309a8a589 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $form = null; $reload = false; diff --git a/horde/admin/signup_confirm.php b/horde/admin/signup_confirm.php index d3fb78edd..932fb9419 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 b340f17b7..183311049 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 bb49fc181..440016a59 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_Factory')->getAuth()->hasCapability('update'); + $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->hasCapability('update'); } catch (Horde_Exception $e) { $ui->suppressGroups[] = 'forgotpass'; } diff --git a/horde/login.php b/horde/login.php index a75729f04..3788de69c 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_Factory')->getAuth(($is_auth && $vars->app) ? $vars->app : null); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(($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 a20fd4297..bdc8ac965 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); // Check for COOKIE auth. if (empty($_COOKIE['user']) || diff --git a/horde/scripts/get_login.php b/horde/scripts/get_login.php index bfbe09b54..3d8e52afe 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); // 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 552cee96a..1847f4536 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); // Check for HTTP auth. if (empty($_SERVER['PHP_AUTH_USER']) || diff --git a/horde/services/changepassword.php b/horde/services/changepassword.php index 25d571d35..c2be25f1e 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 374cc1fa5..1b22a8c66 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 1a6c74784..abf0cf1c2 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_Core_Factory_Share')->create($app); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $help = $registry->hasMethod('shareHelp', $app) ? $registry->callByPackage($app, 'shareHelp') : null; diff --git a/horde/signup.php b/horde/signup.php index d4e505e58..b68906d8e 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); // 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 64deb9041..afc3140ab 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_Factory')->getAuth(); + $this->auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); $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 4af5c38d0..2fe7ccc1f 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 ae9f25c89..0b98afed6 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); 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 a47b873ea..33699572d 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1725,7 +1725,7 @@ class Kronolith */ public static function readPermsForm($share) { - $auth = $GLOBALS['injector']->getInstance('Horde_Auth_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); $perm = $share->getPermission(); $errors = array(); diff --git a/kronolith/perms.php b/kronolith/perms.php index 68f96a2dd..7d27aa22e 100644 --- a/kronolith/perms.php +++ b/kronolith/perms.php @@ -23,7 +23,7 @@ if (!empty($conf['share']['no_sharing'])) { $shares = $injector->getInstance('Horde_Core_Factory_Share')->create(); $groups = $injector->getInstance('Horde_Group'); -$auth = $injector->getInstance('Horde_Auth_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); $reload = false; $actionID = Horde_Util::getFormData('actionID', 'edit'); diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index 68c4cb159..e3e4b646e 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -1,5 +1,5 @@ getInstance('Horde_Auth_Factory')->getAuth(); +$auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); $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 cb1805011..8f097b526 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_Factory')->getAuth(); +$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); if ($auth->hasCapability('list')) { $users = $auth->listUsers(); } diff --git a/whups/lib/Forms/Admin/User.php b/whups/lib/Forms/Admin/User.php index 2bafccc80..a88ae32d0 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); 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 8a40f5fa1..a04a4b137 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_Factory')->getAuth(); + $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create(); if ($auth->hasCapability('list')) { foreach ($auth->listUsers() as $user) { diff --git a/wicked/scripts/wicked.php b/wicked/scripts/wicked.php index d73f2e9ed..7f4ce54e7 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_Factory')->getAuth(); + $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); if (!$auth->authenticate($username, array('password' => $password))) { $error = _("Login is incorrect."); Horde::logMessage($error, 'ERR');