Changeset 12019 for trunk/admin/include/functions.php
- Timestamp:
- Aug 31, 2011, 5:12:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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]);
Note: See TracChangeset
for help on using the changeset viewer.