From dde10d310a19b5b3ccae7d2f5420db5a7e438d13 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sat, 30 Jun 2001 14:55:46 +0000 Subject: [PATCH] Fixes proposed by ralfbecker on the ACL. --- phpgwapi/inc/class.acl.inc.php | 8 +++++++- preferences/acl_preferences.php | 8 +++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index 86e2aa8ee9..59680df623 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -579,7 +579,11 @@ $db2->query($sql . $security ,__LINE__,__FILE__); $rights = 0; $accounts = Array(); - if ($db2->num_rows() == 0){ return False; } + if ($db2->num_rows() == 0) + { + $grants[$phpgw_info['user']['account_id']] = (~ 0); + return $grants; + } while ($db2->next_record()) { $grantor = $db2->f('acl_account'); @@ -619,7 +623,9 @@ } $grants[$grantors] |= $rights; } + reset($accounts[$grantor]); } + $grants[$phpgw_info['user']['account_id']] = (~ 0); return $grants; } } //end of acl class diff --git a/preferences/acl_preferences.php b/preferences/acl_preferences.php index 129892a072..aa0985dd7d 100644 --- a/preferences/acl_preferences.php +++ b/preferences/acl_preferences.php @@ -43,15 +43,13 @@ global $phpgw_info, $p; $p->set_var($acl,$label.$phpgw_info['flags']['currentapp'].'['.$id.']['.$right.']'); + $rights_set = (($rights & $right)?' checked':''); if ($is_group) { // This is so you can't select it in the GUI - $p->set_var($acl.'_selected',' disabled'); - } - else - { - $p->set_var($acl.'_selected',(($rights & $right)?' checked':'')); + $rights_set .= ' disabled'; } + $p->set_var($acl.'_selected',$rights_set); } function display_row($bg_color,$label,$id,$name,$is_group)