Changeset 9563


Ignore:
Timestamp:
Mar 7, 2011, 3:49:55 PM (9 years ago)
Author:
plg
Message:

bug fixed: do not display the upload link in the menubar if you can create top level albums or if there is no albums for upload

Location:
extensions/community
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/add_photos.php

    r9504 r9563  
    3636$user_permissions = community_get_user_permissions($user['id']);
    3737
     38if (count($user_permissions['upload_categories']) == 0 and !$user_permissions ['create_whole_gallery'])
     39{
     40  redirect(make_index_url());
     41}
     42
    3843// +-----------------------------------------------------------------------+
    3944// |                             process form                              |
     
    246251
    247252// we have to change the list of uploadable albums
     253$upload_categories = $user_permissions['upload_categories'];
     254if (count($upload_categories) == 0)
     255{
     256  $upload_categories = array(-1);
     257}
     258
    248259$query = '
    249260SELECT id,name,uppercats,global_rank
    250261  FROM '.CATEGORIES_TABLE.'
    251   WHERE id IN ('.implode(',', $user_permissions['upload_categories']).')
     262  WHERE id IN ('.implode(',', $upload_categories).')
    252263;';
    253264
     
    259270
    260271$create_subcategories = false;
     272
     273if ($user_permissions['create_whole_gallery'])
     274{
     275  $create_subcategories = true;
     276}
    261277
    262278if (count($user_permissions['create_categories']) > 0)
  • extensions/community/main.inc.php

    r9537 r9563  
    128128  $user_permissions = community_get_user_permissions($user['id']);
    129129 
    130   if (!$user_permissions['upload_whole_gallery'] and count($user_permissions['upload_categories']) == 0)
     130  if (count($user_permissions['upload_categories']) == 0 and !$user_permissions ['create_whole_gallery'])
    131131  {
    132132    return;
Note: See TracChangeset for help on using the changeset viewer.