Ignore:
Timestamp:
Oct 3, 2011, 2:18:46 PM (13 years ago)
Author:
plg
Message:

Make Community plugin compatible with the new upload form

The privacy level is set at the beginning of uploadify because Piwigo core
don't use 8 by default.

As soon as the user has created an album, he can't create another one (too
complicated to refresh the list of parent albums: this feature doesn't deserve
to make the code more complexe)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/add_photos.php

    r10756 r12333  
    3232define('PHOTOS_ADD_BASE_URL', make_index_url(array('section' => 'add_photos')));
    3333
    34 prepare_upload_configuration();
    35 
    3634$user_permissions = community_get_user_permissions($user['id']);
    3735
     
    4745$page['errors'] = array();
    4846$page['infos'] = array();
     47
     48// this is for "browser uploader", for Flash Uploader the problem is solved
     49// with function community_uploadify_privacy_level (see main.inc.php)
    4950$_POST['level'] = 16;
    5051
     
    5354  $hacking_attempt = false;
    5455 
    55   if ('existing' == $_POST['category_type'])
    56   {
    57     // is the user authorized to upload in this album?
    58     if (!in_array($_POST['category'], $user_permissions['upload_categories']))
    59     {
    60       echo 'Hacking attempt, you have no permission to upload in this album';
    61       $hacking_attempt = true;
    62     }
    63   }
    64   elseif ('new' == $_POST['category_type'])
    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     }
     56  // is the user authorized to upload in this album?
     57  if (!in_array($_POST['category'], $user_permissions['upload_categories']))
     58  {
     59    echo 'Hacking attempt, you have no permission to upload in this album';
     60    $hacking_attempt = true;
    7161  }
    7262
     
    8878  $page['infos'] = array();
    8979
    90   if (isset($conf['community_ask_for_properties']) and $conf['community_ask_for_properties'])
     80  if (isset($_POST['name']))
    9181  {
    9282    $data = array();
Note: See TracChangeset for help on using the changeset viewer.