Changeset 9500 for extensions/community/add_photos.php
- Timestamp:
- Mar 3, 2011, 10:12:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/add_photos.php
r9450 r9500 51 51 { 52 52 // is the user authorized to upload in this album? 53 if (!$user_permissions['upload_whole_gallery']) 54 { 55 if (!in_array($_POST['category'], $user_permissions['upload_categories'])) 56 { 57 echo 'Hacking attempt, you have no permission to upload in this album'; 58 $hacking_attempt = true; 59 } 53 if (!in_array($_POST['category'], $user_permissions['upload_categories'])) 54 { 55 echo 'Hacking attempt, you have no permission to upload in this album'; 56 $hacking_attempt = true; 60 57 } 61 58 } 62 59 elseif ('new' == $_POST['category_type']) 63 60 { 64 if (!$user_permissions['create_whole_gallery']) 65 { 66 if (!in_array($_POST['category_parent'], $user_permissions['create_categories'])) 67 { 68 echo 'Hacking attempt, you have no permission to create this album'; 69 $hacking_attempt = true; 70 } 61 if (!in_array($_POST['category_parent'], $user_permissions['create_categories'])) 62 { 63 echo 'Hacking attempt, you have no permission to create this album'; 64 $hacking_attempt = true; 71 65 } 72 66 } … … 291 285 include_once(PHPWG_ROOT_PATH.'admin/include/photos_add_direct_prepare.inc.php'); 292 286 293 if (!$user_permissions['upload_whole_gallery']) 294 { 295 // we have to change the list of uploadable albums 296 $query = ' 287 // we have to change the list of uploadable albums 288 $query = ' 297 289 SELECT id,name,uppercats,global_rank 298 290 FROM '.CATEGORIES_TABLE.' … … 300 292 ;'; 301 293 302 display_select_cat_wrapper( 303 $query, 304 $selected_category, 305 'category_options' 306 ); 307 } 294 display_select_cat_wrapper( 295 $query, 296 $selected_category, 297 'category_options' 298 ); 308 299 309 300 $create_subcategories = false; 310 301 311 if ( $user_permissions['create_whole_gallery'] orcount($user_permissions['create_categories']) > 0)302 if (count($user_permissions['create_categories']) > 0) 312 303 { 313 304 $create_subcategories = true; … … 316 307 $query = ' 317 308 SELECT id,name,uppercats,global_rank 318 FROM '.CATEGORIES_TABLE; 319 320 if (!$user_permissions['create_whole_gallery']) 321 { 322 $query.= ' 323 WHERE id IN ('.implode(',', $user_permissions['create_categories']).')'; 324 } 325 326 $query.= ' 309 FROM '.CATEGORIES_TABLE.' 310 WHERE id IN ('.implode(',', $user_permissions['create_categories']).') 327 311 ;'; 328 312 … … 358 342 $title = l10n('Upload Photos'); 359 343 $page['body_id'] = 'theUploadPage'; 360 // include(PHPWG_ROOT_PATH.'include/page_header.php');361 // $template->pparse('add_photos');362 // include(PHPWG_ROOT_PATH.'include/page_tail.php');363 344 364 345 $template->assign_var_from_handle('PLUGIN_INDEX_CONTENT_BEGIN', 'add_photos');
Note: See TracChangeset
for help on using the changeset viewer.