- Timestamp:
- Aug 17, 2005, 5:25:32 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/user_perm.php
r817 r818 142 142 ); 143 143 144 145 // retrieve category ids authorized to the groups the user belongs to 146 $group_authorized = array(); 147 148 $query = ' 149 SELECT DISTINCT cat_id, c.uppercats, c.global_rank 150 FROM '.USER_GROUP_TABLE.' AS ug 151 INNER JOIN '.GROUP_ACCESS_TABLE.' AS ga 152 ON ug.group_id = ga.group_id 153 INNER JOIN '.CATEGORIES_TABLE.' AS c 154 ON c.id = ga.cat_id 155 WHERE ug.user_id = '.$page['user'].' 156 ;'; 157 $result = pwg_query($query); 158 159 if (mysql_num_rows($result) > 0) 160 { 161 $template->assign_block_vars('groups', array()); 162 163 $cats = array(); 164 while ($row = mysql_fetch_array($result)) 165 { 166 array_push($cats, $row); 167 array_push($group_authorized, $row['cat_id']); 168 } 169 usort($cats, 'global_rank_compare'); 170 171 foreach ($cats as $category) 172 { 173 $template->assign_block_vars( 174 'groups.category', 175 array( 176 'NAME' => get_cat_display_name_cache($category['uppercats'], '', false) 177 ) 178 ); 179 } 180 } 181 144 182 // only private categories are listed 145 183 $query_true = ' … … 147 185 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_ACCESS_TABLE.' ON cat_id = id 148 186 WHERE status = \'private\' 149 AND user_id = '.$page['user'].' 187 AND user_id = '.$page['user']; 188 if (count($group_authorized) > 0) 189 { 190 $query_true.= ' 191 AND cat_id NOT IN ('.implode(',', $group_authorized).')'; 192 } 193 $query_true.= ' 150 194 ;'; 151 195 display_select_cat_wrapper($query_true,array(),'category_option_true'); … … 167 211 AND id NOT IN ('.implode(',', $authorized_ids).')'; 168 212 } 213 if (count($group_authorized) > 0) 214 { 215 $query_false.= ' 216 AND id NOT IN ('.implode(',', $group_authorized).')'; 217 } 169 218 $query_false.= ' 170 219 ;'; -
trunk/doc/ChangeLog
r817 r818 1 2005-08-17 Pierrick LE GALL 2 3 * improvement : in admin/user_perm, already authorized categories 4 thanks to group associations are displayed and not taken into 5 account for user specific permissions. 6 1 7 2005-08-17 Pierrick LE GALL 2 8 -
trunk/template/default/admin/user_perm.tpl
r817 r818 1 1 <h1>{TITLE}</h1> 2 2 3 < form method="post" action="{F_ACTION}">4 {DOUBLE_SELECT} 5 </form>3 <!-- BEGIN groups --> 4 <fieldset> 5 <legend>{lang:Categories authorized thanks to group associations}</legend> 6 6 7 <p>{lang:Only private categories are listed}</p> 7 <ul> 8 <!-- BEGIN category --> 9 <li>{groups.category.NAME}</li> 10 <!-- END category --> 11 </ul> 12 </fieldset> 13 <!-- END groups --> 14 15 <fieldset> 16 <legend>{lang:Other private categories}</legend> 17 18 <form method="post" action="{F_ACTION}"> 19 {DOUBLE_SELECT} 20 </form> 21 </fieldset> -
trunk/template/default/default.css
r817 r818 598 598 margin: 5px; 599 599 } 600 601 div#adminMain>fieldset { 602 margin: 10px; 603 } 604 605 fieldset>legend { 606 font-style: italic; 607 }
Note: See TracChangeset
for help on using the changeset viewer.