Changeset 23272


Ignore:
Timestamp:
Jun 16, 2013, 9:52:51 PM (11 years ago)
Author:
flop25
Message:

bug:2855
new otpion "inherit" for create_virtual_category(), and $confinheritance_by_default = false;
ToDo: album registred from Ftp

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r21817 r23272  
    13041304  update_global_rank();
    13051305
    1306   if ('private' == $insert['status'])
     1306  if ('private' == $insert['status'] and ((isset($options['inherit']) and $options['inherit']) or $conf['inheritance_by_default']) )
     1307  {
     1308    $query = '
     1309      SELECT group_id
     1310      FROM '.GROUP_ACCESS_TABLE.'
     1311      WHERE cat_id = '.$insert['id_uppercat'].'
     1312    ;';
     1313    $granted_grps =  array_from_query($query, 'group_id');
     1314    $inserts = array();
     1315    foreach ($granted_grps as $granted_grp)
     1316    {
     1317      array_push(
     1318        $inserts,
     1319        array(
     1320          'group_id' => $granted_grp,
     1321          'cat_id' => $inserted_id
     1322          )
     1323        );
     1324    }
     1325    mass_inserts(GROUP_ACCESS_TABLE, array('group_id','cat_id'), $inserts);
     1326
     1327    $query = '
     1328      SELECT user_id
     1329      FROM '.USER_ACCESS_TABLE.'
     1330      WHERE cat_id = '.$insert['id_uppercat'].'
     1331    ;';
     1332    $granted_users =  array_from_query($query, 'user_id');
     1333    add_permission_on_category($inserted_id, array_unique(array_merge(get_admins(), array($user['id']), $granted_users)));
     1334  }
     1335  else if ('private' == $insert['status'])
    13071336  {
    13081337    add_permission_on_category($inserted_id, array_unique(array_merge(get_admins(), array($user['id']))));
  • trunk/include/config_default.inc.php

    r22661 r23272  
    787787//TODO: Put this in admin and also manage .htaccess in #sites and upload folders
    788788$conf['original_url_protection'] = '';
     789
     790
     791// Default behaviour when a new album is created: should the new album inherit the group/user
     792// permissions from its parent? Note that config is only used for Ftp synchro,
     793// and if that option is not explicitly transmit when the album is created.
     794$conf['inheritance_by_default'] = false;
     795
    789796?>
Note: See TracChangeset for help on using the changeset viewer.