next step for new ACL management

This commit is contained in:
Ralf Becker 2013-08-27 17:58:38 +00:00
parent 6028ac8eca
commit 5a801bbb67
6 changed files with 377 additions and 49 deletions

View File

@ -23,8 +23,122 @@ class admin_acl
*/
public $public_functions = array(
'index' => true,
'acl' => true,
);
/**
* Edit or add an ACL entry
*
* @param array $content
* @param string $msg
*/
public function acl(array $content=null, $msg='')
{
$state = (array)egw_cache::getSession(__CLASS__, 'state');
$tpl = new etemplate_old('admin.acl.edit'); // auto-repeat of acl & label not working with etemplate_new!
if (!is_array($content))
{
if (isset($_GET['id']))
{
list($app, $account, $location) = explode(':', $_GET['id'], 3);
$acl = (int)$account == (int)$GLOBALS['egw_info']['user']['account_id'] ?
$GLOBALS['egw']->acl : new acl($account);
if (!($rights = $acl->get_rights($location, $app)))
{
egw_framework::window_close(lang('ACL entry not found!'));
}
}
else
{
$app = $state['acl_appname'];
$location = $state['filter'] == 'run' ? 'run' : $state['account_id'];
$account = $state['filter'] == 'run' ? $state['account_id'] : $state['acl_account'];
$rights = 1;
}
$content = array(
'id' => $_GET['id'],
'acl_appname' => $app,
'acl_location' => $location,
'acl_account' => $account,
);
}
$acl_rights = $GLOBALS['egw']->hooks->process(array(
'location' => 'acl_rights',
'owner' => $content['account_id'],
));
if ($content['save'])
{
self::check_access($content['acl_location']);
$acl = new acl($content['acl_account']);
// assable rights again
$rights = 0;
foreach($content['acl'] as $right)
{
$rights |= $right;
}
$id = !empty($content['id']) ? $content['id'] :
$content['acl_appname'].':'.$content['acl_account'].':'.$content['acl_location'];
//error_log(__METHOD__."() id=$id, acl=".array2string($content['acl'])." --> rights=$rights");
if ($acl->get_specific_rights($content['acl_location'], $content['acl_appname']) == $rights)
{
// nothing changed --> nothing to do
}
elseif (!$rights) // all rights removed --> delete it
{
$acl->delete_repository($content['acl_appname'], $content['acl_location'], $content['acl_account']);
egw_framework::refresh_opener(lang('ACL deleted.'), 'admin', $id, 'delete');
}
else
{
$acl->add_repository($content['acl_appname'], $content['acl_location'], $content['acl_account'], $rights);
if ($content['id'])
{
egw_framework::refresh_opener(lang('ACL updated.'), 'admin', $id, 'edit');
}
else
{
egw_framework::refresh_opener(lang('ACL added.'), 'admin', $id, 'add');
}
}
egw_framework::window_close();
}
$content['acl'] = $content['label'] = array();
foreach($state['filter'] == 'run' ? array(1 => 'run') : $acl_rights[$content['acl_appname']] as $right => $label)
{
$content['acl'][] = $rights & $right;
$content['right'][] = $right;
$content['label'][] = lang($label);
}
foreach($state['filter'] == 'run' ? $GLOBALS['egw_info']['apps'] : $acl_rights as $app => $data)
{
$sel_options['acl_appname'][$app] = lang($app);
}
natcasesort($sel_options['acl_appname']);
if (!empty($content['id']))
{
$readonlys['acl_appname'] = $readonlys['acl_account'] = $readonlys['acl_location'] = true;
}
if ($state['filter'] == 'run')
{
$readonlys['acl_account'] = true;
$tpl->setElementAttribute('acl_appname', 'onchange', '');
}
// view only, if no rights
if (!self::check_access($content['acl_location'], false))
{
$readonlys[__ALL__] = true;
$readonlys['cancel'] = false;
}
error_log(__METHOD__."() _GET[id]=".array2string($_GET['id'])." --> content=".array2string($content));
$tpl->exec('admin.admin_acl.acl', $content, $sel_options, $readonlys, $content);
}
/**
* Callback for nextmatch to fetch acl
*
@ -36,9 +150,26 @@ class admin_acl
{
$so_sql = new so_sql('phpgwapi', acl::TABLE, null, '', true);
// client queries destinct rows by their row-id
if (isset($query['col_filter']['id']))
{
$query['col_filter'][] = $GLOBALS['egw']->db->concat('acl_appname',"':'",'acl_account',"':'",'acl_location').
' IN ('.implode(',', array_map(array($GLOBALS['egw']->db, 'quote'), (array)$query['col_filter']['id'])).')';
unset($query['col_filter']['id']);
}
else
{
$memberships = $GLOBALS['egw']->accounts->memberships($query['account_id'], true);
$memberships[] = $query['account_id'];
egw_cache::setSession(__CLASS__, 'state', array(
'account_id' => $query['account_id'],
'filter' => $query['filter'],
'acl_appname' => $query['col_filter']['acl_appname'],
'acl_location' => $query['col_filter']['acl_location'],
'acl_account' => $query['col_filter']['acl_account'],
));
if ($GLOBALS['egw_info']['user']['preferences']['admin']['acl_filter'] != $query['filter'])
{
$GLOBALS['egw']->preferences->add('admin', 'acl_filter', $query['filter']);
@ -49,40 +180,48 @@ class admin_acl
default:
case 'run':
$query['col_filter']['acl_location'] = 'run';
if (empty($query['col_filter']['acl_account']))
{
$query['col_filter']['acl_account'] = $memberships;
}
break;
case 'own':
$query['col_filter'][] = "acl_location!='run'";
//$query['col_filter'][] = "acl_location!='run'";
// remove everything not an account-id in location, like category based acl
if ($GLOBALS['egw']->db->Type == 'mysql')
{
$query['col_filter'][] = "acl_location REGEXP '^-?[0-9]+$'";
}
else
{
$query['col_filter'][] = "acl_location SIMILAR TO '-?[0-9]+'";
}
if (empty($query['col_filter']['acl_account']))
{
$query['col_filter']['acl_account'] = $memberships;
}
break;
case 'other':
$query['col_filter']['acl_location'] = $query['account_id'];
if (empty($query['col_filter']['acl_location']))
{
$query['col_filter']['acl_location'] = $memberships;//$query['account_id'];
}
break;
}
// do NOT list group-memberships and other non-ACL stuff here
if (empty($query['col_filter']['acl_appname']) && $query['filter'] != 'run')
{
//$query['col_filter'][] = "NOT acl_appname IN ('phpgw_group','sqlfs')";
$query['col_filter']['acl_appname'] = array_keys($query['acl_rights']);
}
}
$total = $so_sql->get_rows($query, $rows, $readonlys);
static $rights = array(
acl::READ => 'read',
acl::ADD => 'add',
acl::EDIT => 'edit',
acl::DELETE => 'delete',
acl::PRIVAT => 'private',
acl::CUSTOM1 => 'custom 1',
acl::CUSTOM2 => 'custom 2',
acl::CUSTOM3 => 'custom 3',
);
$app_rights = $GLOBALS['egw']->hooks->process(array(
'location' => 'acl_rights',
'owner' => $query['account_id'],
), array(), true);
foreach($rows as $n => &$row)
{
// generate a row-id
$row['id'] = $row['acl_appname'].'-'.$row['acl_account'].'-'.$row['acl_location'];
$row['id'] = $row['acl_appname'].':'.$row['acl_account'].':'.$row['acl_location'];
if ($query['filter'] == 'run')
{
@ -91,7 +230,7 @@ class admin_acl
else
{
if ($app !== $row['acl_appname']) translation::add_app($row['app_name']);
foreach(isset($app_rights[$row['acl_appname']]) ? $app_rights[$row['acl_appname']] : $rights as $val => $label)
foreach($query['acl_rights'][$row['acl_appname']] as $val => $label)
{
if ($row['acl_rights'] & $val)
{
@ -99,12 +238,100 @@ class admin_acl
}
}
}
error_log(__METHOD__."() $n: ".array2string($row));
if (!self::check_access($row['acl_location'], false)) // false: do NOT throw an exception!
{
$row['class'] = 'rowNoEdit';
}
error_log(__METHOD__."(".array2string($query).") returning ".$total);
//error_log(__METHOD__."() $n: ".array2string($row));
}
//error_log(__METHOD__."(".array2string($query).") returning ".$total);
return $total;
}
/**
* Check if current user has access to ACL setting of a given location
*
* @param int|string $location numeric account-id or "run"
* @param boolean $throw=true if true, throw an exception if no access, instead of just returning false
* @return boolean true if access is granted, false if notification_bo
* @throws egw_exception_no_permission
*/
public static function check_access($location, $throw=true)
{
static $admin_access;
static $own_access;
if (is_null($admin_access))
{
$admin_access = isset($GLOBALS['egw_info']['user']['apps']['admin']) &&
!$GLOBALS['egw']->acl->check('account_access', 64, 'admin'); // ! because this denies access!
$own_access = $admin_access || isset($GLOBALS['egw_info']['user']['apps']['preferences']);
}
if (!($location === 'run' || (int)$location) ||
!((int)$location == (int)$GLOBALS['egw_info']['user']['account_id'] ? $own_access : $admin_access))
{
if ($throw) throw new egw_exception_no_permission(lang('Permission denied!!!'));
return false;
}
return true;
}
/**
* Change (add, modify, delete) an ACL entry
*
* Checks access and throws an exception, if a change is attempted without proper access
*
* @param string|array $ids "$app:$account:$location" string used as row-id in list
* @param int $rights=null null to delete, or new rights
* @throws egw_exception_no_permission
*/
public static function ajax_change_acl($ids, $rights=null)
{
foreach((array)$ids as $id)
{
list($app, $account_id, $location) = explode(':', $id, 3);
self::check_access($location); // throws exception, if no rights
if ((int)$account_id == (int)$GLOBALS['egw_info']['user']['account_id'])
{
$acl = $GLOBALS['egw']->acl;
}
else
{
$acl = new acl($account_id);
}
if (!(int)$rights) // this also handles taking away all rights as delete
{
$acl->delete_repository($app, $location, $account_id);
}
else
{
$acl->add_repository($app, $location, $account_id, $rights);
}
}
if (!(int)$rights)
{
if (count(ids) > 1)
{
$msg = lang('%1 ACL entries deleted.', count($ids));
}
else
{
$msg = lang('ACL entry deleted.');
}
}
else
{
$msg = lang('ACL updated');
}
egw_json_response::get()->data(array(
'msg' => $msg,
'ids' => $ids,
'type' => !(int)$rights ? 'delete' : 'add',
));
}
/**
* New index page
*
@ -127,11 +354,14 @@ class admin_acl
'row_id' => 'id',
//'default_cols' => '!account_id,account_created',
'actions' => self::get_actions(),
'acl_rights' => $GLOBALS['egw']->hooks->process(array(
'location' => 'acl_rights',
'owner' => $query['account_id'],
), array(), true),
);
if (isset($_GET['account_id']) && (int)$_GET['account_id'])
{
$content['nm']['account_id'] = (int)$_GET['account_id'];
$content['nm']['acl_app'] = ''; // show app run rights
$content['nm']['order'] = 'acl_appname';
}
$sel_options = array(
@ -141,6 +371,7 @@ class admin_acl
'run' => 'Run rights for applications',
),
);
$tpl->exec('admin.admin_acl.index', $content, $sel_options);
}
@ -156,14 +387,17 @@ class admin_acl
'caption' => 'Edit ACL',
'default' => true,
'allowOnMultiple' => false,
'onExecute' => 'javaScript:app.admin.acl',
),
'add' => array(
'caption' => 'Add ACL',
'onExecute' => 'javaScript:app.admin.acl',
),
'delete' => array(
'confirm' => 'Delete this ACL',
'caption' => 'Delete ACL',
'disableClass' => 'rowNoEdit',
'onExecute' => 'javaScript:app.admin.acl',
),
);
}

View File

@ -180,13 +180,48 @@ app.admin = AppJS.extend(
},
/**
* Delete a group callback for tree
* Modify an ACL entry
*
* @param Object _action egwAction
* @param Object _senders egwActionObject _senders[0].iface.id holds the id
*/
delete_group: function(_action, _senders)
acl: function(_action, _senders)
{
alert('delete_group '+_senders[0].iface.id);
var ids = [];
for(var i=0; i < _senders.length; ++i)
{
ids.push(_senders[i].id.substr(7)); // remove "admin::" prefix
}
switch(_action.id)
{
case 'delete':
var request = new egw_json_request('admin_acl::ajax_change_acl', [ids], this);
request.sendRequest(false, this._acl_callback, this);
break;
case 'edit':
egw().open_link(egw.link('/index.php', {
menuaction: 'admin.admin_acl.acl',
id: ids[0],
}), 'acl', '300x300');
break;
case 'add':
egw().open_link(egw.link('/index.php', {
menuaction: 'admin.admin_acl.acl',
}), 'acl', '250x250');
break;
}
},
/**
* Callback called on successfull call of serverside ACL handling
*
* @param string _data returned from server
*/
_acl_callback: function(_data)
{
window.egw_refresh(_data.msg, this.appname, _data.ids, _data.type);
},
});

View File

@ -2,7 +2,7 @@
/**
* EGroupware - eTemplates for Application admin
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2013-07-10 12:28
* generated by soetemplate::dump4setup() 2013-08-27 19:21
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package admin
@ -26,6 +26,12 @@ $templ_data[] = array('name' => 'admin.accesslog.get_rows','template' => '','lan
$templ_data[] = array('name' => 'admin.accesslog.rows','template' => '','lang' => '','group' => '0','version' => '1.9.003','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:6:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:1:"G";s:10:",@no_total";s:1:"F";s:7:",@no_lo";s:1:"B";s:18:",@no_sessionstatus";s:1:"K";s:2:"1%";}i:1;a:11:{s:1:"A";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:7:"LoginID";s:4:"name";s:10:"account_id";}s:1:"B";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:12:"Login-Status";s:4:"name";s:13:"sessionstatus";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Loginid";s:4:"name";s:7:"loginid";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:2:"IP";s:4:"name";s:2:"ip";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Login";s:4:"name";s:2:"li";}s:1:"F";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:6:"Logout";s:4:"name";s:2:"lo";}s:1:"G";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Total";s:4:"name";s:5:"total";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Idle";s:4:"name";s:11:"session_dla";}s:1:"I";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Last action";s:4:"name";s:14:"session_action";}s:1:"J";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:10:"User-Agent";s:4:"name";s:10:"user_agent";}s:1:"K";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";s:5:"align";s:6:"center";}i:2;a:4:{s:4:"type";s:10:"buttononly";s:4:"size";s:5:"check";s:5:"label";s:10:"Select all";s:7:"onclick";s:61:"toggle_all(this.form,form::name(\'selected[]\')); return false;";}}}i:2;a:11:{s:1:"A";a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:18:"${row}[account_id]";s:8:"readonly";s:1:"1";s:5:"label";s:22:"$row_cont[alt_loginid]";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:21:"${row}[sessionstatus]";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[loginid]";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:4:"name";s:10:"${row}[ip]";}s:1:"E";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:10:"${row}[li]";s:8:"readonly";s:1:"1";}s:1:"F";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:10:"${row}[lo]";s:8:"readonly";s:1:"1";}s:1:"G";a:4:{s:4:"type";s:13:"date-duration";s:4:"name";s:13:"${row}[total]";s:8:"readonly";s:1:"1";s:4:"size";s:6:",hm,24";}s:1:"H";a:3:{s:4:"type";s:10:"date-since";s:4:"name";s:19:"${row}[session_dla]";s:8:"readonly";s:1:"1";}s:1:"I";a:2:{s:4:"type";s:5:"label";s:4:"name";s:22:"${row}[session_action]";}s:1:"J";a:4:{s:4:"type";s:5:"label";s:4:"span";s:10:",userAgent";s:4:"name";s:18:"{$row}[user_agent]";s:4:"help";s:21:"$row_cont[user_agent]";}s:1:"K";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"3,,0,0";i:1;a:6:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"name";s:28:"delete[$row_cont[sessionid]]";s:4:"help";s:21:"Delete this log entry";s:7:"onclick";s:40:"return confirm(\'Delete this log entry\');";}i:2;a:5:{s:4:"type";s:6:"button";s:4:"size";s:5:"close";s:5:"label";s:4:"Kill";s:4:"name";s:26:"kill[$row_cont[sessionid]]";s:7:"onclick";s:63:"return confirm(\'Are you sure you want to kill this session ?\');";}s:5:"align";s:6:"center";i:3;a:4:{s:4:"type";s:8:"checkbox";s:4:"size";s:20:"$row_cont[sessionid]";s:4:"name";s:10:"selected[]";s:5:"align";s:5:"right";}}}}s:4:"rows";i:2;s:4:"cols";i:11;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1254816462',);
$templ_data[] = array('name' => 'admin.acl','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:8:{s:4:"type";s:4:"vbox";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:8:",message";s:4:"name";s:3:"msg";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:1:"3";i:1;a:3:{s:4:"type";s:5:"label";s:4:"span";s:8:",message";s:4:"name";s:3:"msg";}i:2;a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:2:"nm";s:4:"size";s:14:"admin.acl.rows";}i:3;a:1:{s:4:"type";s:5:"label";}}}','size' => '','style' => '','modified' => '1376413827',);
$templ_data[] = array('name' => 'admin.acl.edit','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:2:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:4:{s:2:"h2";s:25:",@acl_location=run,header";s:2:"h3";s:8:",,header";s:2:"h1";s:8:",,header";s:2:"c4";s:4:",top";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"size";s:10:"Select one";s:4:"name";s:11:"acl_appname";s:6:"needed";s:1:"1";s:8:"onchange";i:1;}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"From";s:4:"size";s:15:",,,acl_location";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:12:"acl_location";s:8:"readonly";s:1:"1";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:2:"To";s:4:"size";s:14:",,,acl_account";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:11:"acl_account";s:6:"needed";s:1:"1";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Rights";}s:1:"B";a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:8:"checkbox";s:5:"label";s:12:"@label[$row]";s:4:"name";s:9:"acl[$row]";s:4:"span";s:3:"all";s:4:"size";s:22:"{$cont[right][$row]},0";}}}s:4:"rows";i:1;s:4:"cols";i:1;}}}s:4:"rows";i:4;s:4:"cols";i:2;}i:1;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:6:"cancel";s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";}}}','size' => '','style' => '','modified' => '1377602915',);
$templ_data[] = array('name' => 'admin.acl.rows','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:1:{s:1:"A";s:2:"24";}i:1;a:12:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:22:"nextmatch-customfilter";s:4:"name";s:11:"acl_appname";s:4:"size";s:27:"select-app,All applications";}s:1:"C";a:4:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:17:"All accounts,both";s:4:"name";s:12:"acl_location";s:5:"label";s:4:"From";}s:1:"D";a:4:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:17:"All accounts,both";s:4:"name";s:11:"acl_account";s:5:"label";s:2:"To";}s:1:"E";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:6:"Rights";s:4:"span";s:3:"all";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}s:1:"H";a:1:{s:4:"type";s:5:"label";}s:1:"I";a:1:{s:4:"type";s:5:"label";}s:1:"J";a:1:{s:4:"type";s:5:"label";}s:1:"K";a:1:{s:4:"type";s:5:"label";}s:1:"L";a:1:{s:4:"type";s:5:"label";}}i:2;a:12:{s:1:"A";a:4:{s:4:"type";s:5:"image";s:4:"span";s:13:",admin_aclApp";s:4:"name";s:29:"$row_cont[acl_appname]/navbar";s:5:"align";s:6:"center";}s:1:"B";a:3:{s:4:"type";s:10:"select-app";s:4:"name";s:19:"${row}[acl_appname]";s:8:"readonly";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:20:"${row}[acl_location]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:19:"${row}[acl_account]";s:8:"readonly";s:1:"1";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[acl1]";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[acl2]";}s:1:"G";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[acl4]";}s:1:"H";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[acl8]";}s:1:"I";a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[acl16]";}s:1:"J";a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[acl64]";}s:1:"K";a:2:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[acl128]";}s:1:"L";a:2:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[acl256]";}}}s:4:"rows";i:2;s:4:"cols";i:12;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1376413969',);
$templ_data[] = array('name' => 'admin.applications','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:9:"nextmatch";s:4:"size";s:4:"rows";s:4:"span";s:3:"all";s:4:"name";s:2:"nm";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:28:"Number applications serially";s:4:"name";s:6:"number";}i:2;a:2:{s:4:"type";s:5:"label";s:5:"label";s:157:"Number the applications serially. If they are not numbered serially, sorting the applications could work wrong. This will not change the application\'s order.";}}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"size";s:7:"100%,,0";s:7:"options";a:2:{i:0;s:4:"100%";i:2;s:1:"0";}}}','size' => '100%,,0','style' => '','modified' => '1276610727',);
$templ_data[] = array('name' => 'admin.applications.rows','template' => '','lang' => '','group' => '0','version' => '1.7.002','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:7:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:1:"A";s:5:"1px,1";s:1:"E";s:4:"80px";s:1:"D";s:5:"120px";s:1:"F";s:2:"80";s:1:"B";s:5:"120px";}i:1;a:6:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"align";s:6:"center";}s:1:"C";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"D";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Version";s:4:"name";s:7:"version";}s:1:"E";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Order";s:4:"name";s:5:"order";}s:1:"F";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Actions";s:4:"name";s:7:"actions";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"image";s:5:"align";s:6:"center";s:4:"name";s:14:"${row}[app_id]";}s:1:"B";a:3:{s:4:"type";s:5:"image";s:4:"name";s:13:"${row}[image]";s:5:"align";s:6:"center";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[app_name]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[app_version]";s:8:"readonly";s:1:"1";}s:1:"E";a:4:{s:4:"type";s:5:"label";s:4:"name";s:17:"${row}[app_order]";s:7:"no_lang";s:1:"1";s:8:"readonly";s:1:"1";}s:1:"F";a:5:{s:4:"type";s:4:"hbox";s:8:"readonly";s:1:"1";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:6:"button";s:4:"size";s:3:"up2";s:5:"label";s:2:"up";s:4:"name";s:21:"up[$row_cont[app_id]]";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"size";s:5:"down2";s:5:"label";s:4:"down";s:4:"name";s:23:"down[$row_cont[app_id]]";}}}}s:4:"rows";i:2;s:4:"cols";i:6;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1275405742',);
@ -93,6 +99,10 @@ $templ_data[] = array('name' => 'admin.customtranslation','template' => '','lang
$templ_data[] = array('name' => 'admin.export_users_csv_selectors','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:10:"All,groups";s:5:"label";s:5:"Group";s:4:"name";s:8:"group_id";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"name";s:9:"selection";s:7:"options";a:0:{}}}','size' => '','style' => '','modified' => '1302620448',);
$templ_data[] = array('name' => 'admin.index','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:3:{i:0;a:6:{s:11:"autoloading";s:19:"admin_ui::ajax_tree";s:7:"onclick";s:43:"app.admin.run(widget.event_args[0],widget);";s:11:"parent_node";s:17:"admin_tree_target";s:10:"std_images";s:6:"bullet";s:4:"name";s:10:"admin_tree";s:4:"type";s:4:"tree";}i:1;a:2:{s:4:"name";s:3:"msg";s:4:"type";s:4:"html";}i:2;a:7:{s:9:"dock_side";s:7:"topDock";s:11:"orientation";s:1:"h";s:4:"name";s:14:"admin_splitter";s:4:"type";s:5:"split";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:8:"admin_nm";s:4:"size";s:4:"rows";}i:2;a:6:{s:11:"frameborder";s:1:"1";s:6:"height";s:5:"500px";s:9:"scrolling";s:4:"auto";s:5:"width";s:4:"100%";s:4:"name";s:12:"admin_iframe";s:4:"type";s:6:"iframe";}}}','size' => '','style' => '','modified' => '1372838002',);
$templ_data[] = array('name' => 'admin.index.rows','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c2";s:23:"$row_cont[status_class]";s:1:"B";s:2:"30";}i:1;a:9:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Login-ID";s:4:"name";s:11:"account_lid";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:2:"ID";s:4:"name";s:10:"account_id";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:9:"Firstname";s:4:"name";s:17:"account_firstname";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Lastname";s:4:"name";s:16:"account_lastname";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"EMail";s:4:"name";s:13:"account_email";}s:1:"F";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:21:"account_primary_group";s:5:"label";s:13:"Primary group";}s:1:"G";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Expires";s:4:"name";s:15:"account_expires";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Created";s:4:"name";s:15:"account_created";}s:1:"I";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:13:"Last modified";s:4:"name";s:16:"account_modified";}}i:2;a:9:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[account_lid]";s:7:"no_lang";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"name";s:18:"${row}[account_id]";s:7:"no_lang";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:4:"name";s:25:"${row}[account_firstname]";s:7:"no_lang";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:4:"name";s:24:"${row}[account_lastname]";s:7:"no_lang";s:1:"1";}s:1:"E";a:4:{s:4:"type";s:9:"url-email";s:4:"name";s:21:"${row}[account_email]";s:8:"readonly";s:1:"1";s:4:"span";s:22:",adminOverflowEllipsis";}s:1:"F";a:4:{s:4:"type";s:6:"select";s:4:"name";s:29:"${row}[account_primary_group]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"G";a:4:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[status]";s:4:"span";s:12:",adminStatus";s:7:"no_lang";s:1:"1";}s:1:"H";a:3:{s:4:"type";s:9:"date-time";s:8:"readonly";s:1:"1";s:4:"name";s:23:"${row}[account_created]";}s:1:"I";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:24:"${row}[account_modified]";s:8:"readonly";s:1:"1";}}}s:4:"rows";i:2;s:4:"cols";i:9;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1372838020',);
$templ_data[] = array('name' => 'admin.passwordreset','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:2:{s:2:"h1";s:6:",!@msg";s:2:"c5";s:4:",top";}i:1;a:3:{s:1:"A";a:3:{s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Select users";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:5:"users";s:4:"size";s:2:"15";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:4;a:2:{s:1:"A";a:9:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"6";s:5:"label";s:7:"Actions";i:1;a:3:{s:5:"label";s:21:"Set a random password";s:4:"name";s:9:"random_pw";s:4:"type";s:8:"checkbox";}i:2;a:5:{s:4:"type";s:11:"select-bool";s:5:"label";s:36:"Must change password upon next login";s:8:"onchange";s:85:"if (this.value==\'1\') document.getElementById(form::name(\'changepassword\')).value=\'1\';";s:4:"name";s:18:"mustchangepassword";s:4:"size";s:15:"Leave unchanged";}i:3;a:5:{s:4:"type";s:11:"select-bool";s:5:"label";s:19:"Can change password";s:8:"onchange";s:136:"var mustchange=document.getElementById(form::name(\'mustchangepassword\')); if (this.value==\'0\' && mustchange.value) mustchange.value=\'0\';";s:4:"name";s:14:"changepassword";s:4:"size";s:15:"Leave unchanged";}i:4;a:4:{s:4:"size";s:6:"2,,0,0";s:4:"type";s:4:"hbox";i:1;a:4:{s:5:"label";s:23:"Change password hash to";s:4:"name";s:4:"hash";s:4:"size";s:15:"Leave unchanged";s:4:"type";s:6:"select";}i:2;a:5:{s:5:"label";s:12:"Current hash";s:8:"readonly";s:4:"true";s:4:"name";s:12:"current_hash";s:4:"type";s:4:"text";s:4:"span";s:14:",leftPad5 gray";}}i:5;a:3:{s:5:"label";s:20:"Notify user by email";s:4:"name";s:6:"notify";s:4:"type";s:8:"checkbox";}i:6;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:4:{s:4:"type";s:6:"select";s:5:"label";s:12:"Mail account";s:4:"name";s:14:"mail[activate]";s:4:"size";s:15:"Leave unchanged";}i:2;a:5:{s:4:"type";s:3:"int";s:5:"label";s:10:"Quota (MB)";s:4:"name";s:11:"mail[quota]";s:4:"size";s:1:",";s:4:"help";s:20:"|empty to NOT change";}i:3;a:5:{s:5:"label";s:6:"Domain";s:4:"name";s:12:"mail[domain]";s:4:"type";s:4:"text";s:4:"help";s:43:"|change domain of email address and aliases";s:4:"size";s:39:",,/^([a-z0-9]+([._-]{1}[a-z0-9]+)+)?$/i";}}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:5;a:2:{s:1:"A";a:5:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"2";s:5:"label";s:17:"Notification mail";i:1;a:4:{s:4:"blur";s:7:"Subject";s:4:"size";s:2:"64";s:4:"name";s:7:"subject";s:4:"type";s:4:"text";}i:2;a:3:{s:4:"name";s:4:"body";s:4:"type";s:8:"textarea";s:4:"size";s:5:"15,64";}}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:22:"Available placeholders";s:4:"span";s:5:",gray";}i:2;a:5:{s:4:"type";s:4:"grid";s:4:"name";s:12:"replacements";s:4:"data";a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"name";s:13:"${row}[label]";s:4:"type";s:5:"label";}}}s:4:"cols";i:2;s:4:"rows";i:1;}}}i:6;a:2:{s:1:"A";a:3:{s:5:"label";s:5:"Start";s:4:"name";s:5:"start";s:4:"type";s:6:"button";}s:1:"B";a:3:{s:5:"label";s:12:"Download CSV";s:4:"name";s:12:"download_csv";s:4:"type";s:6:"button";}}}s:4:"cols";i:3;s:4:"rows";i:6;}}','size' => '','style' => '','modified' => '1365170063',);
$templ_data[] = array('name' => 'admin.remotes','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:3:{s:2:"h2";s:9:",!@remote";s:2:"h1";s:6:",!@msg";s:2:"h3";s:2:",1";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"remote";s:4:"span";s:10:"all,border";s:4:"name";s:18:"admin.remotes.edit";}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:26:"admin.remotes.header_right";}}i:4;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:2:"nm";s:4:"size";s:18:"admin.remotes.rows";}}}s:4:"rows";i:4;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.border { border: black solid 2px; }','modified' => '1195926693',);

View File

@ -0,0 +1,49 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="admin.acl.edit" template="" lang="" group="0" version="1.9.001">
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row part="header">
<description value="Application"/>
<menulist>
<menupopup id="acl_appname" needed="1" onchange="1" options="Select one"/>
</menulist>
</row>
<row disabled="@acl_location=run" part="header">
<description value="From" for="acl_location"/>
<menulist>
<menupopup type="select-account" id="acl_location" readonly="true"/>
</menulist>
</row>
<row part="header">
<description value="To" for="acl_account"/>
<menulist>
<menupopup type="select-account" id="acl_account" needed="1"/>
</menulist>
</row>
<row valign="top">
<description value="Rights"/>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<checkbox label="@label[$row]" id="acl[$row]" options="{$cont[right][$row]},0" span="all"/>
</row>
</rows>
</grid>
</row>
</rows>
</grid>
<hbox>
<button label="Save" id="save"/>
<button label="Cancel" id="cancel" onclick="window.close();"/>
</hbox>
</template>
</overlay>

View File

@ -20,9 +20,9 @@
<rows>
<row>
<description/>
<nextmatch-customfilter id="acl_appname" options="select-app,Application"/>
<nextmatch-accountfilter id="acl_location" options="Location"/>
<nextmatch-accountfilter id="acl_account" options="All accounts"/>
<nextmatch-customfilter id="acl_appname" options="select-app,All applications"/>
<nextmatch-accountfilter label="From" id="acl_location" options="All accounts,both"/>
<nextmatch-accountfilter label="To" id="acl_account" options="All accounts,both"/>
<nextmatch-header label="Rights" span="all"/>
</row>
<row>

View File

@ -44,7 +44,7 @@
</template>
<template id="admin.index" template="" lang="" group="0" version="1.9.001">
<tree autoloading="admin_ui::ajax_tree" id="tree" onclick="app.admin.run(widget.event_args[0],widget);" parent_node="admin_tree_target" std_images="orange-ball"/>
<html id="msg"/>
<description id="msg" class="message"/>
<split dock_side="topDock" id="splitter" orientation="h">
<nextmatch id="nm" template="admin.index.rows"/>
<iframe frameborder="1" height="500px" id="iframe" scrolling="auto" width="100%"/>