mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
replaced all while-list-each with foreach, as requested in patch [ 1015863 ] Admin does not save ACL rights and Site Configuration
This commit is contained in:
parent
d5b8419f8d
commit
45c0f356ef
@ -54,7 +54,9 @@
|
||||
$this->template->set_block('app_list','link_row');
|
||||
$this->template->set_block('app_list','spacer_row');
|
||||
|
||||
while (is_array($GLOBALS['acl_manager']) && list($app,$locations) = each($GLOBALS['acl_manager']))
|
||||
if (is_array($GLOBALS['acl_manager']))
|
||||
{
|
||||
foreach($GLOBALS['acl_manager'] as $app => $locations)
|
||||
{
|
||||
$icon = $GLOBALS['phpgw']->common->image($app,array('navbar.gif',$app.'.gif'));
|
||||
$this->template->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
|
||||
@ -72,11 +74,13 @@
|
||||
$this->template->fp('rows','app_row_noicon',True);
|
||||
}
|
||||
|
||||
while (is_array($locations) && list($loc,$value) = each($locations))
|
||||
if (is_array($locations))
|
||||
{
|
||||
foreach($locations as $loc => $value)
|
||||
{
|
||||
$link_values = array(
|
||||
'menuaction' => 'admin.uiaclmanager.access_form',
|
||||
'location' => urlencode($loc),
|
||||
'location' => $loc,
|
||||
'acl_app' => $app,
|
||||
'account_id' => $this->account_id
|
||||
);
|
||||
@ -85,9 +89,11 @@
|
||||
$this->template->set_var('lang_location',lang($value['name']));
|
||||
$this->template->fp('rows','link_row',True);
|
||||
}
|
||||
}
|
||||
|
||||
$this->template->parse('rows','spacer_row',True);
|
||||
}
|
||||
}
|
||||
$this->template->set_var(array(
|
||||
'cancel_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'),
|
||||
'lang_cancel' => lang('Cancel')
|
||||
@ -104,10 +110,13 @@
|
||||
if ($_POST['submit'])
|
||||
{
|
||||
$total_rights = 0;
|
||||
while (is_array($_POST['acl_rights']) && list(,$rights) = each($_POST['acl_rights']))
|
||||
if (is_array($_POST['acl_rights']))
|
||||
{
|
||||
foreach($_POST['acl_rights'] as $rights)
|
||||
{
|
||||
$total_rights += $rights;
|
||||
}
|
||||
}
|
||||
if ($total_rights)
|
||||
{
|
||||
$GLOBALS['phpgw']->acl->add_repository($_GET['acl_app'], $location, $this->account_id, $total_rights);
|
||||
@ -145,7 +154,7 @@
|
||||
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$link_values));
|
||||
|
||||
$total = 0;
|
||||
while (list($name,$value) = each($acl_manager['rights']))
|
||||
foreach($acl_manager['rights'] as $name => $value)
|
||||
{
|
||||
$cb .= '<input type="checkbox" name="acl_rights[]" value="'.$value.'"'.($grants & $value ? ' checked' : '').'> '.lang($name)."<br>\n";
|
||||
}
|
||||
|
@ -162,17 +162,11 @@
|
||||
|
||||
$GLOBALS['phpgw']->hooks->single('config',$appname);
|
||||
|
||||
while (list($null,$value) = each($vars))
|
||||
foreach($vars as $value)
|
||||
{
|
||||
$valarray = explode('_',$value);
|
||||
$type = $valarray[0];
|
||||
$new = $newval = '';
|
||||
|
||||
while($chunk = next($valarray))
|
||||
{
|
||||
$new[] = $chunk;
|
||||
}
|
||||
$newval = implode(' ',$new);
|
||||
$type = array_shift($valarray);
|
||||
$newval = implode(' ',$valarray);
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user