Changeset 9444 for extensions/community/main.inc.php
- Timestamp:
- Mar 1, 2011, 11:09:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/main.inc.php
r9372 r9444 20 20 define('COMMUNITY_PERMISSIONS_TABLE', $prefixeTable.'community_permissions'); 21 21 define('COMMUNITY_PENDINGS_TABLE', $prefixeTable.'community_pendings'); 22 23 include_once(COMMUNITY_PATH.'include/functions_community.inc.php'); 22 24 23 25 /* Plugin admin */ … … 66 68 // conditional : depending on community permissions, display the "Add 67 69 // photos" link in the gallery menu 70 $user_permissions = community_get_user_permissions($user['id']); 68 71 69 // admins are not concerned about community permissions 70 if (!is_admin()) 72 if (!$user_permissions['upload_whole_gallery'] and count($user_permissions['upload_categories']) == 0) 71 73 { 72 // what are the user groups? 73 $query = ' 74 SELECT 75 group_id 76 FROM '.USER_GROUP_TABLE.' 77 WHERE user_id = '.$user['id'].' 78 ;'; 79 $user_group_ids = array_from_query($query, 'group_id'); 80 81 $query = ' 82 SELECT 83 COUNT(*) 84 FROM '.COMMUNITY_PERMISSIONS_TABLE.' 85 WHERE (type = \'any_visitor\')'; 86 87 if ($user['id'] != $conf['guest_id']) 88 { 89 $query.= ' 90 OR (type = \'any_registered_user\') 91 OR (type = \'user\' AND user_id = '.$user['id'].') 92 OR (type = \'group\' AND group_id IN ('.implode(',', $user_group_ids).')) 93 '; 94 } 95 96 $query.= ' 97 ;'; 98 99 list($counter) = pwg_db_fetch_row(pwg_query($query)); 100 if (0 == $counter) 101 { 102 return; 103 } 74 return; 104 75 } 105 76
Note: See TracChangeset
for help on using the changeset viewer.