From fe83c07b50ca3370b20f76a6dbea63154a876d3e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 27 Mar 2014 19:00:52 +0000 Subject: [PATCH] get group actions from edit_group hook --- admin/inc/class.admin_account.inc.php | 5 + admin/inc/class.admin_hooks.inc.php | 179 +++++++++++++++++ .../class.admin_prefs_sidebox_hooks.inc.php | 168 +--------------- admin/inc/class.admin_ui.inc.php | 186 ++++++++++++------ admin/js/app.js | 57 ++++-- admin/setup/setup.inc.php | 7 +- admin/templates/default/account.xet | 10 +- 7 files changed, 361 insertions(+), 251 deletions(-) create mode 100644 admin/inc/class.admin_hooks.inc.php diff --git a/admin/inc/class.admin_account.inc.php b/admin/inc/class.admin_account.inc.php index 21c869e820..f247449248 100644 --- a/admin/inc/class.admin_account.inc.php +++ b/admin/inc/class.admin_account.inc.php @@ -46,6 +46,8 @@ class admin_account if ($content['id']) // existing account { + // invalidate account, before reading it, to code with changed to DB or LDAP outside EGw + accounts::cache_invalidate((int)$content['account_id']); if (!($account = $GLOBALS['egw']->accounts->read($content['account_id']))) { throw new egw_exception_not_found('Account data NOT found!'); @@ -74,8 +76,11 @@ class admin_account 'changepassword' => true, //old default: (bool)$GLOBALS['egw_info']['server']['change_pwd_every_x_days'], 'mustchangepassword' => false, 'account_primary_group' => $GLOBALS['egw']->accounts->name2id('Default'), + 'homedirectory' => $GLOBALS['egw_info']['server']['ldap_account_home'], + 'loginshell' => $GLOBALS['egw_info']['server']['ldap_account_shell'], ); } + $account['ldap_extra_attributes'] = $GLOBALS['egw_info']['server']['ldap_extra_attributes']; $readonlys = array(); if ($deny_edit) diff --git a/admin/inc/class.admin_hooks.inc.php b/admin/inc/class.admin_hooks.inc.php new file mode 100644 index 0000000000..4b62c420a3 --- /dev/null +++ b/admin/inc/class.admin_hooks.inc.php @@ -0,0 +1,179 @@ + + * @author Ralf Becker + * @package admin + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + +/** + * Static hooks for admin application + */ +class admin_hooks +{ + /** + * Functions callable via menuaction + * + * @var unknown_type + */ + var $public_functions = array( + 'register_all_hooks' => True, + ); + + /** + * hooks to build projectmanager's sidebox-menu + * + * @param string/array $args hook args + */ + static function all_hooks($args) + { + unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']); + + if (!isset($_GET['menuaction']) && substr($_SERVER['PHP_SELF'],-16) == '/admin/index.php') + { + admin_statistics::check(); + } + $appname = 'admin'; + $location = is_array($args) ? $args['location'] : $args; + + if ($location == 'sidebox_menu') + { + // Destination div for folder tree + $file[] = array( + 'no_lang' => true, + 'text' => '', + 'link' => false, + 'icon' => false + ); + display_sidebox($appname,lang('Admin'),$file); + return; + } + if ($GLOBALS['egw_info']['user']['apps']['admin']) + { + + if (! $GLOBALS['egw']->acl->check('site_config_access',1,'admin')) + { + $file['Site Configuration'] = egw::link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); + } + + if (! $GLOBALS['egw']->acl->check('account_access',1,'admin')) + { + $file['User Accounts'] = array( + 'id' => '/accounts', + 'icon' => common::image('addressbook', 'accounts'), + 'link' => egw::link('/index.php','menuaction=admin.uiaccounts.list_users'), + ); + } + + if (! $GLOBALS['egw']->acl->check('account_access',16,'admin')) + { + $file['Bulk password reset'] = egw::link('/index.php','menuaction=admin.admin_passwordreset.index'); + } + + if (! $GLOBALS['egw']->acl->check('group_access',1,'admin')) + { + $file['User Groups'] = array( + 'id' => '/groups', + 'icon' => common::image('addressbook', 'group'), + 'child' => 1, + ); + } + + if (! $GLOBALS['egw']->acl->check('applications_access',1,'admin')) + { + $file['Applications'] = egw::link('/index.php','menuaction=admin.admin_applications.index'); + } + if (! $GLOBALS['egw']->acl->check('global_categories_access',1,'admin')) + { + $file['Global Categories'] = egw::link('/index.php','menuaction=admin.admin_categories.index&appname=phpgw'); + } + + if (!$GLOBALS['egw']->acl->check('mainscreen_message_access',1,'admin') || !$GLOBALS['egw']->acl->check('mainscreen_message_access',2,'admin')) + { + $file['Change Main Screen Message'] = egw::link('/index.php','menuaction=admin.uimainscreen.index'); + } + + if (! $GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) + { + $file['View Sessions'] = egw::link('/index.php','menuaction=admin.admin_accesslog.sessions'); + } + + if (! $GLOBALS['egw']->acl->check('access_log_access',1,'admin')) + { + $file['View Access Log'] = egw::link('/index.php','menuaction=admin.admin_accesslog.index'); + } + + if (! $GLOBALS['egw']->acl->check('error_log_access',1,'admin')) + { + $file['View Error Log'] = egw::link('/index.php','menuaction=admin.uilog.list_log'); + } + + if (! $GLOBALS['egw']->acl->check('applications_access',16,'admin')) + { + $file['Clear cache and register hooks'] = egw::link('/index.php','menuaction=admin.admin_hooks.register_all_hooks'); + } + + if (! $GLOBALS['egw']->acl->check('asyncservice_access',1,'admin')) + { + $file['Asynchronous timed services'] = egw::link('/index.php','menuaction=admin.uiasyncservice.index'); + } + + if (! $GLOBALS['egw']->acl->check('db_backup_access',1,'admin')) + { + $file['DB backup and restore'] = egw::link('/index.php','menuaction=admin.admin_db_backup.index'); + } + + if (! $GLOBALS['egw']->acl->check('info_access',1,'admin')) + { + $file['phpInfo'] = "javascript:egw_openWindowCentered2('" . egw::link('/admin/phpinfo.php','',false) . "','phpinfoWindow',700,600,'yes')"; + } + $file['Admin queue and history'] = egw::link('/index.php','menuaction=admin.admin_cmds.index'); + $file['Remote administration instances'] = egw::link('/index.php','menuaction=admin.admin_cmds.remotes'); + $file['Custom translation'] = egw::link('/index.php','menuaction=admin.admin_customtranslation.index'); + + $file['Submit statistic information'] = egw::link('/index.php','menuaction=admin.admin_statistics.submit'); + + if ($location == 'admin') + { + display_section($appname,$file); + } + else + { + foreach($file as &$url) + { + if (is_array($url) && $url['link']) $url = $url['link']; + } + display_sidebox($appname,lang('Admin'),$file); + } + } + } + + /** + * Register all hooks + */ + function register_all_hooks() + { + if ($GLOBALS['egw']->acl->check('applications_access',16,'admin')) + { + $GLOBALS['egw']->redirect_link('/index.php'); + } + egw_cache::flush(egw_cache::INSTANCE); + + $GLOBALS['egw']->hooks->register_all_hooks(); + + common::delete_image_map(); + + if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited + { + $GLOBALS['egw']->invalidate_session_cache(); // in case with cache the egw_info array in the session + } + // allow apps to hook into "Admin >> Clear cache and register hooks" + $GLOBALS['egw']->hooks->process('clear_cache', array(), true); + + $GLOBALS['egw']->redirect_link('/admin/index.php'); + } +} diff --git a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php index 9ff7597596..5bcf148b6e 100644 --- a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php +++ b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php @@ -6,172 +6,14 @@ * @author Stefan Becker * @author Ralf Becker * @package admin + * @deprecated use standard admin_hooks class * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ /** - * Static hooks for admin application + * Old class-name to ease updates + * + * @deprecated use standard admin_hooks class */ -class admin_prefs_sidebox_hooks -{ - /** - * Functions callable via menuaction - * - * @var unknown_type - */ - var $public_functions = array( - 'register_all_hooks' => True, - ); - - /** - * hooks to build projectmanager's sidebox-menu - * - * @param string/array $args hook args - */ - static function all_hooks($args) - { - unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']); - - if (!isset($_GET['menuaction']) && substr($_SERVER['PHP_SELF'],-16) == '/admin/index.php') - { - admin_statistics::check(); - } - $appname = 'admin'; - $location = is_array($args) ? $args['location'] : $args; - - if ($location == 'sidebox_menu') - { - // Destination div for folder tree - $file[] = array( - 'no_lang' => true, - 'text' => '', - 'link' => false, - 'icon' => false - ); - display_sidebox($appname,lang('Admin'),$file); - return; - } - if ($GLOBALS['egw_info']['user']['apps']['admin']) - { - - if (! $GLOBALS['egw']->acl->check('site_config_access',1,'admin')) - { - $file['Site Configuration'] = egw::link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); - } - - if (! $GLOBALS['egw']->acl->check('account_access',1,'admin')) - { - $file['User Accounts'] = array( - 'id' => '/accounts', - 'icon' => common::image('addressbook', 'accounts'), - 'link' => egw::link('/index.php','menuaction=admin.uiaccounts.list_users'), - ); - } - - if (! $GLOBALS['egw']->acl->check('account_access',16,'admin')) - { - $file['Bulk password reset'] = egw::link('/index.php','menuaction=admin.admin_passwordreset.index'); - } - - if (! $GLOBALS['egw']->acl->check('group_access',1,'admin')) - { - $file['User Groups'] = array( - 'id' => '/groups', - 'icon' => common::image('addressbook', 'group'), - 'child' => 1, - 'link' => egw::link('/index.php','menuaction=admin.uiaccounts.list_groups'), - ); - } - - if (! $GLOBALS['egw']->acl->check('applications_access',1,'admin')) - { - $file['Applications'] = egw::link('/index.php','menuaction=admin.admin_applications.index'); - } - if (! $GLOBALS['egw']->acl->check('global_categories_access',1,'admin')) - { - $file['Global Categories'] = egw::link('/index.php','menuaction=admin.admin_categories.index&appname=phpgw'); - } - - if (!$GLOBALS['egw']->acl->check('mainscreen_message_access',1,'admin') || !$GLOBALS['egw']->acl->check('mainscreen_message_access',2,'admin')) - { - $file['Change Main Screen Message'] = egw::link('/index.php','menuaction=admin.uimainscreen.index'); - } - - if (! $GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) - { - $file['View Sessions'] = egw::link('/index.php','menuaction=admin.admin_accesslog.sessions'); - } - - if (! $GLOBALS['egw']->acl->check('access_log_access',1,'admin')) - { - $file['View Access Log'] = egw::link('/index.php','menuaction=admin.admin_accesslog.index'); - } - - if (! $GLOBALS['egw']->acl->check('error_log_access',1,'admin')) - { - $file['View Error Log'] = egw::link('/index.php','menuaction=admin.uilog.list_log'); - } - - if (! $GLOBALS['egw']->acl->check('applications_access',16,'admin')) - { - $file['Clear cache and register hooks'] = egw::link('/index.php','menuaction=admin.admin_prefs_sidebox_hooks.register_all_hooks'); - } - - if (! $GLOBALS['egw']->acl->check('asyncservice_access',1,'admin')) - { - $file['Asynchronous timed services'] = egw::link('/index.php','menuaction=admin.uiasyncservice.index'); - } - - if (! $GLOBALS['egw']->acl->check('db_backup_access',1,'admin')) - { - $file['DB backup and restore'] = egw::link('/index.php','menuaction=admin.admin_db_backup.index'); - } - - if (! $GLOBALS['egw']->acl->check('info_access',1,'admin')) - { - $file['phpInfo'] = "javascript:egw_openWindowCentered2('" . egw::link('/admin/phpinfo.php','',false) . "','phpinfoWindow',700,600,'yes')"; - } - $file['Admin queue and history'] = egw::link('/index.php','menuaction=admin.admin_cmds.index'); - $file['Remote administration instances'] = egw::link('/index.php','menuaction=admin.admin_cmds.remotes'); - $file['Custom translation'] = egw::link('/index.php','menuaction=admin.admin_customtranslation.index'); - - $file['Submit statistic information'] = egw::link('/index.php','menuaction=admin.admin_statistics.submit'); - - if ($location == 'admin') - { - display_section($appname,$file); - } - else - { - foreach($file as &$url) if (is_array($url) && $url['link']) $url = $url['link']; - display_sidebox($appname,lang('Admin'),$file); - } - } - } - - /** - * Register all hooks - */ - function register_all_hooks() - { - if ($GLOBALS['egw']->acl->check('applications_access',16,'admin')) - { - $GLOBALS['egw']->redirect_link('/index.php'); - } - egw_cache::flush(egw_cache::INSTANCE); - - $GLOBALS['egw']->hooks->register_all_hooks(); - - common::delete_image_map(); - - if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited - { - $GLOBALS['egw']->invalidate_session_cache(); // in case with cache the egw_info array in the session - } - // allow apps to hook into "Admin >> Clear cache and register hooks" - $GLOBALS['egw']->hooks->process('clear_cache', array(), true); - - $GLOBALS['egw']->redirect_link('/admin/index.php'); - } -} +class admin_prefs_sidebox_hooks extends admin_hooks {} \ No newline at end of file diff --git a/admin/inc/class.admin_ui.inc.php b/admin/inc/class.admin_ui.inc.php index a797136d29..b329e75416 100644 --- a/admin/inc/class.admin_ui.inc.php +++ b/admin/inc/class.admin_ui.inc.php @@ -73,33 +73,7 @@ class admin_ui $sel_options['account_primary_group'] = $sel_options['filter']; unset($sel_options['account_primary_group']['']); - $actions = array( - 'view' => array( - 'onExecute' => 'javaScript:app.admin.group', - 'caption' => 'Show members', - 'enableId' => '^/groups/-\\d+', - 'default' => true, - ), - 'edit' => array( - 'onExecute' => 'javaScript:app.admin.group', - 'caption' => 'Edit group', - 'enableId' => '^/groups/-\\d+', - ), - 'acl' => array( - 'onExecute' => 'javaScript:app.admin.group', - 'caption' => 'Access control', - 'enableId' => '^/groups/-\\d+', - 'icon' => 'lock', - ), - 'add' => $content['nm']['actions']['add'], - 'delete' => array( - 'onExecute' => 'javaScript:app.admin.group', - 'confirm' => 'Delete this group', - 'caption' => 'Delete group', - 'enableId' => '^/groups/-\\d+', - ), - ); - $tpl->setElementAttribute('tree', 'actions', $actions); + $tpl->setElementAttribute('tree', 'actions', self::tree_actions()); if (!empty($_GET['load'])) { @@ -118,56 +92,49 @@ class admin_ui } /** - * Actions on users + * Actions on tree / groups * * @return array */ - public static function user_actions() + public static function tree_actions() { + $user_actions = self::user_actions(); + $actions = array( - 'edit' => array( - 'caption' => 'Open', + 'view' => array( + 'onExecute' => 'javaScript:app.admin.group', + 'caption' => 'Show members', + 'enableId' => '^/groups/-\\d+', 'default' => true, - 'allowOnMultiple' => false, - 'onExecute' => 'javaScript:app.admin.account', - 'group' => $group=0, + 'group' => $group=1, ), 'add' => array( - 'caption' => 'Add user', - 'onExecute' => 'javaScript:app.admin.account', 'group' => $group, + )+$user_actions['add'], + 'edit' => array( + 'onExecute' => 'javaScript:app.admin.group', + 'caption' => 'Edit group', + 'enableId' => '^/groups/-\\d+', + 'url' => 'menuaction=admin.uiaccounts.edit_group&account_id=$id', + 'group' => 2, ), 'acl' => array( + 'onExecute' => 'javaScript:app.admin.group', 'caption' => 'Access control', - 'allowOnMultiple' => false, - 'url' => 'menuaction=admin.admin_acl.index&account_id=$id', - 'group' => $group, - 'onExecute' => 'javaScript:app.admin.iframe_location', + 'enableId' => '^/groups/-\\d+', 'icon' => 'lock', + 'group' => 2, ), ); - // generate urls for add/edit accounts via addressbook - $edit = egw_link::get_registry('addressbook', 'edit'); - $edit['account_id'] = '$id'; - foreach($edit as $name => $val) - { - $actions['edit']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val; - } - unset($edit['account_id']); - $edit['owner'] = 0; - foreach($edit as $name => $val) - { - $actions['add']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val; - } - ++$group; + $group = 5; // allow to place actions in different groups by hook, this is the default // supporting both old way using $GLOBALS['menuData'] and new just returning data in hook - $apps = array_unique(array_merge(array('admin'), $GLOBALS['egw']->hooks->hook_implemented('edit_user'))); + $apps = array_unique(array_merge(array('admin'), $GLOBALS['egw']->hooks->hook_implemented('edit_group'))); foreach($apps as $app) { -if ($app == 'felamimail') continue; // disabled fmail for now, as it break whole admin, dono why $GLOBALS['menuData'] = $data = array(); - $data = $GLOBALS['egw']->hooks->single('edit_user', $app, true); + $data = $GLOBALS['egw']->hooks->single('edit_group', $app, true); if (!is_array($data)) $data = $GLOBALS['menuData']; + //error_log(__METHOD__."() app $app returned ".array2string($data)); foreach($data as $item) { // allow hook to return "real" actions, but still support legacy: description, url, extradata, options @@ -192,17 +159,108 @@ if ($app == 'felamimail') continue; // disabled fmail for now, as it break whole } if (empty($item['icon'])) $item['icon'] = $app.'/navbar'; if (empty($item['group'])) $item['group'] = $group; - if (empty($item['onExecute'])) $item['onExecute'] = 'javaScript:app.admin.iframe_location'; + if (empty($item['onExecute'])) $item['onExecute'] = 'javaScript:app.admin.group'; + if (!isset($item['allowOnMultiple'])) $item['allowOnMultiple'] = false; + if (!isset($item['enableId'])) $item['enableId'] = '^/groups/-\\d+'; $actions[$item['id']] = $item; } } - $actions['delete'] = array( - 'caption' => 'Delete', - 'group' => ++$group, - 'popup' => '400x200', - 'url' => 'menuaction=admin.admin_account.delete&account_id=$id', - ); + return $actions; + } + + /** + * Actions on users + * + * @return array + */ + public static function user_actions() + { + static $actions = null; + + if (!isset($actions)) + { + $actions = array( + 'edit' => array( + 'caption' => 'Open', + 'default' => true, + 'allowOnMultiple' => false, + 'onExecute' => 'javaScript:app.admin.account', + 'group' => $group=0, + ), + 'add' => array( + 'caption' => 'Add user', + 'onExecute' => 'javaScript:app.admin.account', + 'group' => $group, + ), + 'acl' => array( + 'caption' => 'Access control', + 'allowOnMultiple' => false, + 'url' => 'menuaction=admin.admin_acl.index&account_id=$id', + 'group' => $group, + 'onExecute' => 'javaScript:app.admin.iframe_location', + 'icon' => 'lock', + ), + ); + // generate urls for add/edit accounts via addressbook + $edit = egw_link::get_registry('addressbook', 'edit'); + $edit['account_id'] = '$id'; + foreach($edit as $name => $val) + { + $actions['edit']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val; + } + unset($edit['account_id']); + $edit['owner'] = 0; + foreach($edit as $name => $val) + { + $actions['add']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val; + } + ++$group; + // supporting both old way using $GLOBALS['menuData'] and new just returning data in hook + $apps = array_unique(array_merge(array('admin'), $GLOBALS['egw']->hooks->hook_implemented('edit_user'))); + foreach($apps as $app) + { +if ($app == 'felamimail') continue; // disabled fmail for now, as it break whole admin, dono why + $GLOBALS['menuData'] = $data = array(); + $data = $GLOBALS['egw']->hooks->single('edit_user', $app, true); + if (!is_array($data)) $data = $GLOBALS['menuData']; + foreach($data as $item) + { + // allow hook to return "real" actions, but still support legacy: description, url, extradata, options + if (empty($item['caption'])) + { + $item['caption'] = $item['description']; + unset($item['description']); + } + if (isset($item['url']) && isset($item['extradata'])) + { + $item['url'] = $item['extradata'].'&account_id=$id'; + $item['id'] = substr($item['extradata'], 11); + unset($item['extradata']); + $matches = null; + if ($item['options'] && preg_match('/(egw_openWindowCentered2?|window.open)\([^)]+,(\d+),(\d+).*(title="([^"]+)")?/', $item['options'], $matches)) + { + $item['popup'] = $matches[2].'x'.$matches[3]; + $item['onExecute'] = 'javaScript:nm_action'; + if (isset($matches[5])) $item['tooltip'] = $matches[5]; + unset($item['options']); + } + } + if (empty($item['icon'])) $item['icon'] = $app.'/navbar'; + if (empty($item['group'])) $item['group'] = $group; + if (empty($item['onExecute'])) $item['onExecute'] = 'javaScript:app.admin.iframe_location'; + if (!isset($item['allowOnMultiple'])) $item['allowOnMultiple'] = false; + + $actions[$item['id']] = $item; + } + } + $actions['delete'] = array( + 'caption' => 'Delete', + 'group' => ++$group, + 'popup' => '400x200', + 'url' => 'menuaction=admin.admin_account.delete&account_id=$id', + ); + } //error_log(__METHOD__."() actions=".array2string($actions)); return $actions; } diff --git a/admin/js/app.js b/admin/js/app.js index 92d7f4ca32..77e81d39a1 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -15,22 +15,29 @@ * @augments AppJS */ app.classes.admin = AppJS.extend( +/** + * @lends app.classes.admin + */ { appname: 'admin', /** * reference to splitter + * + * {et2_splitter} */ splitter: null, /** * reference to splitter + * + * {et2_iframe} */ iframe: null, /** * Constructor * - * @memberOf app.filemanager + * @memberOf app.classes.admin */ init: function() { @@ -262,14 +269,6 @@ app.classes.admin = AppJS.extend( this.run(_senders[0].id, this.et2.getWidgetById('tree')); break; - case 'edit': - this.splitter.dock(); - this.iframe.set_src(egw.link('/index.php', { - menuaction: 'admin.uiaccounts.edit_group', - account_id: _senders[0].id.split('/')[2] - })); - break; - case 'delete': var account_id = _senders[0].id.split('/')[2]; this.egw.json('admin_account::ajax_delete_group', [account_id]).sendRequest(); @@ -282,6 +281,28 @@ app.classes.admin = AppJS.extend( account_id: _senders[0].id.split('/')[2] })); break; + + default: + if (!_action.data.url) + { + alert('Missing url in action '+_action.id+'!'); + break; + } + var url = _action.data.url.replace('$id', _senders[0].id.split('/')[2]); + if (url[0] != '/' && url.substr(0, 4) != 'http') + { + url = this.egw.link('/index.php', url); + } + if (_action.data.popup) + { + this.egw.open_link(url, '_blank', _action.data.popup); + } + else + { + this.splitter.dock(); + this.iframe.set_src(url); + } + break; } }, @@ -385,15 +406,15 @@ app.classes.admin = AppJS.extend( if (diff.length > 0) { var removed_cat_label = jQuery.map(select_owner.options.select_options, function (val, i) - { - for (j=0; j <= diff.length;j++) - { - if (diff[j] == val.value) - { - return val.label; - } - } - }); + { + for (var j=0; j <= diff.length;j++) + { + if (diff[j] == val.value) + { + return val.label; + } + } + }); // Somebody will lose permission, give warning. if(removed_cat_label) diff --git a/admin/setup/setup.inc.php b/admin/setup/setup.inc.php index a103542e95..e043f62f83 100755 --- a/admin/setup/setup.inc.php +++ b/admin/setup/setup.inc.php @@ -37,13 +37,10 @@ $setup_info['admin']['hooks'] = array( 'after_navbar', 'config_validate', 'deleteaccount', - 'view_user' => 'admin.uiaccounts.edit_view_user_hook', - 'edit_user' => 'admin.uiaccounts.edit_view_user_hook', - 'group_manager' => 'admin.uiaccounts.edit_group_hook', 'topmenu_info' ); -$setup_info['admin']['hooks']['admin'] = 'admin.admin_prefs_sidebox_hooks.all_hooks'; -$setup_info['admin']['hooks']['sidebox_menu'] = 'admin.admin_prefs_sidebox_hooks.all_hooks'; +$setup_info['admin']['hooks']['admin'] = 'admin.admin_hooks.all_hooks'; +$setup_info['admin']['hooks']['sidebox_menu'] = 'admin.admin_hooks.all_hooks'; // add account tab to addressbook.edit $setup_info['admin']['hooks']['addressbook_edit'] = 'admin.admin_account.addressbook_edit'; diff --git a/admin/templates/default/account.xet b/admin/templates/default/account.xet index 54ab764e52..be0e0573d8 100644 --- a/admin/templates/default/account.xet +++ b/admin/templates/default/account.xet @@ -41,6 +41,14 @@ + + + + + + + + @@ -51,7 +59,7 @@ - +