Skip to content
Permalink
Browse files

Merge pull request #10357 from hregis/8.0_mc

FIX broken external authentication module feature and avoid warning
  • Loading branch information...
eldy committed Jan 17, 2019
2 parents be9f632 + 1d33b6c commit 45ea1647d0e96788613e1c3192a61fcb3fc04059
@@ -211,8 +211,7 @@ public function calculTotaux()
$total_localtax1 = 0;
$total_localtax2 = 0;
$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
$tab_size=count($tab);
for($i=0;$i < $tab_size;$i++)
@@ -41,6 +41,8 @@
$usertxt=GETPOST('user','',1);
$err=GETPOST("err");
// Instantiate hooks of thirdparty module only if not already define
$hookmanager->initHooks(array('cashdeskloginpage'));
/*
* View
@@ -51,6 +53,15 @@
$arrayofcss=array('/cashdesk/css/style.css');
top_htmlhead('','',0,0,'',$arrayofcss);
// 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.
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
} else {
$morelogincontent = $hookmanager->resPrint;
}
?>

<body>
@@ -92,6 +103,24 @@
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
</tr>

<?php
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;
}
}
?>

<tr>
<td colspan="2">
&nbsp;
@@ -46,8 +46,7 @@
$societe->fetch($thirdpartyid);
/** end add Ditto */
$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
$tab_size=count($tab);
if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';

0 comments on commit 45ea164

Please sign in to comment.
You can’t perform that action at this time.