diff --git a/module/VuFind/src/VuFind/Auth/AbstractBase.php b/module/VuFind/src/VuFind/Auth/AbstractBase.php index e72c3b5b38a88b17f3cc54f3352b0e5ac500ae46..828b9b5cc4e2bf3ef4597f7a02de57677708db61 100644 --- a/module/VuFind/src/VuFind/Auth/AbstractBase.php +++ b/module/VuFind/src/VuFind/Auth/AbstractBase.php @@ -212,17 +212,6 @@ abstract class AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface return false; } - /** - * Does the class allow for authentication from more than one auth method? - * If so return an array that lists the classes for the methods allowed. - * - * @return array | bool - */ - public function getClasses() - { - return false; - } - /** * Get access to the user table. * diff --git a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php index 83c1c20efa7b8a8f89093b9353e59a2f47a1526e..43eb6f2bf20a5a439e1346e9423cb355a1358116 100644 --- a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php +++ b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php @@ -213,19 +213,15 @@ class ChoiceAuth extends AbstractBase } /** - * Does the class allow for authentication from more than one strategy? - * If so return an array that lists the classes for the strategies allowed. + * Return an array of authentication options allowed by this class. * - * @return array | bool + * @return array */ - public function getClasses() + public function getSelectableAuthOptions() { - $classes = array(); - foreach ($this->strategies as $strategy) { - $classes[] = get_class($this->manager->get($strategy)); - } - return $classes; + return $this->strategies; } + /** * Perform cleanup at logout time. * diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 932f5be24acb432af373b39f4fbaab2c9b030eaf..573bd6fa7558a6023be755209289f2e24237cdfe 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -42,25 +42,18 @@ use VuFind\Db\Row\User as UserRow, VuFind\Db\Table\User as UserTable, class Manager { /** - * Authentication module (false if uninitialized) + * Authentication modules * - * @var \VuFind\Auth\AbstractBase|bool + * @var \VuFind\Auth\AbstractBase[] */ - protected $auth = false; + protected $auth = array(); /** - * Authentication module currently proxied (false if uninitialized) + * Currently selected authentication module * - * @var \VuFind\Auth\AbstractBase|bool + * @var string */ - protected $authProxied = false; - - /** - * Authentication module to proxy (false if uninitialized) - * - * @var string|bool - */ - protected $authToProxy = false; + protected $activeAuth; /** * VuFind configuration @@ -116,6 +109,8 @@ class Manager SessionManager $sessionManager, PluginManager $pm ) { $this->config = $config; + $this->activeAuth = isset($config->Authentication->method) + ? $config->Authentication->method : null; $this->userTable = $userTable; $this->sessionManager = $sessionManager; $this->pluginManager = $pm; @@ -125,21 +120,17 @@ class Manager /** * Get the authentication handler. * + * @param string $name Auth module to load (null for currently active one) + * * @return AbstractBase */ - protected function getAuth() + protected function getAuth($name = null) { - if ($this->authToProxy == false) { - if (!$this->auth) { - $this->auth = $this->makeAuth($this->config->Authentication->method); - } - return $this->auth; - } else { - if (!$this->authProxied) { - $this->authProxied = $this->makeAuth($this->authToProxy); - } - return $this->authProxied; + $name = empty($name) ? $this->activeAuth : $name; + if (!isset($this->auth[$name])) { + $this->auth[$name] = $this->makeAuth($name); } + return $this->auth[$name]; } /** @@ -166,10 +157,7 @@ class Manager */ public function supportsCreation($authMethod=null) { - if ($authMethod != null) { - $this->setActiveAuthClass($authMethod); - } - return $this->getAuth()->supportsCreation(); + return $this->getAuth($authMethod)->supportsCreation(); } /** @@ -182,10 +170,7 @@ class Manager */ public function supportsRecovery($authMethod=null) { - if ($authMethod != null) { - $this->setActiveAuthClass($authMethod); - } - if ($this->getAuth()->supportsPasswordChange()) { + if ($this->getAuth($authMethod)->supportsPasswordChange()) { return isset($this->config->Authentication->recover_password) && $this->config->Authentication->recover_password; } @@ -202,10 +187,7 @@ class Manager */ public function supportsPasswordChange($authMethod=null) { - if ($authMethod != null) { - $this->setActiveAuthClass($authMethod); - } - if ($this->getAuth()->supportsPasswordChange()) { + if ($this->getAuth($authMethod)->supportsPasswordChange()) { return isset($this->config->Authentication->change_password) && $this->config->Authentication->change_password; } @@ -237,20 +219,21 @@ class Manager } /** - * Does the current auth class allow for authentication from more than - * one auth method? (e.g. choiceauth) - * If so return an array that lists the classes for the methods allowed. + * Return an array of all of the authentication options supported by the + * current auth class. In most cases (except for ChoiceAuth), this will + * just contain a single value. * * @return array */ - public function getAuthClasses() + public function getSelectableAuthOptions() { - $classes = $this->getAuth()->getClasses(); - if ($classes) { - return $classes; - } else { - return array($this->getAuthClass()); + $auth = $this->getAuth(); + if (is_callable(array($auth, 'getSelectableAuthOptions'))) { + if ($methods = $auth->getSelectableAuthOptions()) { + return $methods; + } } + return array($this->getAuthMethod()); } /** @@ -288,9 +271,7 @@ class Manager */ public function getAuthMethod() { - $className = $this->getAuthClass(); - $classParts = explode('\\', $className); - return array_pop($classParts); + return $this->activeAuth; } /** @@ -416,17 +397,15 @@ class Manager * Update a user's password from the request. * * @param \Zend\Http\PhpEnvironment\Request $request Request object containing - * new account details. + * password change details. * * @throws AuthException * @return UserRow New user row. */ public function updatePassword($request) { - if (($authMethod = $request->getPost()->get('auth_method')) != null) { - $this->setActiveAuthClass($authMethod); - } - $user = $this->getAuth()->updatePassword($request); + $authMethod = $request->getPost()->get('auth_method'); + $user = $this->getAuth($authMethod)->updatePassword($request); $this->updateSession($user); return $user; } @@ -474,9 +453,8 @@ class Manager * * @return void */ - public function setActiveAuthClass($method) + public function setAuthMethod($method) { - $this->authToProxy = $method; - $this->authProxied = false; + $this->activeAuth = $method; } } diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index 08c9a35f129aac5f392e1538023ac14c2e3f8341..a6623b55c7ee141dc9c64c8d5ef007be22958667 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -143,12 +143,10 @@ class MyResearchController extends AbstractBase if ($this->getAuthManager()->isLoggedIn()) { return $this->redirect()->toRoute('myresearch-home'); } - // if the current auth class proxies others, we'll get the proxied - // auth method as a querystring parameter. - $method = trim($this->params()->fromQuery('auth_method')); // If authentication mechanism does not support account creation, send // the user away! - if (!$this->getAuthManager()->supportsCreation($method)) { + $this->setUpAuthenticationFromRequest(); + if (!$this->getAuthManager()->supportsCreation()) { return $this->forwardTo('MyResearch', 'Home'); } @@ -1118,8 +1116,8 @@ class MyResearchController extends AbstractBase public function recoverAction() { // Make sure we're configured to do this - $method = trim($this->params()->fromQuery('auth_method')); - if (!$this->getAuthManager()->supportsRecovery($method)) { + $this->setUpAuthenticationFromRequest(); + if (!$this->getAuthManager()->supportsRecovery()) { $this->flashMessenger()->setNamespace('error') ->addMessage('recovery_disabled'); return $this->redirect()->toRoute('myresearch-home'); @@ -1142,7 +1140,7 @@ class MyResearchController extends AbstractBase // If we have a submitted form if ($this->formWasSubmitted('submit', $view->useRecaptcha)) { if ($user) { - $this->sendRecoveryEmail($user, $this->getConfig(), $method); + $this->sendRecoveryEmail($user, $this->getConfig()); } else { $this->flashMessenger()->setNamespace('error') ->addMessage('recovery_user_not_found'); @@ -1156,11 +1154,10 @@ class MyResearchController extends AbstractBase * * @param \VuFind\Db\Row\User $user User object we're recovering * @param \VuFind\Config $config Configuration object - * @param string $method Active authentication method * * @return void (sends email or adds error message) */ - protected function sendRecoveryEmail($user, $config, $method) + protected function sendRecoveryEmail($user, $config) { // If we can't find a user if (null == $user) { @@ -1182,6 +1179,7 @@ class MyResearchController extends AbstractBase $user->updateHash(); $config = $this->getConfig(); $renderer = $this->getViewRenderer(); + $method = $this->getAuthManager()->getAuthMethod(); // Custom template for emails (text-only) $message = $renderer->render( 'Email/recover-password.phtml', @@ -1232,8 +1230,10 @@ class MyResearchController extends AbstractBase $user = $table->getByVerifyHash($hash); // If the hash is valid, forward user to create new password if (null != $user) { + $this->setUpAuthenticationFromRequest(); $view = $this->createViewModel(); - $view->auth_method = $this->params()->fromQuery('auth_method'); + $view->auth_method + = $this->getAuthManager()->getAuthMethod(); $view->hash = $hash; $view->username = $user->username; $view->useRecaptcha @@ -1368,4 +1368,17 @@ class MyResearchController extends AbstractBase { return intval(substr($hash, -10)); } + + /** + * Configure the authentication manager to use a user-specified method. + * + * @return void + */ + protected function setUpAuthenticationFromRequest() + { + $method = trim($this->params()->fromQuery('auth_method')); + if (!empty($method)) { + $this->getAuthManager()->setAuthMethod($method); + } + } } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Auth.php b/module/VuFind/src/VuFind/View/Helper/Root/Auth.php index b17410b37296e4cc6508a8a3ec72bf80711aa130..92c96f6c57db9527ea4e93f524cb82f2fe34fe6c 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Auth.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Auth.php @@ -39,14 +39,6 @@ use Zend\View\Exception\RuntimeException; */ class Auth extends \Zend\View\Helper\AbstractHelper { - /** - * Active auth class (used for auth methods that allow more than one type - * of authentication) - * - * @var string - */ - protected $activeAuthClass; - /** * Authentication manager * @@ -62,7 +54,6 @@ class Auth extends \Zend\View\Helper\AbstractHelper public function __construct(\VuFind\Auth\Manager $manager) { $this->manager = $manager; - $this->activeAuthClass = null; } /** @@ -82,7 +73,7 @@ class Auth extends \Zend\View\Helper\AbstractHelper // Get the current auth module's class name, then start a loop // in case we need to use a parent class' name to find the appropriate // template. - $className = $this->getActiveAuthClass(); + $className = $this->getManager()->getAuthClass(); $topClassName = $className; // for error message while (true) { // Guess the template name for the current class: @@ -176,45 +167,6 @@ class Auth extends \Zend\View\Helper\AbstractHelper return $this->renderTemplate('logindesc.phtml', $context); } - /** - * Setter - * - * @param string $classname Class to use in rendering - * - * @return void - */ - public function setActiveAuthClass($classname) - { - $this->activeAuthClass = $classname; - $this->getManager()->setActiveAuthClass($this->getBriefClass($classname)); - } - - /** - * Accessor for the full class name - * - * @return string - */ - protected function getActiveAuthClass() - { - if ($this->activeAuthClass == null) { - return $this->getManager()->getAuthClass(); - } - return $this->activeAuthClass; - } - - /** - * Accessor for just the last part of the class name - * - * @return string - */ - public function getActiveAuthMethod() - { - if ($this->activeAuthClass == null) { - return $this->getManager()->getAuthClass(); - } - return $this->getBriefClass($this->activeAuthClass); - } - /** * Helper to grab the end of the class name * diff --git a/themes/blueprint/templates/Auth/AbstractBase/login.phtml b/themes/blueprint/templates/Auth/AbstractBase/login.phtml index c60350618bb0392d69ae262dbd784da242c3930c..ebdab8ee4ec1136b8f0f5e3a6e3b9ab7d0aaa092 100644 --- a/themes/blueprint/templates/Auth/AbstractBase/login.phtml +++ b/themes/blueprint/templates/Auth/AbstractBase/login.phtml @@ -3,7 +3,7 @@ <? if (!$sessionInitiator): // display default login form if no login URL provided ?> <form method="post" action="<?=$this->url('myresearch-home')?>" name="loginForm" id="loginForm"> <?=$this->auth()->getLoginFields()?> - <input type="hidden" name="auth_method" value="<?=$this->auth()->getActiveAuthMethod()?>"> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>"> <input class="push-2 button" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> <div class="clear"></div> </form> @@ -13,10 +13,10 @@ echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $initJs, 'SET'); ?> <? if ($account->supportsCreation()): ?> - <a class="new_account" href="<?=$this->url('myresearch-account')?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <a class="new_account" href="<?=$this->url('myresearch-account')?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> <? endif; ?> <? if ($account->supportsRecovery()): ?> - <a class="forgot_password" href="<?=$this->url('myresearch-recover')?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <a class="forgot_password" href="<?=$this->url('myresearch-recover')?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> <? endif; ?> <? else: ?> <a href="<?=$this->escapeHtmlAttr($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> diff --git a/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml b/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml index 714c3dd7c5cf428c32c0ee811dcf6d19e9ee8c37..b4482128d3e9295f047b37118a3763b873c92538 100644 --- a/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml +++ b/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml @@ -1,13 +1,12 @@ <p><?=$this->transEsc('choose_login_method')?></p> <div id="authcontainer"> -<? foreach ($this->auth()->getManager()->getAuthClasses() as $loop=>$class):?> +<? foreach ($this->auth()->getManager()->getSelectableAuthOptions() as $loop=>$method):?> <div class="authmethod<?=$loop?>"> - <? $this->auth()->setActiveAuthClass($class) ?> + <? $this->auth()->getManager()->setAuthMethod($method) ?> <?=$this->auth()->getLoginDesc() ?> <?=$this->auth()->getLogin() ?> - <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> </div> <? endforeach ?> </div> <div class="clearer"></div> - +<? $this->auth()->getManager()->setAuthMethod('ChoiceAuth') ?> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/AbstractBase/login.phtml b/themes/bootstrap/templates/Auth/AbstractBase/login.phtml index 67db25569348f15d6528e42029f7bc4661242537..c6a63a8120add79b8a4b22bdc1e2c472d75d16a8 100644 --- a/themes/bootstrap/templates/Auth/AbstractBase/login.phtml +++ b/themes/bootstrap/templates/Auth/AbstractBase/login.phtml @@ -3,16 +3,16 @@ <? if (!$sessionInitiator): // display default login form if no login URL provided ?> <form method="post" class="form-horizontal" action="<?=$this->url('myresearch-home')?>" name="loginForm" id="loginForm"> <?=$this->auth()->getLoginFields()?> - <input type="hidden" name="auth_method" value="<?=$this->auth()->getActiveAuthMethod()?>"> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>"> <div class="control-group"> <div class="controls"> <? if ($account->supportsCreation()): ?> - <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> <? endif; ?> <input class="btn btn-primary" type="submit" name="processLogin" value="Login"> <? if ($account->supportsRecovery()): ?> <br/> - <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> <? endif; ?> </div> </div> diff --git a/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml b/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml index f95924b1cc2b44af12cbe1145bce5b514f416429..4c5fe2267ae05b937aee34c78dfdb9bfcd8b46be 100644 --- a/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml +++ b/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml @@ -1,13 +1,13 @@ <p><?=$this->transEsc('choose_login_method')?></p> <div id="authcontainer"> -<? $classes = $this->auth()->getManager()->getAuthClasses(); ?> -<? $count = count($classes); ?> -<? foreach ($classes as $loop=>$class):?> +<? $methods = $this->auth()->getManager()->getSelectableAuthOptions(); ?> +<? $count = count($methods); ?> +<? foreach ($methods as $loop=>$method):?> <div class="authmethod<?=$loop?> span<?=floor(12/$count) ?>"> - <? $this->auth()->setActiveAuthClass($class) ?> + <? $this->auth()->getManager()->setAuthMethod($method) ?> <?=$this->auth()->getLoginDesc() ?> <?=$this->auth()->getLogin() ?> - <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> </div> <? endforeach ?> -</div> \ No newline at end of file +</div> +<? $this->auth()->getManager()->setAuthMethod('ChoiceAuth') ?> \ No newline at end of file diff --git a/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml b/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml index 40b093d0260618cfee0cf64ee14a4f8b26ff54fa..391d4b2d6ae76ff93ef052d134bcaba59212a483 100644 --- a/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml +++ b/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml @@ -3,16 +3,16 @@ <? if (!$sessionInitiator): // display default login form if no login URL provided ?> <form method="post" class="form-horizontal" action="<?=$this->url('myresearch-home')?>" name="loginForm" id="loginForm"> <?=$this->auth()->getLoginFields()?> - <input type="hidden" name="auth_method" value="<?=$this->auth()->getActiveAuthMethod()?>"> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>"> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <? if ($account->supportsCreation()): ?> - <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> <? endif; ?> <input class="btn btn-primary" type="submit" name="processLogin" value="Login"> <? if ($account->supportsRecovery()): ?> <br/> - <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> <? endif; ?> </div> </div> diff --git a/themes/bootstrap3/templates/Auth/ChoiceAuth/login.phtml b/themes/bootstrap3/templates/Auth/ChoiceAuth/login.phtml index f95924b1cc2b44af12cbe1145bce5b514f416429..4c5fe2267ae05b937aee34c78dfdb9bfcd8b46be 100644 --- a/themes/bootstrap3/templates/Auth/ChoiceAuth/login.phtml +++ b/themes/bootstrap3/templates/Auth/ChoiceAuth/login.phtml @@ -1,13 +1,13 @@ <p><?=$this->transEsc('choose_login_method')?></p> <div id="authcontainer"> -<? $classes = $this->auth()->getManager()->getAuthClasses(); ?> -<? $count = count($classes); ?> -<? foreach ($classes as $loop=>$class):?> +<? $methods = $this->auth()->getManager()->getSelectableAuthOptions(); ?> +<? $count = count($methods); ?> +<? foreach ($methods as $loop=>$method):?> <div class="authmethod<?=$loop?> span<?=floor(12/$count) ?>"> - <? $this->auth()->setActiveAuthClass($class) ?> + <? $this->auth()->getManager()->setAuthMethod($method) ?> <?=$this->auth()->getLoginDesc() ?> <?=$this->auth()->getLogin() ?> - <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> </div> <? endforeach ?> -</div> \ No newline at end of file +</div> +<? $this->auth()->getManager()->setAuthMethod('ChoiceAuth') ?> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml b/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml index af8e45be547b4cefd83ecf2ed5c31b1e20fe95f6..bcb391b4767c139e8a9c289800a71913a31fe32d 100644 --- a/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml +++ b/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml @@ -4,7 +4,7 @@ <? $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> <? if (!$sessionInitiator): // display default login form if no login URL provided ?> <form method="post" action="<?=$this->url('myresearch-home')?>" name="loginForm" data-ajax="false"> - <input type="hidden" name="auth_method" value="<?=$this->auth()->getActiveAuthMethod()?>" /> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>" /> <div data-role="fieldcontain"> <?=$this->auth()->getLoginFields()?> </div> @@ -13,10 +13,10 @@ </div> </form> <? if ($account->supportsCreation()): ?> - <a rel="external" data-role="button" class="new_account" href="<?=$this->url('myresearch-account')?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <a rel="external" data-role="button" class="new_account" href="<?=$this->url('myresearch-account')?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> <? endif; ?> <? if ($account->supportsRecovery()): ?> - <a rel="external" data-role="button" class="recover_password" href="<?=$this->url('myresearch-recover')?>?auth_method=<?=$this->auth()->getActiveAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <a rel="external" data-role="button" class="recover_password" href="<?=$this->url('myresearch-recover')?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> <? endif; ?> <? else: ?> <a rel="external" data-role="button" href="<?=$this->escapeHtmlAttr($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> diff --git a/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml b/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml index 714c3dd7c5cf428c32c0ee811dcf6d19e9ee8c37..b4482128d3e9295f047b37118a3763b873c92538 100644 --- a/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml +++ b/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml @@ -1,13 +1,12 @@ <p><?=$this->transEsc('choose_login_method')?></p> <div id="authcontainer"> -<? foreach ($this->auth()->getManager()->getAuthClasses() as $loop=>$class):?> +<? foreach ($this->auth()->getManager()->getSelectableAuthOptions() as $loop=>$method):?> <div class="authmethod<?=$loop?>"> - <? $this->auth()->setActiveAuthClass($class) ?> + <? $this->auth()->getManager()->setAuthMethod($method) ?> <?=$this->auth()->getLoginDesc() ?> <?=$this->auth()->getLogin() ?> - <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> </div> <? endforeach ?> </div> <div class="clearer"></div> - +<? $this->auth()->getManager()->setAuthMethod('ChoiceAuth') ?> \ No newline at end of file