Hook 'getAccessForbiddenMessage'
This commit is contained in:
parent
969e139d5c
commit
79a3e41418
@ -128,6 +128,7 @@ NEW: Upgrade jquery lib to 3.3.1
|
|||||||
NEW: Add hook 'addHtmlHeader()'
|
NEW: Add hook 'addHtmlHeader()'
|
||||||
NEW: Add hook 'createRecurringInvoices()'
|
NEW: Add hook 'createRecurringInvoices()'
|
||||||
NEW: Add hook 'afterSelectContactOptions'
|
NEW: Add hook 'afterSelectContactOptions'
|
||||||
|
NEW: Add hook 'getAccessForbiddenMessage'
|
||||||
NEW: Add hook support in accountancy index
|
NEW: Add hook support in accountancy index
|
||||||
NEW: Add hook support in list of template invoices
|
NEW: Add hook support in list of template invoices
|
||||||
NEW: Add parameter 'replaceambiguouschars' on getRandomPassword function
|
NEW: Add parameter 'replaceambiguouschars' on getRandomPassword function
|
||||||
|
|||||||
@ -165,11 +165,12 @@ class HookManager
|
|||||||
'formattachOptions',
|
'formattachOptions',
|
||||||
'formBuilddocLineOptions',
|
'formBuilddocLineOptions',
|
||||||
'formatNotificationMessage',
|
'formatNotificationMessage',
|
||||||
'getFormMail',
|
'getAccessForbiddenMessage',
|
||||||
'getIdProfUrl',
|
|
||||||
'getDirList',
|
'getDirList',
|
||||||
'getFormatedCustomerRef',
|
'getFormMail',
|
||||||
|
'getFormatedCustomerRef',
|
||||||
'getFormatedSupplierRef',
|
'getFormatedSupplierRef',
|
||||||
|
'getIdProfUrl',
|
||||||
'moveUploadedFile',
|
'moveUploadedFile',
|
||||||
'moreHtmlStatus',
|
'moreHtmlStatus',
|
||||||
'pdf_build_address',
|
'pdf_build_address',
|
||||||
|
|||||||
@ -659,7 +659,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
|
|||||||
*/
|
*/
|
||||||
function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0)
|
function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0)
|
||||||
{
|
{
|
||||||
global $conf, $db, $user, $langs;
|
global $conf, $db, $user, $langs, $hookmanager;
|
||||||
if (! is_object($langs))
|
if (! is_object($langs))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
|
||||||
@ -681,14 +681,27 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
if (empty($showonlymessage))
|
if (empty($showonlymessage))
|
||||||
{
|
{
|
||||||
if ($user->login)
|
global $action, $object;
|
||||||
|
if (empty($hookmanager))
|
||||||
{
|
{
|
||||||
print $langs->trans("CurrentLogin").': <font class="error">'.$user->login.'</font><br>';
|
$hookmanager = new HookManager($db);
|
||||||
print $langs->trans("ErrorForbidden2", $langs->trans("Home"), $langs->trans("Users"));
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('main'));
|
||||||
}
|
}
|
||||||
else
|
$parameters = array('message'=>$message);
|
||||||
|
$reshook=$hookmanager->executeHooks('getAccessForbiddenMessage', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $langs->trans("ErrorForbidden3");
|
if ($user->login)
|
||||||
|
{
|
||||||
|
print $langs->trans("CurrentLogin").': <font class="error">'.$user->login.'</font><br>';
|
||||||
|
print $langs->trans("ErrorForbidden2",$langs->trans("Home"),$langs->trans("Users"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ErrorForbidden3");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($printfooter && function_exists("llxFooter")) llxFooter();
|
if ($printfooter && function_exists("llxFooter")) llxFooter();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user