mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
allow hooks to send redirects via Exception\Redirect, thought only first redirect will be executed, if there are multiple hooks
This commit is contained in:
parent
7290b8b7e7
commit
9f4de6105f
@ -114,7 +114,7 @@ class Hooks
|
||||
return false;
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
$ret = $redirects = array();
|
||||
foreach((array)self::$locations[$location][$appname] as $hook)
|
||||
{
|
||||
try {
|
||||
@ -143,11 +143,24 @@ class Hooks
|
||||
$ret[] = ExecMethod2($hook, $args);
|
||||
}
|
||||
}
|
||||
catch (Exception\Redirect $e)
|
||||
{
|
||||
$redirects[] = $e;
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
_egw_log_exception($e);
|
||||
}
|
||||
}
|
||||
|
||||
if ($redirects)
|
||||
{
|
||||
if (count($redirects) > 1)
|
||||
{
|
||||
error_log("Multiple redirects for location '$location', only first one gets executed!");
|
||||
}
|
||||
throw $redirects[0];
|
||||
}
|
||||
|
||||
// hooks only existing in filesystem used by setup
|
||||
if (!$ret && $try_unregistered && file_exists(EGW_SERVER_ROOT.($hook='/'.$appname.'/inc/hook_'.$location.'.inc.php')))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user