Changeset 23272 for trunk/admin/include


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

File:
1 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']))));
Note: See TracChangeset for help on using the changeset viewer.