Changeset 1409


Ignore:
Timestamp:
09/14/09 17:17:05 (15 years ago)
Author:
alexandrecorreia
Message:

Ticket #644 - Correção da classe uiacl para o controle de permissão de acesso.

Location:
trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/hook_preferences.inc.php

    r1400 r1409  
    1515        $file = array( 
    1616                'Preferences'     => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname), 
    17                 'Grant Access'    => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app='.$appname), 
     17                'Grant Access'    => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), 
    1818                'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname.'&cats_level=True&global_cats=True') 
    1919        ); 
  • trunk/contactcenter/inc/hook_preferences.inc.php

    r499 r1409  
    1818        $file = Array( 
    1919                'Preferences'   => $GLOBALS['phpgw']->link('/index.php','menuaction=contactcenter.ui_preferences.index'), 
    20                 'Grant Access'  => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app='.$appname), 
     20                'Grant Access'  => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), 
    2121                //'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname . '&cats_level=True&global_cats=True') 
    2222        ); 
  • trunk/contactcenter/inc/hook_sidebox_menu.inc.php

    r531 r1409  
    2424                $menu_title = lang('Preferences'); 
    2525                $file = Array( 
    26                         'Grant Access'=>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app=contactcenter') 
     26                        'Grant Access'=>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=contactcenter') 
    2727                ); 
    2828                display_sidebox($appname,$menu_title,$file); 
  • trunk/mobile/inc/hook_preferences.inc.php

    r691 r1409  
    1818        $file = Array( 
    1919                'Preferences'   => $GLOBALS['phpgw']->link('/index.php','menuaction=mobile.ui_preferences.index'), 
    20                 //'Grant Access'  => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app='.$appname), 
     20                //'Grant Access'  => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), 
    2121                //'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname . '&cats_level=True&global_cats=True') 
    2222        ); 
  • trunk/preferences/inc/class.uiaclprefs.inc.php

    r2 r1409  
    1313        class uiaclprefs 
    1414        { 
    15                 var $acl; 
     15                var $acl;                
    1616                var $template; 
    1717 
     
    2121                { 
    2222                        $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); 
     23                         
    2324                } 
    24  
     25                 
    2526                function index() 
    2627                { 
    2728                        $acl_app        = get_var('acl_app',array('POST','GET')); 
    28                         $start          = get_var('start',array('POST','GET')); 
    29                         $query          = get_var('query',array('POST','GET')); 
    30                         $s_groups       = get_var('s_groups',array('POST','GET')); 
    31                         $s_users        = get_var('s_users',array('POST','GET')); 
    3229                        $owner          = get_var('owner',array('POST','GET')); 
    3330 
     
    4138                                $GLOBALS['phpgw']->translation->add_app($acl_app); 
    4239                        } 
    43  
     40                                                 
     41                        $_SESSION['acl_app'] = $acl_app; 
     42 
     43                         
    4444                        $GLOBALS['phpgw_info']['flags']['currentapp'] = $acl_app; 
    4545 
     
    6262                                $GLOBALS['phpgw']->common->phpgw_exit(True); 
    6363                        } 
    64  
    65                          
    66                         $this->template = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir($acl_app));                    
    67                          
    68                         // Verifica se é o template da Celepar, então carrega outro .tpl                          
    69                         //echo $this->template->root; 
    70                         if(strstr($this->template->root,'celepar')) { 
    71                                 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs2.index&acl_app='.$acl_app)); 
    72                         } 
    73                                                  
    74  
    75                         /* 
    76                         if(isset($save_my_owner) && $GLOBALS['phpgw_info']['user']['apps']['admin']) 
    77                         { 
    78                                 $owner = $save_my_owner; 
    79                                 unset($save_my_owner); 
    80                         } 
    81                         elseif(@isset($save_my_owner)) 
    82                         { 
    83                                 echo '<center>'.lang('You do not have permission to set ACL\'s in this mode!').'</center>'; 
    84                                 $GLOBALS['phpgw']->common->phpgw_footer(); 
    85                         } 
    86                         */ 
    87  
     64                         
     65                         
    8866                        if((!isset($owner) || empty($owner)) || !$GLOBALS['phpgw_info']['user']['apps']['admin']) 
    89                         { 
    9067                                $owner = $GLOBALS['phpgw_info']['user']['account_id']; 
    91                         } 
    92  
    93                         $acct                   = CreateObject('phpgwapi.accounts',$owner); 
    94                         $groups                 = $acct->get_list('groups','','ASC','account_lid'); 
    95                         $users                  = $acct->get_list('accounts','','ASC','account_firstname'); 
    96                         $owner_name             = $acct->id2name($owner);               // get owner name for title 
    97                         if($is_group    = $acct->get_type($owner) == 'g') 
    98                         { 
     68                         
     69                        $_SESSION['owner'] = $owner; 
     70                         
     71                         
     72                        $acct = CreateObject('phpgwapi.accounts',$owner);                                                                        
     73                        $owner_name = $acct->id2name($owner);           // get owner name for title 
     74                         
     75                        if($is_group = $acct->get_type($owner) == 'g')                   
    9976                                $owner_name = lang('Group').' ('.$owner_name.')'; 
    100                         } 
    101                         unset($acct); 
     77                                                 
    10278                        $this->acl = CreateObject('phpgwapi.acl',(int)$owner); 
    103                         $this->acl->read_repository(); 
    104  
    105                         if ($_POST['submit']) 
    106                         { 
     79                         
     80                        // begin jakjr 
     81                        $repository = $this->acl->read_repository(); //get all lines of the owner 
     82                        $cont = 0; 
     83                        $just_owner_array = array(); 
     84                        foreach($repository as $repository)  
     85                        {                
     86                                // Pega os valores do array que são da aplicação corrente, do dono corrente e verifica se a camplo acl_location é diferente de run, que não é necessário aqui. 
     87                                if (($repository['appname'] == $GLOBALS['phpgw_info']['flags']['currentapp']) && ($repository['account'] == $owner) && ($repository['locations'] != 'run')) 
     88                                { 
     89                                        $just_owner_array[$cont] = $repository; 
     90                                        $cont++; 
     91                                } 
     92                        } 
     93                        //echo '<pre>'; 
     94                        //print_r($just_owner_array); 
     95                        //echo '</pre>'; 
     96                        // end jakjr 
     97 
     98                        if ($_POST['submit'])   { 
    10799                                $processed = $_POST['processed']; 
     100                                                                 
    108101                                $to_remove = unserialize(urldecode($processed)); 
    109102 
    110                                 for($i=0;$i<count($to_remove);$i++) 
    111                                 { 
    112                                         $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 
    113                                 } 
    114  
     103                                /* User records */ 
     104                                $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    115105                                /* Group records */ 
    116106                                $group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    117  
    118                                 if (!$group_variable) 
    119                                 { 
     107                                $keys_to_keep = array(); 
     108                                if(!empty($user_variable)) { 
     109                                        foreach($user_variable as $key_user=>$value) { 
     110                                                $temp = explode("_",$key_user); 
     111                                                $keys_to_keep[(int)$temp[0]] = 1; 
     112                                        } 
     113                                } 
     114                                 
     115                                for($i=0;$i<count($to_remove);$i++) { 
     116                                         
     117                                        if(!array_key_exists((int)$to_remove[$i],$keys_to_keep)) { 
     118                                                $this->acl->persist_shared_groups($to_remove[$i]); 
     119                                        }                
     120                                        $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 
     121                                } 
     122                                 
     123                                /* Group records */ 
     124                                //$group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
     125 
     126                                if (!$group_variable)                            
    120127                                        $group_variable = array(); 
    121                                 } 
     128                                 
    122129                                @reset($group_variable); 
    123130                                $totalacl = array(); 
    124                                 while(list($rowinfo,$perm) = each($group_variable)) 
    125                                 { 
     131                                while(list($rowinfo,$perm) = each($group_variable))     { 
    126132                                        list($group_id,$rights) = split('_',$rowinfo); 
    127133                                        $totalacl[$group_id] += $rights; 
    128134                                } 
    129135                                @reset($totalacl); 
    130                                 while(list($group_id,$rights) = @each($totalacl)) 
    131                                 { 
     136                                while(list($group_id,$rights) = @each($totalacl))       { 
    132137                                        if($is_group) 
    133                                         { 
    134                                                 /* Don't allow group-grants to grant private */ 
    135138                                                $rights &= ~PHPGW_ACL_PRIVATE; 
    136                                         } 
    137  
     139                                        if(array_key_exists($user_id,$keys_to_keep)) 
     140                                                if(($rights & 1) == 0) { 
     141                                                        $this->acl->persist_shared_groups($user_id); 
     142                                                } 
    138143                                        $this->acl->add($GLOBALS['phpgw_info']['flags']['currentapp'],$group_id,$rights); 
    139144                                } 
    140145 
    141146                                /* User records */ 
    142                                 $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
    143  
    144                                 if (!$user_variable) 
    145                                 { 
     147                                //$user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 
     148 
     149                                if (!$user_variable)                             
    146150                                        $user_variable = array(); 
    147                                 } 
     151                                 
    148152                                @reset($user_variable); 
    149153                                $totalacl = array(); 
    150                                 while(list($rowinfo,$perm) = each($user_variable)) 
    151                                 { 
     154                                while(list($rowinfo,$perm) = each($user_variable))      { 
    152155                                        list($user_id,$rights) = split('_',$rowinfo); 
    153156                                        $totalacl[$user_id] += $rights; 
    154157                                } 
     158                                 
    155159                                @reset($totalacl); 
    156                                 while(list($user_id,$rights) = @each($totalacl)) 
    157                                 { 
    158                                         if($is_group) 
    159                                         { 
    160                                                 /* Don't allow group-grants to grant private */ 
    161                                                 $rights &= ~ PHPGW_ACL_PRIVATE; 
    162                                         } 
    163  
     160                                while(list($user_id,$rights) = @each($totalacl)) { 
     161                                        if($is_group)                                    
     162                                                $rights &= ~ PHPGW_ACL_PRIVATE;                                  
     163                                         
    164164                                        $this->acl->add($GLOBALS['phpgw_info']['flags']['currentapp'],$user_id,$rights); 
    165165                                } 
     166                                 
    166167                                $this->acl->save_repository(); 
     168                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('../'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/index.php')); 
    167169                        } 
    168170 
    169171                        $processed = Array(); 
    170  
    171                         $total = 0; 
    172  
    173                         if(!isset($start)) 
    174                         { 
    175                                 $start = 0; 
    176                         } 
    177  
    178                         if(!$start) 
    179                         { 
    180                                 $s_groups = 0; 
    181                                 $s_users = 0; 
    182                         } 
    183  
    184                         if(!isset($s_groups)) 
    185                         { 
    186                                 $s_groups = 0; 
    187                         } 
    188  
    189                         if(!isset($s_users)) 
    190                         { 
    191                                 $s_users = 0; 
    192                         } 
    193  
    194                         if(!isset($query)) 
    195                         { 
    196                                 $query = ""; 
    197                         } 
    198  
    199                         if(!isset($maxm)) 
    200                         { 
    201                                 $maxm = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; 
    202                         } 
    203  
    204                         if(!isset($totalentries)) 
    205                         { 
    206                                 $totalentries = count($groups) + count($users); 
    207                                 if($totalentries < $maxm) 
    208                                 { 
    209                                         $maxm = $totalentries; 
    210                                 } 
    211                         } 
    212  
     172                         
    213173                        $GLOBALS['phpgw_info']['flags']['app_header'] = lang('%1 - Preferences',$GLOBALS['phpgw_info']['apps'][$acl_app]['title']).' - '.lang('acl').': '.$owner_name; 
     174                         
     175                        if(!@is_object($GLOBALS['phpgw']->js))  { 
     176                                $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); 
     177                        }                        
     178                         
    214179                        $GLOBALS['phpgw']->common->phpgw_header(); 
    215180                        echo parse_navbar(); 
    216  
    217                         $this->template = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir($acl_app)); 
     181                         
     182                        $this->template = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('preferences')); 
    218183                        $templates = Array ( 
    219                                 'preferences' => 'preference_acl.tpl', 
    220                                 'row_colspan' => 'preference_colspan.tpl', 
    221                                 'acl_row'     => 'preference_acl_row.tpl' 
    222                         ); 
    223  
     184                                        'preferences' => 'preference_acl.tpl',                           
     185                                        'acl_row'     => 'preference_acl_row.tpl', 
     186                                        'acl_hidden'  => 'preference_acl_hidden.tpl' 
     187                                ); 
     188                         
    224189                        $this->template->set_file($templates); 
    225190 
     191                        $this->template->set_var("users_list", lang("Users List")); 
     192                        $this->template->set_var("attributes", lang("Attributes")); 
     193                        $this->template->set_var("read", lang("Read"));  
     194                        $this->template->set_var("add", lang("Add")); 
     195                        $this->template->set_var("edit", lang("Edit")); 
     196                        $this->template->set_var("delete", lang("Delete")); 
     197                        $this->template->set_var("private", lang("Private")); 
     198                        $this->template->set_var("remove", lang("Remove")); 
     199                        $this->template->set_var("cancel", lang("Cancel")); 
     200                         
     201                        if($acl_app=='contactcenter') { 
     202                                $this->template->set_var("add_invisible", "style='display:none'"); 
     203                                $this->template->set_var("private_invisible", "style='display:none'");                           
     204                        } 
     205                        else { 
     206                                $this->template->set_var("add_invisible", ""); 
     207                                $this->template->set_var("private_invisible", "");                               
     208                        } 
     209 
    226210                        if ($submit) 
    227                         { 
    228211                                $this->template->set_var('errors',lang('ACL grants have been updated')); 
    229                         } 
    230212 
    231213                        $common_hidden_vars = 
    232                                 '     <input type="hidden" name="s_groups" value="'.$s_groups.'">'."\n" 
    233                                 . '     <input type="hidden" name="s_users" value="'.$s_users.'">'."\n" 
    234                                 . '     <input type="hidden" name="maxm" value="'.$maxm.'">'."\n" 
    235                                 . '     <input type="hidden" name="totalentries" value="'.$totalentries.'">'."\n" 
    236                                 . '     <input type="hidden" name="start" value="'.$start.'">'."\n" 
    237                                 . '     <input type="hidden" name="query" value="'.$query.'">'."\n" 
    238                                 . '     <input type="hidden" name="owner" value="'.$owner.'">'."\n" 
     214                                  '     <input type="hidden" name="owner" value="'.$owner.'">'."\n" 
    239215                                . '     <input type="hidden" name="acl_app" value="'.$acl_app.'">'."\n"; 
    240216 
     
    244220                                'action_url'  => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=' . $acl_app), 
    245221                                'bg_color'    => $GLOBALS['phpgw_info']['theme']['th_bg'], 
    246                                 'submit_lang' => lang('Save'), 
     222                                'submit_lang' => lang('Ok'), 
    247223                                'common_hidden_vars_form' => $common_hidden_vars 
    248224                        ); 
    249225 
    250226                        $this->template->set_var($var); 
    251  
    252                         if(isset($query_result) && $query_result) 
    253                         { 
    254                                 $common_hidden_vars .= '<input type="hidden" name="query_result" value="'.$query_result.'">'."\n"; 
    255                         } 
    256  
    257227                        $this->template->set_var('common_hidden_vars',$common_hidden_vars); 
    258  
    259                         $vars = $this->template->get_undefined('row_colspan'); 
    260                         while (list(,$var) = each($vars)) 
    261                         { 
    262                                 if(strstr($var,'lang_')) 
     228                                                 
     229                        // begin jakjr 
     230                        foreach($just_owner_array as $just_owner_array) { 
     231                                $id = $just_owner_array['location']; 
     232                                $rights = $this->acl->get_rights($id,$GLOBALS['phpgw_info']['flags']['currentapp']); 
     233                                $acct->get_account_name($id, $lid, $fname, $lname); 
     234                                 
     235                                if (($acct->get_type($id) == 'u') && ($owner != $id && $rights))  
    263236                                { 
    264                                         $value = str_replace('lang_','',$var); 
    265                                         $value = str_replace('_',' ',$value); 
    266  
    267                                         $this->template->set_var($var,lang($value)); 
    268                                 } 
    269                         } 
    270  
    271                         if ((int)$s_groups <> count($groups)) 
    272                         { 
    273                                 $this->template->set_var('string',lang('Groups')); 
    274                                 $this->template->parse('row','row_colspan',True); 
    275  
    276                                 reset($groups); 
    277                                 for($k=0;$k<count($groups);$k++) 
    278                                 { 
    279                                         $group = $groups[$k]; 
    280                                         $go = True; 
    281  
    282                                         if($query) 
    283                                         { 
    284                                                 if(!strpos(' '.$group['account_lid'].' ',$query)) 
    285                                                 { 
    286                                                         $go = False; 
    287                                                 } 
    288                                         } 
    289  
    290                                         if($go) 
    291                                         { 
    292                                                 $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    293                                                 $this->display_row($tr_color,'g_',$group['account_id'],$group['account_lid'],$is_group); 
    294                                                 $s_groups++; 
    295                                                 $processed[] = $group['account_id']; 
    296                                                 $total++; 
    297                                                 if($total == $maxm) 
    298                                                 { 
    299                                                         break; 
    300                                                 } 
    301                                         } 
    302                                 } 
    303                         } 
    304  
    305                         if($total <> $maxm) 
    306                         { 
    307                                 if($users) 
    308                                 { 
    309                                         $this->template->set_var('string',ucfirst(lang('Users'))); 
    310                                         $this->template->parse('row','row_colspan',True); 
    311                                         $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    312                                         for($k=$s_users;$k<$totalentries || $k==count($users);$k++) 
    313                                         { 
    314                                                 $user = $users[$k]; 
    315                                                 //echo '<br>acctid: '.$user['account_id']; 
    316                                                 if ($user['account_id']) 
    317                                                 { 
    318                                                         $go = True; 
    319                                                 } 
    320                                                 else 
    321                                                 { 
    322                                                         $go = False; 
    323                                                 } 
    324                                                 if($query) 
    325                                                 { 
    326                                                         $name = ' '.$user['account_firstname'].' '.$user['account_lastname'].' '.$user['account_lid'].' '; 
    327                                                         if(!strpos($name,$query)) 
    328                                                         { 
    329                                                                 $go = False; 
    330                                                         } 
    331                                                 } 
    332  
    333                                                 if($go && $user['account_id'] != $owner)        // Need to be $owner not $GLOBALS['phpgw_info']['user']['account_id'] 
    334                                                 { 
    335                                                         // or the admin can't get special grants from a group 
    336                                                         $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    337                                                         $this->display_row($tr_color,'u_',$user['account_id'],$GLOBALS['phpgw']->common->display_fullname($user['account_lid'],$user['account_firstname'],$user['account_lastname']),$is_group); 
    338                                                         $s_users++; 
    339                                                         $processed[] = $user['account_id']; 
    340                                                         $total++; 
    341                                                         if($total == $maxm) 
    342                                                         { 
    343                                                                 break; 
    344                                                         } 
    345                                                 } 
    346                                         } 
    347                                 } 
    348                         } 
    349  
     237                                        $user_array['name'] = $fname . ' ' . $lname; 
     238                                        $this->display_option('u_',$id,$user_array['name'],$is_group); 
     239                                        $processed[] = $id; 
     240                                }        
     241                                //else 
     242                                //{ 
     243                        //              $group_array['name'] = '(G) ' . $fname; 
     244                        //              $this->display_option('g_',$id,$group_array['name'],$is_group); 
     245                        //              $processed[] = $id; 
     246                        //      }        
     247                        } 
     248                         
     249                        unset($acct); 
     250                        //end jakjr 
     251                         
    350252                        $extra_parms = 'menuaction=preferences.uiaclprefs.index' 
    351                                 . '&acl_app=' . $acl_app 
    352                                 . '&s_users='.$s_users.'&s_groups='.$s_groups 
    353                                 . '&maxm=' . $maxm . '&totalentries=' . $totalentries 
    354                                 . '&total=' . ($start + $total) . '&owner='.$owner; 
     253                                . '&acl_app=' . $acl_app . '&owner='.$owner; 
    355254 
    356255                        $var = Array( 
    357                                 'nml'          => $GLOBALS['phpgw']->nextmatchs->left('/index.php',$start,$totalentries,$extra_parms), 
    358                                 'nmr'          => $GLOBALS['phpgw']->nextmatchs->right('/index.php',$start,$totalentries,$extra_parms), 
    359                                 'search_value' => (isset($query) && $query?$query:''), 
    360256                                'search'       => lang('search'), 
    361257                                'processed'    => urlencode(serialize($processed)) 
     
    363259 
    364260                        $this->template->set_var($var); 
    365  
    366261                        $this->template->pfp('out','preferences'); 
    367262                } 
    368263 
    369                 function check_acl($label,$id,$acl,$rights,$right,$is_group=False) 
     264                 
     265                function check_acl($label,$id,$acl,$rights,$right,$is_group=False)      { 
     266                        $this->template->set_var($acl,$label.$GLOBALS['phpgw_info']['flags']['currentapp'].'['.$id.'_'.$right.']'); 
     267                        $rights_set = (($rights & $right)?'':'disabled'); 
     268                        $this->template->set_var($acl.'_selected',$rights_set); 
     269                }                
     270                 
     271         
     272                function display_option($label,$id,$name,$is_group) 
    370273                { 
    371                         $this->template->set_var($acl,$label.$GLOBALS['phpgw_info']['flags']['currentapp'].'['.$id.'_'.$right.']'); 
    372                         $rights_set = (($rights & $right)?' checked':''); 
    373                         if ($is_group) 
    374                         { 
    375                                 // This is so you can't select it in the GUI 
    376                                 $rights_set .= ' disabled'; 
    377                         } 
    378                         $this->template->set_var($acl.'_selected',$rights_set); 
    379                 } 
    380  
    381                 function display_row($bg_color,$label,$id,$name,$is_group) 
    382                 { 
    383                         $this->template->set_var('row_color',$bg_color); 
     274                         
     275                        $rights = $this->acl->get_rights($id,$GLOBALS['phpgw_info']['flags']['currentapp']); 
    384276                        $this->template->set_var('user',$name); 
    385                         $rights = $this->acl->get_rights($id,$GLOBALS['phpgw_info']['flags']['currentapp']); 
     277                        $this->template->set_var('id',$label.$GLOBALS['phpgw_info']['flags']['currentapp'].'['.$id);                                             
     278                                                 
     279                         
    386280                        // vv This is new 
    387281                        $grantors = $this->acl->get_ids_for_location($id,$rights,$GLOBALS['phpgw_info']['flags']['currentapp']); 
    388                         $is_group_set = False; 
     282                         
    389283                        while(@$grantors && list($key,$grantor) = each($grantors)) 
    390284                        { 
     
    393287                                        $is_group_set = True; 
    394288                                } 
    395                         } 
    396                         // ^^ This is new 
    397  
     289                        }                        
     290 
     291                                                 
    398292                        $this->check_acl($label,$id,'read',$rights,PHPGW_ACL_READ,($is_group_set && ($rights & PHPGW_ACL_READ) && !$is_group?$is_group_set:False)); 
    399293                        $this->check_acl($label,$id,'add',$rights,PHPGW_ACL_ADD,($is_group_set && ($rights & PHPGW_ACL_ADD && !$is_group)?$is_group_set:False)); 
     
    405299                        $this->check_acl($label,$id,'custom_2',$rights,PHPGW_ACL_CUSTOM_2,($is_group_set && ($rights & PHPGW_ACL_CUSTOM_2) && !$is_group?$is_group_set:False)); 
    406300                        $this->check_acl($label,$id,'custom_3',$rights,PHPGW_ACL_CUSTOM_3,($is_group_set && ($rights & PHPGW_ACL_CUSTOM_3) && !$is_group?$is_group_set:False)); 
    407                         $this->template->parse('row','acl_row',True); 
     301                         
     302                         
     303                        $this->template->parse('hiddens','acl_hidden',True);                     
     304                        $this->template->parse('row','acl_row',True);    
     305                         
    408306                } 
    409         } 
     307                                         
     308        }        
    410309?> 
Note: See TracChangeset for help on using the changeset viewer.