diff --git a/module/VuFind/src/VuFind/Controller/AbstractBase.php b/module/VuFind/src/VuFind/Controller/AbstractBase.php index e79136759def4c6d63725ee6a2d6f649be518785..db3c3733d45230c8f721375e3159433575b45d23 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractBase.php +++ b/module/VuFind/src/VuFind/Controller/AbstractBase.php @@ -417,6 +417,11 @@ class AbstractBase extends AbstractActionController if (($username = $this->params()->fromPost('cat_username', false)) && ($password = $this->params()->fromPost('cat_password', false)) ) { + // Check for multiple ILS target selection + $target = $this->params()->fromPost('target', false); + if ($target) { + $username = "$target.$username"; + } $patron = $ilsAuth->newCatalogLogin($username, $password); // If login failed, store a warning message: diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index 30ba1c8a564c52250bd8483d5599cf4b80e444b3..fa50ddb170724f51002527784eab8aaa50393e47 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -357,8 +357,13 @@ class MyResearchController extends AbstractBase */ public function catalogloginAction() { - // No special action needed -- just display form - return $this->createViewModel(); + // Connect to the ILS and check if multiple target support is available: + $targets = null; + $catalog = $this->getILS(); + if ($catalog->checkCapability('getLoginDrivers')) { + $targets = $catalog->getLoginDrivers(); + } + return $this->createViewModel(['targets' => $targets]); } /** diff --git a/themes/blueprint/templates/myresearch/cataloglogin.phtml b/themes/blueprint/templates/myresearch/cataloglogin.phtml index ddd308f2320f84e6fa260cd7831812b6393609c8..f23a1bb1f37615e9fdcb822623a2918b97366c7b 100644 --- a/themes/blueprint/templates/myresearch/cataloglogin.phtml +++ b/themes/blueprint/templates/myresearch/cataloglogin.phtml @@ -23,10 +23,18 @@ <?=$this->flashmessages()?> <p><?=$this->transEsc('cat_establish_account')?></p> <form method="post" action=""> + <? if ($this->targets !== null): ?> + <label class="displayBlock" for="login_target"><?=$this->transEsc('login_target')?>:</label> + <select id="login_target" name="target"> + <? foreach ($this->targets as $target): ?> + <option value="<?=$this->escapeHtmlAttr($target)?>"><?=$this->transEsc("source_$target", null, $target)?></option> + <? endforeach; ?> + </select> + <? endif; ?> <label class="displayBlock" for="profile_cat_username"><?=$this->transEsc('Library Catalog Username')?>:</label> <input id="profile_cat_username" type="text" name="cat_username" value="" size="25"/> <label class="displayBlock" for="profile_cat_password"><?=$this->transEsc('Library Catalog Password')?>:</label> - <input id="profile_cat_password" type="text" name="cat_password" value="" size="25"/> + <input id="profile_cat_password" type="password" name="cat_password" value="" size="25"/> <br/> <input type="submit" name="submit" value="<?=$this->transEsc('Save')?>"/> </form> diff --git a/themes/bootstrap3/templates/myresearch/cataloglogin.phtml b/themes/bootstrap3/templates/myresearch/cataloglogin.phtml index dda95948a511b991405d9f1c0c3c6770bb839b46..9ce2993594a89025b48945294bac563d3a73ebd6 100644 --- a/themes/bootstrap3/templates/myresearch/cataloglogin.phtml +++ b/themes/bootstrap3/templates/myresearch/cataloglogin.phtml @@ -21,6 +21,18 @@ <?=$this->flashmessages()?> <p><?=$this->transEsc('cat_establish_account')?></p> <form method="post" action="" class="form-horizontal"> + <? if ($this->targets !== null): ?> + <div class="form-group"> + <label class="col-sm-2 control-label" for="login_target"><?=$this->transEsc('login_target')?>:</label> + <div class="col-sm-10"> + <select id="login_target" name="target" class="form-control"> + <? foreach ($this->targets as $target): ?> + <option value="<?=$this->escapeHtmlAttr($target)?>"><?=$this->transEsc("source_$target", null, $target)?></option> + <? endforeach; ?> + </select> + </div> + </div> + <? endif; ?> <div class="form-group"> <label class="col-sm-2 control-label" for="profile_cat_username"><?=$this->transEsc('Library Catalog Username')?>:</label> <div class="col-sm-10"> @@ -30,7 +42,7 @@ <div class="form-group"> <label class="col-sm-2 control-label" for="profile_cat_password"><?=$this->transEsc('Library Catalog Password')?>:</label> <div class="col-sm-10"> - <input id="profile_cat_username" type="text" name="cat_password" value="" class="form-control"/> + <input id="profile_cat_username" type="password" name="cat_password" value="" class="form-control"/> </div> </div> <div class="form-group"> diff --git a/themes/jquerymobile/templates/myresearch/cataloglogin.phtml b/themes/jquerymobile/templates/myresearch/cataloglogin.phtml index 11cb63cdca81129b5607f0d6d28789dfe335dd98..855822c90dda1a5567dc09d63d7bccd2fdddf819 100644 --- a/themes/jquerymobile/templates/myresearch/cataloglogin.phtml +++ b/themes/jquerymobile/templates/myresearch/cataloglogin.phtml @@ -21,13 +21,25 @@ <?=$this->flashmessages()?> <p><?=$this->transEsc('cat_establish_account')?></p> <form method="post" data-ajax="false"> + + <? if ($this->targets !== null): ?> + <div data-role="fieldcontain"> + <label class="displayBlock" for="login_target"><?=$this->transEsc('login_target')?>:</label> + <select id="login_target" name="target"> + <? foreach ($this->targets as $target): ?> + <option value="<?=$this->escapeHtmlAttr($target)?>"><?=$this->transEsc("source_$target", null, $target)?></option> + <? endforeach; ?> + </select> + </div> + <? endif; ?> + <div data-role="fieldcontain"> <label class="displayBlock" for="profile_cat_username"><?=$this->transEsc('Library Catalog Username')?>:</label> <input id="profile_cat_username" type="text" name="cat_username" value="" size="25"/> </div> <div data-role="fieldcontain"> <label class="displayBlock" for="profile_cat_password"><?=$this->transEsc('Library Catalog Password')?>:</label> - <input id="profile_cat_password" type="text" name="cat_password" value="" size="25"/> + <input id="profile_cat_password" type="password" name="cat_password" value="" size="25"/> </div> <div data-role="fieldcontain"> <input type="submit" name="submit" value="<?=$this->transEsc('Save')?>"/>