allow to document group deletion

This commit is contained in:
Ralf Becker 2018-08-23 12:40:18 +02:00
parent 08b9138ae6
commit c93719bc02
3 changed files with 13 additions and 9 deletions

View File

@ -253,14 +253,14 @@ class admin_account
}
//error_log(__METHOD__."() \$_GET[account_id]=$_GET[account_id], \$_GET[contact_id]=$_GET[contact_id] content=".array2string($content));
}
if ($GLOBALS['egw']->acl->check('account_access',32,'admin') || !($content['account_id'] > 0) ||
if ($GLOBALS['egw']->acl->check('account_access',32,'admin') ||
$GLOBALS['egw_info']['user']['account_id'] == $content['account_id'])
{
Framework::window_close(lang('Permission denied!!!'));
}
if ($content['delete'])
{
$cmd = new admin_cmd_delete_account($content['account_id'], $content['new_owner'], true, $content['admin_cmd']);
$cmd = new admin_cmd_delete_account($content['account_id'], $content['new_owner'], $content['account_id'] > 0, $content['admin_cmd']);
$msg = $cmd->run();
if ($content['contact_id'])
{

View File

@ -175,7 +175,7 @@ app.classes.admin = AppJS.extend(
{
this.iframe.set_src(_url);
}
var m = _url.match(/menuaction=([^&]+)(?:.*appname=(\w+))?/)
var m = _url.match(/menuaction=([^&]+)(?:.*appname=(\w+))?/);
if(m.length >= 2)
{
var app = m[2] ? m[2] : m[1].split('.')[0];
@ -416,9 +416,12 @@ app.classes.admin = AppJS.extend(
break;
case 'delete':
this.egw.json('admin_account::ajax_delete_group', [account_id]).sendRequest();
break;
if (!this.egw.app('policy'))
{
this.egw.json('admin_account::ajax_delete_group', [account_id]).sendRequest();
break;
}
// fall through to open popup for policy
default:
if (!_action.data.url)
{
@ -485,8 +488,9 @@ app.classes.admin = AppJS.extend(
*
* @param content List of content for the dialog template
* @param sel_options optional select options
* @param {et2_widget} widgetContainer of etemplate that 'owns' the dialog
* @param {etemplate2} etemplate of etemplate that 'owns' the dialog
* @param {string} app Name of app
* @param {function} callback
*/
_acl_dialog: function(content, sel_options, etemplate, app, callback)
{
@ -1303,6 +1307,6 @@ app.classes.admin = AppJS.extend(
[widget.get_value(), taglist.get_value()],
function(_data){
taglist.set_value(_data);
}).sendRequest()
}).sendRequest();
}
});

View File

@ -4,7 +4,7 @@
<overlay>
<template id="admin.account.delete" template="" lang="" group="0" version="18.1.001">
<box class="dialogHeader">
<select-account id="account_id" readonly="true" label="Delete account %s"/>
<select-account id="account_id" readonly="true" label="Delete"/>
</box>
<tabbox id="tabs" width="99%">
<tabs>