From: Michael M Slusarz Date: Tue, 1 Jun 2010 19:11:26 +0000 (-0600) Subject: Move authenticateFailure() and getLogoutUrl() from horde/Auth to horde/Core X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ab0b2256b777f895fce1f4fde2db62b01a536747;p=horde.git Move authenticateFailure() and getLogoutUrl() from horde/Auth to horde/Core --- diff --git a/babel/lib/base.php b/babel/lib/base.php index bd0623151..149b82885 100644 --- a/babel/lib/base.php +++ b/babel/lib/base.php @@ -28,7 +28,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('babel', array('logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('babel', $e); + $registry->authenticateFailure('babel', $e); } $conf = &$GLOBALS['conf']; diff --git a/crumb/lib/base.php b/crumb/lib/base.php index 47d185673..56437d84e 100644 --- a/crumb/lib/base.php +++ b/crumb/lib/base.php @@ -24,7 +24,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('crumb', array('logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('crumb', $e); + $registry->authenticateFailure('crumb', $e); } $conf = &$GLOBALS['conf']; @define('CRUMB_TEMPLATES', $registry->get('templates')); diff --git a/fima/lib/base.php b/fima/lib/base.php index f3ab5227f..edf566344 100644 --- a/fima/lib/base.php +++ b/fima/lib/base.php @@ -28,7 +28,7 @@ if ($session_control == 'none') { try { $registry->pushApp('fima', array('logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('fima', $e); + $registry->authenticateFailure('fima', $e); } $conf = &$GLOBALS['conf']; @define('FIMA_TEMPLATES', $registry->get('templates')); diff --git a/folks/account/approve.php b/folks/account/approve.php index 81e40742c..2d878f272 100644 --- a/folks/account/approve.php +++ b/folks/account/approve.php @@ -18,34 +18,34 @@ $title = _("Confirm email"); $code = Horde_Util::getGet('code'); if (empty($code)) { $notification->push(_("You must supply a confirmation code.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get supplied username $user = Horde_Util::getGet('user'); if (empty($code)) { $notification->push(_("You must supply a username.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get user profile $profile = $folks_driver->getProfile($user); if ($profile instanceof PEAR_Error) { $notification->push($profile); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // This pages is only to activate users if ($profile['user_status'] != 'inactive') { $notification->push(_("User \"%s\" was already activated.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get internal confirmation code $internal_code = $folks_driver->getConfirmationCode($user, 'activate'); if ($internal_code instanceof PEAR_Error) { $notification->push($internal_code); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Check code @@ -60,4 +60,4 @@ if ($internal_code == $code) { $notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning'); } -Horde_Auth::authenticateFailure('folks'); +$registry->authenticateFailure('folks'); diff --git a/folks/account/renew.php b/folks/account/renew.php index a8d3390e9..94107d070 100644 --- a/folks/account/renew.php +++ b/folks/account/renew.php @@ -18,34 +18,34 @@ $title = _("Renew account"); $code = Horde_Util::getGet('code'); if (empty($code)) { $notification->push(_("You must supply a confirmation code.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get supplied username $user = Horde_Util::getGet('user'); if (empty($code)) { $notification->push(_("You must supply a username.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get user profile $profile = $folks_driver->getProfile($user); if ($profile instanceof PEAR_Error) { $notification->push($profile); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // This pages is only to activate users if ($profile['user_status'] != 'deleted') { $notification->push(_("User \"%s\" is not market to be in the removal process.")); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Get internal confirmation code $internal_code = $folks_driver->getConfirmationCode($user, 'renew'); if ($internal_code instanceof PEAR_Error) { $notification->push($internal_code); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } // Check code @@ -60,4 +60,4 @@ if ($internal_code == $code) { $notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning'); } -Horde_Auth::authenticateFailure('folks'); +$registry->authenticateFailure('folks'); diff --git a/folks/account/resetpassword.php b/folks/account/resetpassword.php index 17f5e1da0..764dfce82 100644 --- a/folks/account/resetpassword.php +++ b/folks/account/resetpassword.php @@ -38,7 +38,7 @@ if ($registry->isAuthenticated()) { $auth = $injector->getInstance('Horde_Auth')->getOb(); if (!$auth->hasCapability('resetpassword')) { $notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $vars = Horde_Variables::getDefaultVariables(); @@ -81,7 +81,7 @@ if ($form->validate()) { $email = Folks::getUserEmail($info['username']); if ($email instanceof PEAR_Error) { $notification->push($email); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } /* Check the given values with the prefs stored ones. */ @@ -92,7 +92,7 @@ if ($form->validate()) { $password = $auth->resetPassword($info['username']); if ($password instanceof PEAR_Error) { $notification->push($password); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $body = sprintf(_("Your new password for %s is: %s. \n\n It was requested by %s on %s"), @@ -104,7 +104,7 @@ if ($form->validate()) { Folks::sendMail($email, _("Your password has been reset"), $body); $notification->push(sprintf(_("Your password has been reset, check your email (%s) and log in with your new password."), $email), 'horde.success'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } else { /* Info submitted does not match what is in prefs, redirect user back * to login. */ diff --git a/folks/account/signup.php b/folks/account/signup.php index 16148c2f5..031e7ad49 100644 --- a/folks/account/signup.php +++ b/folks/account/signup.php @@ -18,13 +18,13 @@ $auth = $injector->getInstance('Horde_Auth')->getOb(); if ($conf['signup']['allow'] !== true || !$auth->hasCapability('add')) { $notification->push(_("User Registration has been disabled for this site."), 'horde.error'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $signup = $injector->getInstance('Horde_Core_Auth_Signup'); if ($signup instanceof PEAR_Error) { $notification->push($signup, 'horde.error'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $vars = Horde_Variables::getDefaultVariables(); @@ -43,7 +43,7 @@ if ($form->validate()) { $success_message = sprintf(_("Added \"%s\" to the system. You can log in now."), $info['user_name']); } $notification->push($success_message, 'horde.success'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } catch (Horde_Exception $e) { $notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $info['user_name'], $e->getMessage()), 'horde.error'); } diff --git a/folks/account/username.php b/folks/account/username.php index 72c269b5b..583167c14 100644 --- a/folks/account/username.php +++ b/folks/account/username.php @@ -41,7 +41,7 @@ if ($form->validate()) { Folks::sendMail($info['email'], _("Your username was requested"), $body); $notification->push(sprintf(_("Your username was sent, check your email (%s)."), $users['user_email']), 'horde.success'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } } diff --git a/folks/edit/friends/approve.php b/folks/edit/friends/approve.php index d43b6f510..0c7ebf464 100644 --- a/folks/edit/friends/approve.php +++ b/folks/edit/friends/approve.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../lib/base.php'; require_once FOLKS_BASE . '/lib/Friends.php'; if (!$registry->isAuthenticated()) { - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $user = Horde_Util::getGet('user'); diff --git a/folks/edit/friends/reject.php b/folks/edit/friends/reject.php index 628dcf693..a0855393d 100644 --- a/folks/edit/friends/reject.php +++ b/folks/edit/friends/reject.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../lib/base.php'; require_once FOLKS_BASE . '/lib/Friends.php'; if (!$registry->isAuthenticated()) { - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $user = Horde_Util::getGet('user'); diff --git a/folks/edit/password.php b/folks/edit/password.php index 21ae062cd..f02457dff 100644 --- a/folks/edit/password.php +++ b/folks/edit/password.php @@ -19,7 +19,7 @@ require_once 'tabs.php'; $auth = $injector->getInstance('Horde_Auth')->getOb(); if (!$auth->hasCapability('resetpassword')) { $notification->push(_("Cannot update password, contact your administrator."), 'horde.error'); - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } */ diff --git a/folks/edit/tabs.php b/folks/edit/tabs.php index 12ef40521..e4632a34f 100644 --- a/folks/edit/tabs.php +++ b/folks/edit/tabs.php @@ -12,7 +12,7 @@ */ if (!$registry->isAuthenticated()) { - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $vars = Horde_Variables::getDefaultVariables(); diff --git a/folks/friends.php b/folks/friends.php index 085902998..6e6aa73a4 100644 --- a/folks/friends.php +++ b/folks/friends.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; require_once FOLKS_BASE . '/lib/Forms/Activity.php'; if (!$registry->isAuthenticated()) { - Horde_Auth::authenticateFailure('folks'); + $registry->authenticateFailure('folks'); } $title = _("Friends"); diff --git a/folks/lib/base.php b/folks/lib/base.php index 19480b651..2b1f81b38 100644 --- a/folks/lib/base.php +++ b/folks/lib/base.php @@ -21,7 +21,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('folks', array('check_perms' => (Horde_Util::nonInputVar('folks_authentication') != 'none'))); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('folks', $e); + $registry->authenticateFailure('folks', $e); } $conf = &$GLOBALS['conf']; define('FOLKS_TEMPLATES', $registry->get('templates')); diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index 07fc34e35..13e927400 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -386,102 +386,6 @@ class Horde_Auth } /** - * Handle authentication failures, redirecting to the login page - * when appropriate. - * - * @param string $app The app which failed authentication. - * @param Horde_Exception $e An exception thrown by - * Horde_Registry::pushApp(). - * - * @throws Horde_Exception - */ - static public function authenticateFailure($app = 'horde', $e = null) - { - if (Horde_Cli::runningFromCLI()) { - $cli = new Horde_Cli(); - $cli->fatal(_("You are not authenticated.")); - } - - if (is_null($e)) { - $params = array(); - } else { - switch ($e->getCode()) { - case Horde_Registry::PERMISSION_DENIED: - $params = array('app' => $app, 'reason' => self::REASON_MESSAGE, 'msg' => $e->getMessage()); - break; - - case Horde_Registry::AUTH_FAILURE: - $params = array('app' => $app); - break; - - default: - throw $e; - } - } - - header('Location: ' . self::getLogoutUrl($params)); - exit; - } - - /** - * Return a URL to the login screen, adding the necessary logout - * parameters. - * If no reason/msg is passed in, use the current global authentication - * error message. - * - * @param array $options Additional options: - *
-     * 'app' - (string) Authenticate to this application
-     *         DEFAULT: Horde
-     * 'msg' - (string) If reason is self::REASON_MESSAGE, the message
-     *         to display to the user.
-     *         DEFAULT: None
-     * 'params' - (array) Additional params to add to the URL (not allowed:
-     *            'app', 'horde_logout_token', 'msg', 'nosidebar', 'reason',
-     *            'url').
-     *            DEFAULT: None
-     * 'reason' - (integer) The reason for logout
-     *            DEFAULT: None
-     * 
- * - * @return string The formatted URL - */ - static public function getLogoutUrl($options = array()) - { - if (!isset($options['reason'])) { - $options['reason'] = self::getAuthError(); - } - - if (empty($options['app']) || - ($options['app'] == 'horde') || - ($options['reason'] == self::REASON_LOGOUT)) { - $params = array( - 'horde_logout_token' => Horde::getRequestToken('horde.logout'), - 'nosidebar' => 1 - ); - } else { - $params = array( - 'url' => Horde::selfUrl(true, true, true) - ); - } - - if (isset($options['app'])) { - $params['app'] = $options['app']; - } - - if ($options['reason']) { - $params[self::REASON_PARAM] = $options['reason']; - if ($options['reason'] == self::REASON_MESSAGE) { - $params[self::REASON_MSG_PARAM] = empty($options['msg']) - ? self::getAuthError(true) - : $options['msg']; - } - } - - return Horde::getServiceLink('login', 'horde')->add($params)->setRaw(true); - } - - /** * Return whether the authentication backend requested a password change. * * @return boolean Whether the backend requested a password change. diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index d26906fa5..ac97489d7 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -462,7 +462,7 @@ HTML; ->add('return_url', urlencode(self::selfUrl(true, true, true))); case 'logout': - return Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_LOGOUT))->setRaw(false); + return $GLOBALS['registry']->getLogoutUrl(array('reason' => Horde_Auth::REASON_LOGOUT))->setRaw(false); case 'login': return self::url($webroot . '/login.php'); diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index c27961be6..ea7e83939 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -192,7 +192,7 @@ class Horde_Registry throw $e; } - Horde_Auth::authenticateFailure($app, $e); + $GLOBALS['registry']->authenticateFailure($app, $e); } $GLOBALS['registry']->initialApp = $app; @@ -1689,4 +1689,99 @@ class Horde_Registry return $auth->transparent(); } + /** + * Handle authentication failures, redirecting to the login page + * when appropriate. + * + * @param string $app The app which failed authentication. + * @param Horde_Exception $e An exception thrown by pushApp(). + * + * @throws Horde_Exception + */ + public function authenticateFailure($app = 'horde', $e = null) + { + if (Horde_Cli::runningFromCLI()) { + $cli = new Horde_Cli(); + $cli->fatal(_("You are not authenticated.")); + } + + if (is_null($e)) { + $params = array(); + } else { + switch ($e->getCode()) { + case self::PERMISSION_DENIED: + $params = array('app' => $app, 'reason' => Horde_Auth::REASON_MESSAGE, 'msg' => $e->getMessage()); + break; + + case self::AUTH_FAILURE: + $params = array('app' => $app); + break; + + default: + throw $e; + } + } + + header('Location: ' . $this->getLogoutUrl($params)); + exit; + } + + /** + * Return a URL to the login screen, adding the necessary logout + * parameters. + * If no reason/msg is passed in, use the current global authentication + * error message. + * + * @param array $options Additional options: + *
+     * 'app' - (string) Authenticate to this application
+     *         DEFAULT: Horde
+     * 'msg' - (string) If reason is Horde_Auth::REASON_MESSAGE, the message
+     *         to display to the user.
+     *         DEFAULT: None
+     * 'params' - (array) Additional params to add to the URL (not allowed:
+     *            'app', 'horde_logout_token', 'msg', 'nosidebar', 'reason',
+     *            'url').
+     *            DEFAULT: None
+     * 'reason' - (integer) The reason for logout
+     *            DEFAULT: None
+     * 
+ * + * @return string The formatted URL + */ + public function getLogoutUrl(array $options = array()) + { + if (!isset($options['reason'])) { + $options['reason'] = Horde_Auth::getAuthError(); + } + + if (empty($options['app']) || + ($options['app'] == 'horde') || + ($options['reason'] == Horde_Auth::REASON_LOGOUT)) { + $params = array( + 'horde_logout_token' => Horde::getRequestToken('horde.logout'), + 'nosidebar' => 1 + ); + } else { + $params = array( + 'url' => Horde::selfUrl(true, true, true) + ); + } + + if (isset($options['app'])) { + $params['app'] = $options['app']; + } + + if ($options['reason']) { + $params[Horde_Auth::REASON_PARAM] = $options['reason']; + if ($options['reason'] == Horde_Auth::REASON_MESSAGE) { + $params[Horde_Auth::REASON_MSG_PARAM] = empty($options['msg']) + ? Horde_Auth::getAuthError(true) + : $options['msg']; + } + } + + return Horde::getServiceLink('login', 'horde')->add($params)->setRaw(true); + } + } diff --git a/horde/lib/LoginTasks/Task/TosAgreement.php b/horde/lib/LoginTasks/Task/TosAgreement.php index a127945cb..689ab303c 100644 --- a/horde/lib/LoginTasks/Task/TosAgreement.php +++ b/horde/lib/LoginTasks/Task/TosAgreement.php @@ -50,7 +50,7 @@ class Horde_LoginTasks_Task_TosAgreement extends Horde_LoginTasks_Task { if (Horde_Util::getFormData('not_agree')) { Horde_Auth::setAuthError(Horde_Auth::REASON_MESSAGE, _("You did not agree to the Terms of Service agreement, so you were not allowed to login.")); - Horde_Auth::authenticateFailure('horde'); + $GLOBALS['registry']->authenticateFailure('horde'); } } diff --git a/horde/services/ajax.php b/horde/services/ajax.php index eb9756c6f..7d48e647f 100644 --- a/horde/services/ajax.php +++ b/horde/services/ajax.php @@ -38,12 +38,12 @@ try { /* Handle session timeouts when they come from an AJAX request. */ if ($e->getCode() == Horde_Registry::AUTH_FAILURE) { $ajax = Horde_Ajax::getInstance($app); - $GLOBALS['notification']->push(str_replace('&', '&', Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION))), 'horde.ajaxtimeout', array('content.raw')); + $notification->push(str_replace('&', '&', $registry->getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION))), 'horde.ajaxtimeout', array('content.raw')); Horde::sendHTTPResponse(Horde::prepareResponse(null, $ajax->notify), $ajax->responseType()); exit; } - Horde_Auth::authenticateFailure($app, $e); + $registry->authenticateFailure($app, $e); } } diff --git a/horde/services/portal/sidebar.php b/horde/services/portal/sidebar.php index ca1644689..221fd2d2e 100644 --- a/horde/services/portal/sidebar.php +++ b/horde/services/portal/sidebar.php @@ -208,7 +208,7 @@ require_once dirname(__FILE__) . '/../../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none')); if (!Horde_Auth::getAuth() && !$conf['menu']['always']) { - Horde_Auth::authenticateFailure(); + $registry->authenticateFailure(); } $is_mozbar = (bool)Horde_Util::getFormData('mozbar'); diff --git a/jonah/channels/index.php b/jonah/channels/index.php index 0107773bc..a8513f783 100644 --- a/jonah/channels/index.php +++ b/jonah/channels/index.php @@ -16,7 +16,7 @@ $jonah = Horde_Registry::appInit('jonah'); if (!Jonah::checkPermissions('jonah:news', Horde_Perms::EDIT)) { $notification->push(_("You are not authorised for this action."), 'horde.warning'); - Horde_Auth::authenticateFailure(); + $registry->authenticateFailure(); } $have_news = Jonah_News::getAvailableTypes(); diff --git a/kastalia/download.php b/kastalia/download.php index 92469156c..2682ee0cf 100755 --- a/kastalia/download.php +++ b/kastalia/download.php @@ -34,7 +34,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('kastalia', $e); + $registry->authenticateFailure('kastalia', $e); } //################### ################### diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php index 1f8b6cb88..104833be7 100644 --- a/kastalia/lib/base.php +++ b/kastalia/lib/base.php @@ -24,7 +24,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('kastalia', $e); + $registry->authenticateFailure('kastalia', $e); } $conf = &$GLOBALS['conf']; @define('KASTALIA_TEMPLATES', $registry->get('templates')); diff --git a/news/add.php b/news/add.php index ca5ec7bfa..f6ef15b7d 100644 --- a/news/add.php +++ b/news/add.php @@ -90,7 +90,7 @@ function _max_upload_size() // Is logged it? if (!$registry->isAuthenticated()) { $notification->push(_("Only authenticated users can post news."), 'horde.warning'); - Horde_Auth::authenticateFailure('news'); + $registry->authenticateFailure('news'); } // Default vars diff --git a/news/admin/tabs.php b/news/admin/tabs.php index 53bcc4883..bda8b0da9 100644 --- a/news/admin/tabs.php +++ b/news/admin/tabs.php @@ -13,7 +13,7 @@ /* Only admin should be using this. */ if (!$registry->isAdmin(array('permission' => 'news:admin'))) { $notification->push(_("You are not authorised for this action."), 'horde.warning'); - Horde_Auth::authenticateFailure('news'); + $registry->authenticateFailure('news'); } $vars = Horde_Variables::getDefaultVariables(); diff --git a/news/lib/base.php b/news/lib/base.php index 56a9a168a..2d4ff8c60 100644 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -27,7 +27,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('news', array('check_perms' => (Horde_Util::nonInputVar('news_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('news', $e); + $registry->authenticateFailure('news', $e); } $conf = &$GLOBALS['conf']; define('NEWS_TEMPLATES', $registry->get('templates')); diff --git a/news/reads.php b/news/reads.php index fbabfdabc..81657bfe7 100644 --- a/news/reads.php +++ b/news/reads.php @@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; if (!$registry->isAuthenticated()) { - Horde_Auth::authenticateFailure('news'); + $registry->authenticateFailure('news'); } $id = Horde_Util::getFormData('id', 0); diff --git a/skoli/lib/base.php b/skoli/lib/base.php index a04f8aacd..4c535b165 100644 --- a/skoli/lib/base.php +++ b/skoli/lib/base.php @@ -20,7 +20,7 @@ $registry = new Horde_Registry(); try { $registry->pushApp('skoli', array('check_perms' => (Horde_Util::nonInputVar('skoli_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { - Horde_Auth::authenticateFailure('skoli', $e); + $registry->authenticateFailure('skoli', $e); } $conf = &$GLOBALS['conf']; @define('SKOLI_TEMPLATES', $registry->get('templates')); diff --git a/vilma/domains/delete.php b/vilma/domains/delete.php index 999f35f88..0f8f7fde5 100644 --- a/vilma/domains/delete.php +++ b/vilma/domains/delete.php @@ -15,7 +15,7 @@ require_once VILMA_BASE . '/lib/Forms/DeleteDomainForm.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Horde_Variables::getDefaultVariables(); diff --git a/vilma/domains/edit.php b/vilma/domains/edit.php index 36b7b220a..d3030605e 100644 --- a/vilma/domains/edit.php +++ b/vilma/domains/edit.php @@ -15,7 +15,7 @@ require_once VILMA_BASE . '/lib/Forms/EditDomainForm.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } //$domain_id = Horde_Util::getFormData('domain_id'); diff --git a/vilma/domains/index.php b/vilma/domains/index.php index 5ace93388..4f0b2d32e 100644 --- a/vilma/domains/index.php +++ b/vilma/domains/index.php @@ -13,7 +13,7 @@ require_once VILMA_BASE . '/lib/base.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } // Having a current domain doesn't make sense on this page diff --git a/vilma/lib/base.php b/vilma/lib/base.php index d7b88879c..fb55cb4a5 100644 --- a/vilma/lib/base.php +++ b/vilma/lib/base.php @@ -25,7 +25,7 @@ try { $registry->pushApp('vilma', !defined('AUTH_HANDLER')); } catch (Horde_Exception $e) { if ($e->getCode() == 'permission_denied') { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } Horde::fatal($e, __FILE__, __LINE__, false); } diff --git a/vilma/users/delete.php b/vilma/users/delete.php index 08720ec8e..01dd2c103 100644 --- a/vilma/users/delete.php +++ b/vilma/users/delete.php @@ -14,7 +14,7 @@ require_once 'Horde/Form.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Horde_Variables::getDefaultVariables(); diff --git a/vilma/users/edit.php b/vilma/users/edit.php index 03056c9c5..ad0090420 100644 --- a/vilma/users/edit.php +++ b/vilma/users/edit.php @@ -19,7 +19,7 @@ require_once VILMA_BASE . '/lib/Forms/EditUserForm.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Horde_Variables::getDefaultVariables(); $address = $vars->get('address'); diff --git a/vilma/users/editAlias.php b/vilma/users/editAlias.php index 784e7fa31..05483d268 100644 --- a/vilma/users/editAlias.php +++ b/vilma/users/editAlias.php @@ -19,7 +19,7 @@ require_once VILMA_BASE . '/lib/Forms/EditAliasForm.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Variables::getDefaultVariables(); diff --git a/vilma/users/editForward.php b/vilma/users/editForward.php index 57afa2301..af3caabaa 100644 --- a/vilma/users/editForward.php +++ b/vilma/users/editForward.php @@ -19,7 +19,7 @@ require_once VILMA_BASE . '/lib/Forms/EditForwardForm.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($domain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Variables::getDefaultVariables(); diff --git a/vilma/users/index.php b/vilma/users/index.php index dde6d1dd4..d4381e421 100644 --- a/vilma/users/index.php +++ b/vilma/users/index.php @@ -15,7 +15,7 @@ require_once VILMA_BASE . '/lib/base.php'; /* Only admin should be using this. */ if (!Vilma::hasPermission($curdomain)) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } // Input validation: make sure we have a valid section diff --git a/vilma/virtuals/delete.php b/vilma/virtuals/delete.php index a1a9fa5b2..c369772cb 100644 --- a/vilma/virtuals/delete.php +++ b/vilma/virtuals/delete.php @@ -14,7 +14,7 @@ require_once 'Horde/Form.php'; /* Only admin should be using this. */ if (!$registry->isAdmin()) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $vars = Horde_Variables::getDefaultVariables(); diff --git a/vilma/virtuals/edit.php b/vilma/virtuals/edit.php index a0229692e..c1af4d312 100644 --- a/vilma/virtuals/edit.php +++ b/vilma/virtuals/edit.php @@ -15,7 +15,7 @@ require_once 'Horde/Form/Action.php'; /* Only admin should be using this. */ if (!$registry->isAdmin() && !Vilma::isDomainAdmin()) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $domain = Vilma::getDomain(); diff --git a/vilma/virtuals/index.php b/vilma/virtuals/index.php index 11fccc876..01de54f39 100644 --- a/vilma/virtuals/index.php +++ b/vilma/virtuals/index.php @@ -13,7 +13,7 @@ require_once VILMA_BASE . '/lib/base.php'; /* Only admin should be using this. */ if (!$registry->isAdmin() && !Vilma::isDomainAdmin()) { - Horde_Auth::authenticateFailure('vilma', $e); + $registry->authenticateFailure('vilma', $e); } $user = Horde_Util::getFormData('user'); diff --git a/whups/admin/index.php b/whups/admin/index.php index 4d6391f9d..aa7856fe2 100644 --- a/whups/admin/index.php +++ b/whups/admin/index.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('whups'); if (!$registry->isAdmin(array('permission' => 'whups:admin'))) { - Horde_Auth::authenticateFailure('whups', $e); + $registry->authenticateFailure('whups', $e); } // Set up the page config vars.