diff --git a/OrcidProfilePlugin.inc.php b/OrcidProfilePlugin.inc.php index b8ab80e0..f1d11fb2 100644 --- a/OrcidProfilePlugin.inc.php +++ b/OrcidProfilePlugin.inc.php @@ -99,6 +99,9 @@ function handleTemplateDisplay($hookName, $args) { case 'author/submit/step3.tpl': $templateMgr->register_outputfilter(array(&$this, 'submitFilter')); break; + case 'user/login.tpl': + $templateMgr->register_outputfilter(array(&$this, 'loginFilter')); + break; } return false; } @@ -117,6 +120,36 @@ function getOauthPath() { } } + /** + * Output filter adds ORCiD interaction to login form. + * @param $output string + * @param $templateMgr TemplateManager + * @return $string + */ + function loginFilter($output, &$templateMgr) { + $sessionManager = SessionManager::getManager(); + $userSession = $sessionManager->getUserSession(); + + if (preg_match('/