Ignore:
Timestamp:
Jun 7, 2013, 2:41:14 PM (11 years ago)
Author:
plg
Message:

New feature: user album. Only for registered users, no recursivity. Piwigo
will automatically create an upload album for each user with appropriate
community permissions, at first connection.

Bug fixed: on activation, do not create a new "Community" album if it already
exists.

Bug fixed: remove debug for quota

Bug fixed: round corners for number of pending pictures in admin menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/main.inc.php

    r23037 r23085  
    3838function community_init()
    3939{
    40   global $conf, $pwg_loaded_plugins;
     40  global $conf, $user, $pwg_loaded_plugins;
    4141
    4242  // apply upgrade if needed
     
    6363    }
    6464  }
     65
     66  // prepare plugin configuration
     67  $conf['community'] = unserialize($conf['community']);
     68
     69  // TODO: generate permissions in $user['community_permissions'] if ws.php
     70  // + remove all calls of community_get_user_permissions related to webservices
     71  if (!defined('IN_ADMIN') or !IN_ADMIN)
     72  {
     73    $user['community_permissions'] = community_get_user_permissions($user['id']);
     74  }
    6575}
    6676
     
    8898    $style.= '-moz-border-radius:10px;';
    8999    $style.= '-webkit-border-radius:10px;';
    90     $style.= '-border-radius:10px;';
     100    $style.= 'border-radius:10px;';
    91101    $style.= 'margin-left:5px;';
    92102   
     
    169179  // conditional : depending on community permissions, display the "Add
    170180  // photos" link in the gallery menu
    171   $user_permissions = community_get_user_permissions($user['id']);
    172 
    173   if (count($user_permissions['upload_categories']) == 0 and !$user_permissions ['create_whole_gallery'])
     181  $user_permissions = $user['community_permissions'];
     182
     183  if (!$user_permissions['community_enabled'])
    174184  {
    175185    return;
Note: See TracChangeset for help on using the changeset viewer.