diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 817fd2be8da..39cfb715a28 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008-2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -201,11 +201,16 @@ function dol_loginfunction($langs,$conf,$mysoc) $demopassword=$tab[1]; } - // Execute hook getLoginPageOptions - // Should be an array with differents options in $hookmanager->resArray + // Execute hook getLoginPageOptions (for table) $parameters=array('entity' => GETPOST('entity','int')); - $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook. - $morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints + $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + //$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints + $morelogincontent = $hookmanager->resPrint; + + // Execute hook getLoginPageExtraOptions (eg for js) + $parameters=array('entity' => GETPOST('entity','int')); + $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + $moreloginextracontent = $hookmanager->resPrint; // Login $login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin)); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 35f6f857526..7b6ad88075b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -123,7 +123,7 @@ if ($disablenofollow) echo ''; $option) { if ($format == 'table') { @@ -131,6 +131,9 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) { echo $option; } } +}*/ +if (! empty($morelogincontent)) { + echo $morelogincontent; } ?>