mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
hook() now checks user permissions BEFORE the hook is included
This commit is contained in:
parent
f8304f1b3f
commit
af81ed5a8a
@ -715,33 +715,54 @@
|
||||
return $e_password;
|
||||
}
|
||||
|
||||
function hook($location = '', $order = ''){
|
||||
function hook($location = '', $order = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
if ($order == ''){$order[] = $phpgw_info['flags']['currentapp'];}
|
||||
if ($order == '')
|
||||
{
|
||||
$order[] = $phpgw_info['flags']['currentapp'];
|
||||
}
|
||||
|
||||
/* First include the ordered apps hook file */
|
||||
reset ($order);
|
||||
while (list (, $appname) = each ($order)){
|
||||
while (list (, $appname) = each ($order))
|
||||
{
|
||||
$f = PHPGW_SERVER_ROOT . '/' . $appname . '/inc/hook_'.$phpgw_info['flags']['currentapp'];
|
||||
if ($location != '') {
|
||||
if ($location != '')
|
||||
{
|
||||
$f .= '_'.$location.'.inc.php';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$f .= '.inc.php';
|
||||
}
|
||||
if (file_exists($f)) {include($f);}
|
||||
|
||||
if (file_exists($f) && $phpgw_info['user']['apps'][$appname])
|
||||
{
|
||||
include($f);
|
||||
}
|
||||
$completed_hooks[$appname] = True;
|
||||
}
|
||||
|
||||
/* Then add the rest */
|
||||
reset ($phpgw_info['user']['apps']);
|
||||
while ($permission = each($phpgw_info['user']['apps'])) {
|
||||
if ($completed_hooks[$permission[0]] != True){
|
||||
while ($permission = each($phpgw_info['user']['apps']))
|
||||
{
|
||||
if ($completed_hooks[$permission[0]] != True)
|
||||
{
|
||||
$appname = $permission[0];
|
||||
$f = PHPGW_SERVER_ROOT . '/' . $permission[0] . '/inc/hook_'.$phpgw_info['flags']['currentapp'];
|
||||
if ($location != '') {
|
||||
if ($location != '')
|
||||
{
|
||||
$f .= '_'.$location.'.inc.php';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$f .= '.inc.php';
|
||||
}
|
||||
if (file_exists($f)) {
|
||||
|
||||
if (file_exists($f) && $phpgw_info['user']['apps'][$appname])
|
||||
{
|
||||
include($f);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user