Fix unable to add ACLs

This commit is contained in:
nathangray 2017-03-09 08:54:50 -07:00
parent 6221e69229
commit e34e679733
2 changed files with 7 additions and 4 deletions

View File

@ -560,9 +560,10 @@ app.classes.admin = AppJS.extend(
// Only send the request if they entered everything (or selected no apps) // Only send the request if they entered everything (or selected no apps)
if(_value.acl_account && (_value.acl_appname && _value.acl_location || typeof _value.apps != 'undefined')) if(_value.acl_account && (_value.acl_appname && _value.acl_location || typeof _value.apps != 'undefined'))
{ {
var id = [];
if(_value.acl_appname && _value.acl_account && _value.acl_location) if(_value.acl_appname && _value.acl_account && _value.acl_location)
{ {
var id = _value.acl_appname+':'+_value.acl_account+':'+_value.acl_location; id = _value.acl_appname+':'+_value.acl_account+':'+_value.acl_location;
if(content && content.id && id != content.id) if(content && content.id && id != content.id)
{ {
// Changed the account or location, remove previous or we // Changed the account or location, remove previous or we
@ -570,9 +571,9 @@ app.classes.admin = AppJS.extend(
this.egw.json(className+'::ajax_change_acl', [content.id, 0], null,this,false,this) this.egw.json(className+'::ajax_change_acl', [content.id, 0], null,this,false,this)
.sendRequest(); .sendRequest();
} }
id = [id];
} }
var rights = 0; var rights = 0;
var id = [];
for(var i in _value.acl) for(var i in _value.acl)
{ {
rights += parseInt(_value.acl[i]); rights += parseInt(_value.acl[i]);

View File

@ -12,13 +12,15 @@
<row disabled="@acl_location=run" part="header"> <row disabled="@acl_location=run" part="header">
<description value="Application"/> <description value="Application"/>
<menulist> <menulist>
<menupopup id="acl_appname" needed="1" onchange="app.admin.acl_reopen_dialog" options="Select one"/> <!-- app.admin doesn't exist (for unknown reason), but accessing it through etemplate2 works -->
<menupopup id="acl_appname" needed="1" onchange="etemplate2.getById('admin-acl').app_obj.admin.acl_reopen_dialog" options="Select one"/>
</menulist> </menulist>
</row> </row>
<row part="header"> <row part="header">
<description value="Data from" for="acl_account"/> <description value="Data from" for="acl_account"/>
<menulist> <menulist>
<menupopup type="select-account" id="acl_account" account_type="both" needed="1" onchange="app.admin.acl_reopen_dialog"/> <!-- app.admin doesn't exist (for unknown reason), but accessing it through etemplate2 works -->
<menupopup type="select-account" id="acl_account" account_type="both" needed="1" onchange="etemplate2.getById('admin-acl').app_obj.admin.acl_reopen_dialog"/>
</menulist> </menulist>
</row> </row>
<row disabled="@acl_location=run" part="header"> <row disabled="@acl_location=run" part="header">