diff --git a/config/vufind/config.ini b/config/vufind/config.ini index d694a3c77f8c10e5b5cdf67752aaeb8c5f201967..c86c0aaa49c727d6ea744f2b1f8d95513233e3e2 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -165,6 +165,7 @@ method = Database ;method = SIP2 ;method = CAS ;method = MultiAuth +;method = ChoiceAuth ; This setting only applies when method is set to ILS. It determines which ; field of the ILS driver's patronLogin() return array is used as the username @@ -194,6 +195,18 @@ ils_encryption_key = false ;method_order = ILS,LDAP ;filters = "username:trim,password:trim" +; Present two auth options on the login screen. Each choice given must also be +; configured in its relevent section. (The code should allow for more than 2 +; choices, but styling would need to be expanded / modified) +; +; WARNING! This module does not account for the possibility that the auth +; choices you present may return different usernames. You would want a user to +; be able to log in via any method and see the same account. To make sure that +; is the case, you should ensure that the usernames given by the authentication +; methods themselves are the same for any given user. +;[ChoiceAuth] +;choice_order = Shibboleth,Database + ; This section will allow you to control whether VuFind should record usage ; statistics. [Statistics] diff --git a/languages/en.ini b/languages/en.ini index 83a8be068ae9dd1381901b3059a86fc4b9f3571d..d0675c1a275546bece166c0d236378576040eef2 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -136,7 +136,9 @@ callnumber_abbrev = "Call #" Cannot find record = "Cannot find record" Cannot find similar records = "Cannot find similar records" Cassette = Cassette +Catalog Login = "Catalog Login" Catalog Results = "Catalog Results" +catalog_login_desc = "Enter your library catalog credentials." cat_establish_account = "In order to establish your account profile, please enter the following information:" cat_password_abbrev = "Catalog Password" cat_username_abbrev = "Catalog Username" @@ -149,6 +151,7 @@ Checkedout = "Checked Out" Choose a Category to Begin Browsing = "Choose a Category to Begin Browsing" Choose a Column to Begin Browsing = "Choose a Column to Begin Browsing" Choose a List = "Choose a List" +choose_login_method = "Please choose a login method:" citation_issue_abbrev = "no." citation_multipage_abbrev = "pp." citation_singlepage_abbrev = "p." @@ -375,6 +378,7 @@ include_synonyms = "Expand results using synonyms" information = "Information" Institution = Institution Institutional Login = "Institutional Login" +institutional_login_desc = "Enter your campus-wide username and password." Instructor = Instructor Internet = Internet Invalid Patron Login = "Invalid Patron Login" @@ -421,6 +425,8 @@ list_access_denied = "You do not have permission to view this list." list_edit_name_required = "List name is required." Loading = Loading load_tag_error = "Error: Could Not Load Tags" +Local Login = "Local Login" +local_login_desc = "Enter the username and password you created for this site." Located = Located Location = Location Log Out = "Log Out" diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 66b106291b194d685f25ef9007e05677e2b9ab9a..99164a6565ea6489fda14b66fd9dbb9199edfec0 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -377,6 +377,7 @@ $config = array( }, ), 'invokables' => array( + 'choiceauth' => 'VuFind\Auth\ChoiceAuth', 'database' => 'VuFind\Auth\Database', 'ldap' => 'VuFind\Auth\LDAP', 'multiauth' => 'VuFind\Auth\MultiAuth', diff --git a/module/VuFind/src/VuFind/Auth/AbstractBase.php b/module/VuFind/src/VuFind/Auth/AbstractBase.php index 125ff8c2d4fc0dccf0e21b0a2d9844e4ae45a59f..464452378e581004c9c06afa883406491a0f966b 100644 --- a/module/VuFind/src/VuFind/Auth/AbstractBase.php +++ b/module/VuFind/src/VuFind/Auth/AbstractBase.php @@ -184,6 +184,17 @@ 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. * @@ -219,4 +230,4 @@ abstract class AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface { $this->tableManager = $manager; } -} \ No newline at end of file +} diff --git a/module/VuFind/src/VuFind/Auth/CAS.php b/module/VuFind/src/VuFind/Auth/CAS.php index 18f5ddb1a83b556755b80cb5760700a01a1ac9dc..402f658c501e9244993b74b1fba8037ceb3262f0 100644 --- a/module/VuFind/src/VuFind/Auth/CAS.php +++ b/module/VuFind/src/VuFind/Auth/CAS.php @@ -178,8 +178,10 @@ class CAS extends AbstractBase } else { $casTarget = $target; } + $append = (strpos($casTarget, '?') !== false) ? '&' : '?'; $sessionInitiator = $config->CAS->login - . '?service=' . urlencode($casTarget); + . '?service=' . urlencode($casTarget) + . urlencode($append . 'auth_method=CAS'); return $sessionInitiator; } diff --git a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php new file mode 100644 index 0000000000000000000000000000000000000000..6c7af73027defe59f64ba29702c79dc7a8b7068c --- /dev/null +++ b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php @@ -0,0 +1,211 @@ +<?php +/** + * MultiAuth Authentication plugin + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Authentication + * @author Anna Headley <vufind-tech@lists.sourceforge.net> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:authentication_handlers Wiki + */ +namespace VuFind\Auth; +use VuFind\Exception\Auth as AuthException; + +/** + * ChoiceAuth Authentication plugin + * + * This module enables a user to choose between two authentication methods. + * choices are presented side-by-side and one is manually selected. + * + * See config.ini for more details + * + * @category VuFind2 + * @package Authentication + * @author Anna Headley <vufind-tech@lists.sourceforge.net> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:authentication_handlers Wiki + */ +class ChoiceAuth extends AbstractBase +{ + /** + * Authentication methods to present + * + * @var array + */ + protected $methods = array(); + + /** + * Auth method selected by user + * + * @var string + */ + protected $method; + + /** + * Username input + * + * @var string + */ + protected $username; + + /** + * Password input + * + * @var string + */ + protected $password; + + /** + * Plugin manager for obtaining other authentication objects + * + * @var PluginManager + */ + protected $manager; + + /** + * Validate configuration parameters. This is a support method for getConfig(), + * so the configuration MUST be accessed using $this->config; do not call + * $this->getConfig() from within this method! + * + * @throws AuthException + * @return void + */ + protected function validateConfig() + { + if (!isset($this->config->ChoiceAuth) + || !isset($this->config->ChoiceAuth->choice_order) + || !strlen($this->config->ChoiceAuth->choice_order) + ) { + throw new AuthException( + "One or more ChoiceAuth parameters are missing. " . + "Check your config.ini!" + ); + } + } + + /** + * Set configuration; throw an exception if it is invalid. + * + * @param \Zend\Config\Config $config Configuration to set + * + * @throws AuthException + * @return void + */ + public function setConfig($config) + { + parent::setConfig($config); + $this->methods = array_map( + 'trim', explode(',', $config->ChoiceAuth->choice_order) + ); + } + + /** + * Attempt to authenticate the current user. Throws exception if login fails. + * + * @param \Zend\Http\PhpEnvironment\Request $request Request object containing + * account credentials. + * + * @throws AuthException + * @return \VuFind\Db\Row\User Object representing logged-in user. + */ + public function authenticate($request) + { + $this->username = trim($request->getPost()->get('username')); + $this->password = trim($request->getPost()->get('password')); + $this->method = trim($request->getPost()->get('auth_method')); + + if ($this->method == '') { + throw new AuthException('authentication_error_technical'); + } + + // Do the actual authentication work: + return $this->authUser($request); + } + + /** + * Do the actual work of authenticating the user (supports + * authenticate()). + * + * @param \Zend\Http\PhpEnvironment\Request $request Request object containing + * account credentials. + * + * @throws AuthException + * @return \VuFind\Db\Row\User Object representing logged-in user. + */ + protected function authUser($request) + { + $manager = $this->getPluginManager(); + $authenticator = $manager->get($this->method); + $authenticator->setConfig($this->getConfig()); + try { + $user = $authenticator->authenticate($request); + } catch (AuthException $exception) { + throw $exception; + } + + if (isset($user)) { + return $user; + } else { + throw new AuthException('authentication_error_technical'); + } + } + + + /** + * Set the manager for loading other authentication plugins. + * + * @param PluginManager $manager Plugin manager + * + * @return void + */ + public function setPluginManager(PluginManager $manager) + { + $this->manager = $manager; + } + + /** + * Get the manager for loading other authentication plugins. + * + * @throws \Exception + * @return PluginManager + */ + public function getPluginManager() + { + if (null === $this->manager) { + throw new \Exception('Plugin manager missing.'); + } + return $this->manager; + } + + /** + * Does the class allow for authentication from more than one method? + * If so return an array that lists the classes for the methods allowed. + * + * @return array | bool + */ + public function getClasses() + { + $classes = array(); + foreach ($this->methods as $method) { + $classes[] = get_class($this->manager->get($method)); + } + return $classes; + } +} diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index f0a52a925978a2a3b368e89b232648405402a1d4..b5ba057d133719cd8cda30d2768a5ba42fefe0b9 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -48,6 +48,20 @@ class Manager implements ServiceLocatorAwareInterface */ protected $auth = false; + /** + * Authentication module currently proxied (false if uninitialized) + * + * @var \VuFind\Auth\AbstractBase|bool + */ + protected $authProxied = false; + + /** + * Authentication module to proxy (false if uninitialized) + * + * @var string|bool + */ + protected $authToProxy = false; + /** * VuFind configuration * @@ -111,21 +125,47 @@ class Manager implements ServiceLocatorAwareInterface */ protected function getAuth() { - if (!$this->auth) { - $manager = $this->getServiceLocator()->get('VuFind\AuthPluginManager'); - $this->auth = $manager->get($this->config->Authentication->method); - $this->auth->setConfig($this->config); + 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; } - return $this->auth; + } + + /** + * Helper + * + * @param string $method auth method to instantiate + * + * @return AbstractBase + */ + protected function makeAuth($method) + { + $manager = $this->getServiceLocator()->get('VuFind\AuthPluginManager'); + $auth = $manager->get($method); + $auth->setConfig($this->config); + return $auth; } /** * Does the current configuration support account creation? * + *@param string $authMethod optional; check this auth method rather than + * the one in config file + * * @return bool */ - public function supportsCreation() + public function supportsCreation($authMethod=null) { + if ($authMethod != null) { + $this->setActiveAuthClass($authMethod); + } return $this->getAuth()->supportsCreation(); } @@ -153,6 +193,35 @@ class Manager implements ServiceLocatorAwareInterface return get_class($this->getAuth()); } + /** + * 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 array + */ + public function getAuthClasses() + { + $classes = $this->getAuth()->getClasses(); + if ($classes) { + return $classes; + } else { + return array($this->getAuthClass()); + } + } + + /** + * Get the name of the current authentication method. + * + * @return string + */ + public function getAuthMethod() + { + $className = $this->getAuthClass(); + $classParts = explode('\\', $className); + return array_pop($classParts); + } + /** * Is login currently allowed? * @@ -418,4 +487,18 @@ class Manager implements ServiceLocatorAwareInterface { return $this->serviceLocator; } -} \ No newline at end of file + + /** + * Setter + * + * @param string $method The auth class to proxy + * + * @return void + */ + public function setActiveAuthClass($method) + { + $this->authToProxy = $method; + $this->authProxied = false; + } + +} diff --git a/module/VuFind/src/VuFind/Auth/Shibboleth.php b/module/VuFind/src/VuFind/Auth/Shibboleth.php index 3e4605774b399b836aae03883aeb7b9196eac02d..6d947a8f25498e1e39ad926254db99b888492e1b 100644 --- a/module/VuFind/src/VuFind/Auth/Shibboleth.php +++ b/module/VuFind/src/VuFind/Auth/Shibboleth.php @@ -141,8 +141,14 @@ class Shibboleth extends AbstractBase } else { $shibTarget = $target; } + $append = (strpos($shibTarget, '?') !== false) ? '&' : '?'; $sessionInitiator = $config->Shibboleth->login - . '?target=' . urlencode($shibTarget); + . '?target=' . urlencode($shibTarget) + . urlencode($append . 'auth_method=Shibboleth'); + // makes it possible to + // handle logins when using + // an auth method that + // proxies others if (isset($config->Shibboleth->provider_id)) { $sessionInitiator = $sessionInitiator . '&providerId=' . @@ -224,4 +230,4 @@ class Shibboleth extends AbstractBase return $sortedUserAttributes; } -} \ No newline at end of file +} diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index de9704354e286b93099e91720485af5955be8ca5..28edaa96a3090f3517e48cb7c355627599b5acdc 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -112,10 +112,18 @@ class MyResearchController extends AbstractBase */ public function homeAction() { + // if the current auth class proxies others, we'll get the proxied + // auth method as a querystring or post parameter. + // Force to post. + if ($method = trim($this->params()->fromQuery('auth_method'))) { + $this->getRequest()->getPost()->set('auth_method', $method); + } + // Process login request, if necessary (either because a form has been // submitted or because we're using an external login provider): if ($this->params()->fromPost('processLogin') || $this->getSessionInitiator() + || $this->params()->fromPost('auth_method') ) { try { $this->getAuthManager()->login($this->getRequest()); @@ -152,9 +160,12 @@ class MyResearchController extends AbstractBase */ public function accountAction() { + // 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()) { + if (!$this->getAuthManager()->supportsCreation($method)) { return $this->forwardTo('MyResearch', 'Home'); } @@ -230,6 +241,9 @@ class MyResearchController extends AbstractBase $logoutTarget = $this->getServerUrl('home'); } + // clear querystring parameters + $logoutTarget = preg_replace('/\?.*/', '', $logoutTarget); + return $this->redirect() ->toUrl($this->getAuthManager()->logout($logoutTarget)); } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Auth.php b/module/VuFind/src/VuFind/View/Helper/Root/Auth.php index ff3e397aa1445aaf8d7644f4bdaacf8b320993c1..9c852d6632c9b0074c43fcf952e9d56bc3498cdb 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Auth.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Auth.php @@ -39,6 +39,14 @@ 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 * @@ -54,6 +62,7 @@ class Auth extends \Zend\View\Helper\AbstractHelper public function __construct(\VuFind\Auth\Manager $manager) { $this->manager = $manager; + $this->activeAuthClass = null; } /** @@ -73,12 +82,11 @@ 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->getManager()->getAuthClass(); + $className = $this->getActiveAuthClass(); $topClassName = $className; // for error message while (true) { // Guess the template name for the current class: - $classParts = explode('\\', $className); - $template = 'Auth/' . array_pop($classParts) . '/' . $name; + $template = 'Auth/' . $this->getBriefClass($className) . '/' . $name; try { // Try to render the template.... $html = $this->getView()->render($template); @@ -140,7 +148,83 @@ class Auth extends \Zend\View\Helper\AbstractHelper * @return string */ public function getLoginFields($context = array()) + { + return $this->renderTemplate('loginfields.phtml', $context); + } + + /** + * Render the login template. + * + * @param array $context Context for rendering template + * + * @return string + */ + public function getLogin($context = array()) { return $this->renderTemplate('login.phtml', $context); } -} \ No newline at end of file + + /** + * Render the login description template. + * + * @param array $context Context for rendering template + * + * @return string + */ + public function getLoginDesc($context = array()) + { + 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 + * + * @param string $className Class name to abbreviate + * + * @return string + */ + protected function getBriefClass($className) + { + $classParts = explode('\\', $className); + return array_pop($classParts); + } +} diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php index 3b8d28e8ae7d088653b5fda11b90a71f9b5daef9..fa5b9d1f6002051275f25a5aff9c531d3045c3f6 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php @@ -210,7 +210,7 @@ class ShibbolethTest extends \VuFindTest\Unit\DbTestCase public function testSessionInitiator() { $this->assertEquals( - 'http://myserver?target=http%3A%2F%2Ftarget', + 'http://myserver?target=http%3A%2F%2Ftarget%3Fauth_method%3DShibboleth', $this->getAuthObject()->getSessionInitiator('http://target') ); } diff --git a/themes/blueprint/css/styles.css b/themes/blueprint/css/styles.css index 39e789411110b66ff86c17fef5d3cfbe201cc690..8b44022e7046432d47bac8baf2f1fdd3f5fedf5a 100644 --- a/themes/blueprint/css/styles.css +++ b/themes/blueprint/css/styles.css @@ -1,7 +1,6 @@ @CHARSET "UTF-8"; /** General ***/ - body { margin: 1.5em 0; /*background:url("../images/bg_body.jpg") no-repeat scroll center top;*/ @@ -2250,4 +2249,24 @@ div.handle { .combinedResult .more_link { text-align: center; border-top: 1px solid #eee; +} + +.authmethod0 { + width:47%; + float:left; + padding:1%; + border-right:1px solid rgb(204, 204, 204); +} + +.authmethod1 { + width:47%; + float:left; + padding:1%; + border-left:1px solid rgb(204, 204, 204); + margin:-1px; /* keep the borders on top of one another; longest one will win */ +} + +#authcontainer { + float:left; + width:100%; } \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/AbstractBase/login.phtml b/themes/blueprint/templates/Auth/AbstractBase/login.phtml index 44a178d3b437d9f83454589964e20d6bde914e74..30df536ea06d17c0433d8454a161279ce60d6844 100644 --- a/themes/blueprint/templates/Auth/AbstractBase/login.phtml +++ b/themes/blueprint/templates/Auth/AbstractBase/login.phtml @@ -1,6 +1,20 @@ -<label class="span-2" for="login_username"><?=$this->transEsc('Username')?>:</label> -<input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>" size="15" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required'))?>"/> -<br class="clear"/> -<label class="span-2" for="login_password"><?=$this->transEsc('Password')?>:</label> -<input id="login_password" type="password" name="password" size="15" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"/> -<br class="clear"/> \ No newline at end of file +<? $account = $this->auth()->getManager(); ?> +<? $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" id="loginForm"> + <?=$this->auth()->getLoginFields()?> + <input type="hidden" name="auth_method" value="<?=$this->auth()->getActiveAuthMethod()?>"> + <input class="push-2 button" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> + <div class="clear"></div> + </form> + <? + // Set up form validation: + $initJs = '$(document).ready(function() { $(\'#loginForm\').validate(); });'; + 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> + <? endif; ?> +<? else: ?> + <a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> +<? endif; ?> diff --git a/themes/blueprint/templates/Auth/AbstractBase/logindesc.phtml b/themes/blueprint/templates/Auth/AbstractBase/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9f4088f8d270f09bc536fa26d8dd35282a49294a --- /dev/null +++ b/themes/blueprint/templates/Auth/AbstractBase/logindesc.phtml @@ -0,0 +1 @@ +<h3><?=$this->transEsc('Login')?></h3> \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/AbstractBase/loginfields.phtml b/themes/blueprint/templates/Auth/AbstractBase/loginfields.phtml new file mode 100644 index 0000000000000000000000000000000000000000..707a379f5e475b4a61c1d1a44eccf13753ff5a06 --- /dev/null +++ b/themes/blueprint/templates/Auth/AbstractBase/loginfields.phtml @@ -0,0 +1,6 @@ +<label class="span-2" for="login_username"><?=$this->transEsc('Username')?>:</label> +<input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>" size="15" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required'))?>"/> +<br class="clear"/> +<label class="span-2" for="login_password"><?=$this->transEsc('Password')?>:</label> +<input id="login_password" type="password" name="password" size="15" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"/> +<br class="clear"/> diff --git a/themes/blueprint/templates/Auth/CAS/logindesc.phtml b/themes/blueprint/templates/Auth/CAS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/blueprint/templates/Auth/CAS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml b/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..714c3dd7c5cf428c32c0ee811dcf6d19e9ee8c37 --- /dev/null +++ b/themes/blueprint/templates/Auth/ChoiceAuth/login.phtml @@ -0,0 +1,13 @@ +<p><?=$this->transEsc('choose_login_method')?></p> +<div id="authcontainer"> +<? foreach ($this->auth()->getManager()->getAuthClasses() as $loop=>$class):?> + <div class="authmethod<?=$loop?>"> + <? $this->auth()->setActiveAuthClass($class) ?> + <?=$this->auth()->getLoginDesc() ?> + <?=$this->auth()->getLogin() ?> + <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> + </div> +<? endforeach ?> +</div> +<div class="clearer"></div> + diff --git a/themes/blueprint/templates/Auth/Database/logindesc.phtml b/themes/blueprint/templates/Auth/Database/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..10d39c2498b61e3e4b59cd9f9283eb0b6e3d1b34 --- /dev/null +++ b/themes/blueprint/templates/Auth/Database/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Local Login')?></h3> +<p><?=$this->transEsc('local_login_desc')?></p> \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/ILS/logindesc.phtml b/themes/blueprint/templates/Auth/ILS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..73ac1374e787e6fcedcf9ed95a8293f66808ea10 --- /dev/null +++ b/themes/blueprint/templates/Auth/ILS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Catalog Login')?></h3> +<p><?=$this->transEsc('catalog_login_desc')?></p> \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/LDAP/logindesc.phtml b/themes/blueprint/templates/Auth/LDAP/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/blueprint/templates/Auth/LDAP/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/blueprint/templates/Auth/Shibboleth/login.phtml b/themes/blueprint/templates/Auth/Shibboleth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..94f44ef3d93574b3e3bcc672e4abbf1042b762f4 --- /dev/null +++ b/themes/blueprint/templates/Auth/Shibboleth/login.phtml @@ -0,0 +1,3 @@ +<? $account = $this->auth()->getManager(); ?> +<? $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> diff --git a/themes/blueprint/templates/Auth/Shibboleth/logindesc.phtml b/themes/blueprint/templates/Auth/Shibboleth/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/blueprint/templates/Auth/Shibboleth/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/blueprint/templates/myresearch/login.phtml b/themes/blueprint/templates/myresearch/login.phtml index 2d48e8b4746a377001a8c295af0adec6aad53794..c3a72bc034f8105a1dd4034a3456ab316193f928 100644 --- a/themes/blueprint/templates/myresearch/login.phtml +++ b/themes/blueprint/templates/myresearch/login.phtml @@ -34,22 +34,5 @@ <? if ($hideLogin): ?> <div class="error"><?=$this->transEsc('login_disabled')?></div> <? else: ?> - <? $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" id="loginForm"> - <?=$this->auth()->getLoginFields()?> - <input class="push-2 button" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> - <div class="clear"></div> - </form> - <? - // Set up form validation: - $initJs = '$(document).ready(function() { $(\'#loginForm\').validate(); });'; - echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $initJs, 'SET'); - ?> - <? if ($account->supportsCreation()): ?> - <a class="new_account" href="<?=$this->url('myresearch-account')?>"><?=$this->transEsc('Create New Account')?></a> - <? endif; ?> - <? else: ?> - <a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> - <? endif; ?> -<? endif; ?> \ No newline at end of file + <?=$this->auth()->getLogin()?> +<? endif; ?> diff --git a/themes/bootprint/css/style.css b/themes/bootprint/css/style.css index 958c8e1b7349933218727ef9c7bb0ed0beacad65..66588ba559aea7d88e98126408b4eba1fca24439 100644 --- a/themes/bootprint/css/style.css +++ b/themes/bootprint/css/style.css @@ -155,4 +155,23 @@ select, .btn:not(.btn-link){vertical-align:top} #download-button:active {background:linear-gradient(to bottom, #508033 0%,#72A255 100%)} .inspector_container {margin-top:6px} .siblings-form {margin:3px auto} -.table.details {font-size:10px;border-bottom:1px solid #DDD} \ No newline at end of file +.table.details {font-size:10px;border-bottom:1px solid #DDD} + +/* --- ChoiceAuth --- */ +.authmethod0 { + width:47%; + float:left; + padding:1%; + border-right:1px solid rgb(204, 204, 204); +} +.authmethod1 { + width:47%; + float:left; + padding:1%; + border-left:1px solid rgb(204, 204, 204); + margin:-1px; /* keep the borders on top of one another; longest one will win */ +} +#authcontainer { + float:left; + width:100%; +} diff --git a/themes/bootstrap/templates/Auth/AbstractBase/login.phtml b/themes/bootstrap/templates/Auth/AbstractBase/login.phtml index ef6f561fcf74a69f8b0e14dddb89d68ed5660d09..5b4bfeaa72a048c599236c153aa792061da640e1 100644 --- a/themes/bootstrap/templates/Auth/AbstractBase/login.phtml +++ b/themes/bootstrap/templates/Auth/AbstractBase/login.phtml @@ -1,12 +1,18 @@ -<div class="control-group"> - <label class="control-label" for="login_username"><?=$this->transEsc('Username')?>:</label> - <div class="controls"> - <input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>"/> - </div> -</div> -<div class="control-group"> - <label class="control-label" for="login_password"><?=$this->transEsc('Password')?>:</label> - <div class="controls"> - <input id="login_password" type="password" name="password"/> - </div> -</div> \ No newline at end of file +<? $account = $this->auth()->getManager(); ?> +<? $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<? 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()?>"> + <div class="control-group"> + <div class="controls"> + <input class="btn btn-primary" type="submit" name="processLogin" value="Login"> + <? if ($account->supportsCreation()): ?> + <a class="btn btn-link" href="/digitaldev/MyResearch/Account">Create New Account</a> + <? endif; ?> + </div> + </div> + </form> +<? else: ?> + <a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> +<? endif; ?> diff --git a/themes/bootstrap/templates/Auth/AbstractBase/logindesc.phtml b/themes/bootstrap/templates/Auth/AbstractBase/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9f4088f8d270f09bc536fa26d8dd35282a49294a --- /dev/null +++ b/themes/bootstrap/templates/Auth/AbstractBase/logindesc.phtml @@ -0,0 +1 @@ +<h3><?=$this->transEsc('Login')?></h3> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/AbstractBase/loginfields.phtml b/themes/bootstrap/templates/Auth/AbstractBase/loginfields.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ef6f561fcf74a69f8b0e14dddb89d68ed5660d09 --- /dev/null +++ b/themes/bootstrap/templates/Auth/AbstractBase/loginfields.phtml @@ -0,0 +1,12 @@ +<div class="control-group"> + <label class="control-label" for="login_username"><?=$this->transEsc('Username')?>:</label> + <div class="controls"> + <input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>"/> + </div> +</div> +<div class="control-group"> + <label class="control-label" for="login_password"><?=$this->transEsc('Password')?>:</label> + <div class="controls"> + <input id="login_password" type="password" name="password"/> + </div> +</div> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/CAS/logindesc.phtml b/themes/bootstrap/templates/Auth/CAS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/bootstrap/templates/Auth/CAS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml b/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f95924b1cc2b44af12cbe1145bce5b514f416429 --- /dev/null +++ b/themes/bootstrap/templates/Auth/ChoiceAuth/login.phtml @@ -0,0 +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):?> + <div class="authmethod<?=$loop?> span<?=floor(12/$count) ?>"> + <? $this->auth()->setActiveAuthClass($class) ?> + <?=$this->auth()->getLoginDesc() ?> + <?=$this->auth()->getLogin() ?> + <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> + </div> +<? endforeach ?> +</div> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/Database/logindesc.phtml b/themes/bootstrap/templates/Auth/Database/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..10d39c2498b61e3e4b59cd9f9283eb0b6e3d1b34 --- /dev/null +++ b/themes/bootstrap/templates/Auth/Database/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Local Login')?></h3> +<p><?=$this->transEsc('local_login_desc')?></p> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/ILS/logindesc.phtml b/themes/bootstrap/templates/Auth/ILS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..73ac1374e787e6fcedcf9ed95a8293f66808ea10 --- /dev/null +++ b/themes/bootstrap/templates/Auth/ILS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Catalog Login')?></h3> +<p><?=$this->transEsc('catalog_login_desc')?></p> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/LDAP/logindesc.phtml b/themes/bootstrap/templates/Auth/LDAP/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/bootstrap/templates/Auth/LDAP/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/bootstrap/templates/Auth/Shibboleth/login.phtml b/themes/bootstrap/templates/Auth/Shibboleth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..94f44ef3d93574b3e3bcc672e4abbf1042b762f4 --- /dev/null +++ b/themes/bootstrap/templates/Auth/Shibboleth/login.phtml @@ -0,0 +1,3 @@ +<? $account = $this->auth()->getManager(); ?> +<? $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> diff --git a/themes/bootstrap/templates/Auth/Shibboleth/logindesc.phtml b/themes/bootstrap/templates/Auth/Shibboleth/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/bootstrap/templates/Auth/Shibboleth/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/bootstrap/templates/myresearch/login.phtml b/themes/bootstrap/templates/myresearch/login.phtml index b9299dcc5028e6525522161ed3180fa699d49282..70a305930a5864a24d8b6121ef68232fa61149c5 100644 --- a/themes/bootstrap/templates/myresearch/login.phtml +++ b/themes/bootstrap/templates/myresearch/login.phtml @@ -28,20 +28,5 @@ <? if ($hideLogin): ?> <div class="alert alert-error"><?=$this->transEsc('login_disabled')?></div> <? else: ?> - <? $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" id="loginForm" class="form-horizontal"> - <?=$this->auth()->getLoginFields()?> - <div class="control-group"> - <div class="controls"> - <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> - <? if ($account->supportsCreation()): ?> - <a class="btn btn-link" href="<?=$this->url('myresearch-account')?>"><?=$this->transEsc('Create New Account')?></a> - <? endif; ?> - </div> - </div> - </form> - <? else: ?> - <a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> - <? endif; ?> + <?=$this->auth()->getLogin()?> <? endif; ?> diff --git a/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml b/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml index a979db8146b66db063d74e07c020105b3e4ec5e3..e41194cc5283f1008fca6071241475d93c82f683 100644 --- a/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml +++ b/themes/jquerymobile/templates/Auth/AbstractBase/login.phtml @@ -1,4 +1,20 @@ -<label for="login_username"><?=$this->transEsc('Username')?>:</label> -<input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>"/> -<label for="login_password"><?=$this->transEsc('Password')?>:</label> -<input id="login_password" type="password" name="password"/> +<? $account = $this->auth()->getManager(); ?> +<h3><?=$this->transEsc('Login')?></h3> +<?=$this->flashmessages()?> +<? $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()?>" /> + <div data-role="fieldcontain"> + <?=$this->auth()->getLoginFields()?> + </div> + <div data-role="fieldcontain"> + <input type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> + </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> + <? endif; ?> +<? else: ?> + <a rel="external" data-role="button" href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> +<? endif; ?> diff --git a/themes/jquerymobile/templates/Auth/AbstractBase/logindesc.phtml b/themes/jquerymobile/templates/Auth/AbstractBase/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9f4088f8d270f09bc536fa26d8dd35282a49294a --- /dev/null +++ b/themes/jquerymobile/templates/Auth/AbstractBase/logindesc.phtml @@ -0,0 +1 @@ +<h3><?=$this->transEsc('Login')?></h3> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/AbstractBase/loginfields.phtml b/themes/jquerymobile/templates/Auth/AbstractBase/loginfields.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a979db8146b66db063d74e07c020105b3e4ec5e3 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/AbstractBase/loginfields.phtml @@ -0,0 +1,4 @@ +<label for="login_username"><?=$this->transEsc('Username')?>:</label> +<input id="login_username" type="text" name="username" value="<?=$this->escapeHtml($this->request->get('username'))?>"/> +<label for="login_password"><?=$this->transEsc('Password')?>:</label> +<input id="login_password" type="password" name="password"/> diff --git a/themes/jquerymobile/templates/Auth/CAS/logindesc.phtml b/themes/jquerymobile/templates/Auth/CAS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/CAS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml b/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..714c3dd7c5cf428c32c0ee811dcf6d19e9ee8c37 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/ChoiceAuth/login.phtml @@ -0,0 +1,13 @@ +<p><?=$this->transEsc('choose_login_method')?></p> +<div id="authcontainer"> +<? foreach ($this->auth()->getManager()->getAuthClasses() as $loop=>$class):?> + <div class="authmethod<?=$loop?>"> + <? $this->auth()->setActiveAuthClass($class) ?> + <?=$this->auth()->getLoginDesc() ?> + <?=$this->auth()->getLogin() ?> + <? $this->auth()->setActiveAuthClass('ChoiceAuth') ?> + </div> +<? endforeach ?> +</div> +<div class="clearer"></div> + diff --git a/themes/jquerymobile/templates/Auth/Database/logindesc.phtml b/themes/jquerymobile/templates/Auth/Database/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..10d39c2498b61e3e4b59cd9f9283eb0b6e3d1b34 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/Database/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Local Login')?></h3> +<p><?=$this->transEsc('local_login_desc')?></p> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/ILS/logindesc.phtml b/themes/jquerymobile/templates/Auth/ILS/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..73ac1374e787e6fcedcf9ed95a8293f66808ea10 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/ILS/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Catalog Login')?></h3> +<p><?=$this->transEsc('catalog_login_desc')?></p> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/LDAP/logindesc.phtml b/themes/jquerymobile/templates/Auth/LDAP/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/LDAP/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/jquerymobile/templates/Auth/Shibboleth/login.phtml b/themes/jquerymobile/templates/Auth/Shibboleth/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..94f44ef3d93574b3e3bcc672e4abbf1042b762f4 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/Shibboleth/login.phtml @@ -0,0 +1,3 @@ +<? $account = $this->auth()->getManager(); ?> +<? $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<a href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> diff --git a/themes/jquerymobile/templates/Auth/Shibboleth/logindesc.phtml b/themes/jquerymobile/templates/Auth/Shibboleth/logindesc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fab51a92a722fa166127618844ea2ac4bdf3c765 --- /dev/null +++ b/themes/jquerymobile/templates/Auth/Shibboleth/logindesc.phtml @@ -0,0 +1,2 @@ +<h3><?=$this->transEsc('Institutional Login')?></h3> +<p><?=$this->transEsc('institutional_login_desc')?></p> \ No newline at end of file diff --git a/themes/jquerymobile/templates/myresearch/login.phtml b/themes/jquerymobile/templates/myresearch/login.phtml index 9bfee6ec31001dfd8bde7eb8dd8149c67c0bbc11..405a0f78c72329ce2c40b69bfc5ee76e6796e62d 100644 --- a/themes/jquerymobile/templates/myresearch/login.phtml +++ b/themes/jquerymobile/templates/myresearch/login.phtml @@ -23,24 +23,7 @@ <? endif; ?> <? if (!$hideLogin): ?> - <h3><?=$this->transEsc('Login')?></h3> - <?=$this->flashmessages()?> - <? $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"> - <div data-role="fieldcontain"> - <?=$this->auth()->getLoginFields()?> - </div> - <div data-role="fieldcontain"> - <input type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"/> - </div> - </form> - <? if ($account->supportsCreation()): ?> - <a rel="external" data-role="button" class="new_account" href="<?=$this->url('myresearch-account')?>"><?=$this->transEsc('Create New Account')?></a> - <? endif; ?> - <? else: ?> - <a rel="external" data-role="button" href="<?=$this->escapeHtml($sessionInitiator)?>"><?=$this->transEsc("Institutional Login")?></a> - <? endif; ?> + <?=$this->auth()->getLogin()?> <? endif; ?> </div> <?=$this->mobileMenu()->footer()?>