not show apps and context-menu entries for apps not available to user, hooks->single() did not check apps for new method-hooks

This commit is contained in:
Ralf Becker 2014-10-30 15:12:37 +00:00
parent 836251277c
commit 8d52ecd059
3 changed files with 10 additions and 5 deletions

View File

@ -73,10 +73,10 @@ class admin_passwordreset
if ($content['download_csv'] && $content['changed'])
{
html::content_header('changed.csv','text/csv');
//echo "account_lid;account_password;account_email;account_firstname;account_lastname\n";
//echo "account_lid;account_passwd;account_email;account_firstname;account_lastname\n";
foreach($content['changed'] as $account)
{
echo "$account[account_lid];$account[account_password];$account[account_email];$account[account_firstname];$account[account_lastname]\n";
echo "$account[account_lid];$account[account_passwd];$account[account_email];$account[account_firstname];$account[account_lastname]\n";
}
common::egw_exit();
}
@ -149,7 +149,7 @@ class admin_passwordreset
$GLOBALS['egw']->acl->delete_repository('preferences','nopasswordchange',$account_id);
}
}
$account['account_password'] = $password;
$account['account_passwd'] = $password;
if ((string)$content['mail']['activate'] !== '' || (string)$content['mail']['quota'] !== '' ||
strpos($content['mail']['domain'], '.') !== false)

View File

@ -145,7 +145,7 @@ class admin_ui
foreach($apps as $app)
{
$GLOBALS['menuData'] = $data = array();
$data = $GLOBALS['egw']->hooks->single('edit_group', $app, true);
$data = $GLOBALS['egw']->hooks->single('edit_group', $app);
if (!is_array($data)) $data = $GLOBALS['menuData'];
//error_log(__METHOD__."() app $app returned ".array2string($data));
foreach($data as $item)
@ -226,7 +226,7 @@ class admin_ui
foreach($apps as $app)
{
$GLOBALS['menuData'] = $data = array();
$data = $GLOBALS['egw']->hooks->single('edit_user', $app, true);
$data = $GLOBALS['egw']->hooks->single('edit_user', $app);
if (!is_array($data)) $data = $GLOBALS['menuData'];
foreach($data as $item)
{

View File

@ -138,6 +138,11 @@ class hooks
{
$appname = is_array($args) && isset($args['appname']) ? $args['appname'] : $GLOBALS['egw_info']['flags']['currentapp'];
}
// excute hook only if $no_permission_check or user has run-rights for app
if (!($no_permission_check || isset($GLOBALS['egw_info']['user']['apps'][$appname])))
{
return false;
}
$SEP = filesystem_separator();
/* First include the ordered apps hook file */