Merge pull request #7297 from hregis/6.0_bug2
Fix: use resprint instead resarray
This commit is contained in:
commit
73a799b0ce
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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,19 @@ 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.
|
||||
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||
} else {
|
||||
$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));
|
||||
|
||||
@ -123,23 +123,28 @@ if ($disablenofollow) echo '</a>';
|
||||
</span>
|
||||
</td></tr>
|
||||
<?php
|
||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
if (! empty($morelogincontent)) {
|
||||
if (is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $morelogincontent;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($captcha) {
|
||||
// Add a variable param to force not using cache (jmobile)
|
||||
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
||||
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
||||
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
||||
// TODO: provide accessible captcha variants
|
||||
|
||||
if ($captcha) {
|
||||
// Add a variable param to force not using cache (jmobile)
|
||||
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
||||
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
||||
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
||||
// TODO: provide accessible captcha variants
|
||||
?>
|
||||
<!-- Captcha -->
|
||||
<tr>
|
||||
@ -275,9 +280,9 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
|
||||
|
||||
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
|
||||
|
||||
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
|
||||
|
||||
<?php
|
||||
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
|
||||
|
||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
@ -287,9 +292,11 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
else if (! empty($moreloginextracontent)) {
|
||||
echo '<!-- Javascript by hook -->';
|
||||
echo $moreloginextracontent;
|
||||
}
|
||||
|
||||
<?php
|
||||
// Google Analytics (need Google module)
|
||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||
{
|
||||
@ -309,9 +316,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)
|
||||
print '</script>'."\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Google Adsense
|
||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
||||
{
|
||||
|
||||
@ -88,14 +88,20 @@ if ($disablenofollow) echo '</a>';
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
if (! empty($morelogincontent)) {
|
||||
if (is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $morelogincontent;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -175,6 +181,20 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
if ($format == 'js') {
|
||||
echo "\n".'<!-- Javascript by hook -->';
|
||||
echo $option."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (! empty($moreloginextracontent)) {
|
||||
echo '<!-- Javascript by hook -->';
|
||||
echo $moreloginextracontent;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end of center -->
|
||||
|
||||
@ -224,10 +224,19 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
|
||||
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
||||
}
|
||||
|
||||
// Execute hook getPasswordForgottenPageOptions
|
||||
// Should be an array with differents options in $hookmanager->resArray
|
||||
// Execute hook getPasswordForgottenPageOptions (for table)
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||
} else {
|
||||
$morelogincontent = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Execute hook getPasswordForgottenPageExtraOptions (eg for js)
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$reshook = $hookmanager->executeHooks('getPasswordForgottenPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||
$moreloginextracontent = $hookmanager->resPrint;
|
||||
|
||||
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user