Changeset 12019 for trunk/admin
- Timestamp:
- Aug 31, 2011, 5:12:14 PM (13 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_perm.php
r12017 r12019 97 97 AND status = \'private\' 98 98 ;'; 99 $private_ uppercats = array_from_query($query, 'id');99 $private_cats = array_from_query($query, 'id'); 100 100 101 101 // We must not reinsert already existing lines in group_access table 102 102 $granteds = array(); 103 foreach ($private_ uppercats as $cat_id)103 foreach ($private_cats as $cat_id) 104 104 { 105 105 $granteds[$cat_id] = array(); … … 109 109 SELECT group_id, cat_id 110 110 FROM '.GROUP_ACCESS_TABLE.' 111 WHERE cat_id IN ('.implode(',', $private_ uppercats).')111 WHERE cat_id IN ('.implode(',', $private_cats).') 112 112 AND group_id IN ('.implode(',', $_POST['grant_groups']).') 113 113 ;'; … … 120 120 $inserts = array(); 121 121 122 foreach ($private_ uppercats as $cat_id)122 foreach ($private_cats as $cat_id) 123 123 { 124 124 $group_ids = array_diff($_POST['grant_groups'], $granteds[$cat_id]); -
trunk/admin/include/functions.php
r11853 r12019 2144 2144 } 2145 2145 2146 // make sure categories are private and select uppercats 2146 // make sure categories are private and select uppercats or subcats 2147 $cat_ids = (isset($_POST['apply_on_sub'])) ? implode(',', get_subcat_ids($category_ids)).",".implode(',', get_uppercat_ids($category_ids)) : implode(',', get_uppercat_ids($category_ids)); 2147 2148 $query = ' 2148 2149 SELECT 2149 2150 id 2150 2151 FROM '.CATEGORIES_TABLE.' 2151 WHERE id IN ('. implode(',', get_uppercat_ids($category_ids)).')2152 WHERE id IN ('.$cat_ids.') 2152 2153 AND status = \'private\' 2153 2154 ;'; 2154 $private_ uppercats = array_from_query($query, 'id');2155 2156 if (count($private_ uppercats) == 0)2155 $private_cats = array_from_query($query, 'id'); 2156 2157 if (count($private_cats) == 0) 2157 2158 { 2158 2159 return; … … 2161 2162 // We must not reinsert already existing lines in user_access table 2162 2163 $granteds = array(); 2163 foreach ($private_ uppercats as $cat_id)2164 foreach ($private_cats as $cat_id) 2164 2165 { 2165 2166 $granteds[$cat_id] = array(); … … 2171 2172 cat_id 2172 2173 FROM '.USER_ACCESS_TABLE.' 2173 WHERE cat_id IN ('.implode(',', $private_ uppercats).')2174 WHERE cat_id IN ('.implode(',', $private_cats).') 2174 2175 AND user_id IN ('.implode(',', $user_ids).') 2175 2176 ;'; … … 2182 2183 $inserts = array(); 2183 2184 2184 foreach ($private_ uppercats as $cat_id)2185 foreach ($private_cats as $cat_id) 2185 2186 { 2186 2187 $grant_to_users = array_diff($user_ids, $granteds[$cat_id]); -
trunk/admin/themes/default/template/cat_perm.tpl
r12018 r12019 60 60 {/foreach} 61 61 </ul> 62 <label><input type="checkbox" name="apply_on_sub">{'Apply to sub-albums'|@translate}</label> 62 63 <input class="submit" type="submit" name="grant_users_submit" value="{'Grant selected users'|@translate}"> 63 64 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.