Changeset 1581 for trunk


Ignore:
Timestamp:
Oct 29, 2006, 11:36:54 AM (18 years ago)
Author:
rub
Message:

Resolved Issue ID 0000526:

o Add default group to new user

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_default.inc.php

    r1578 r1581  
    223223$conf['rate_items'] = array(0,1,2,3,4,5);
    224224
     225// Dafault groups to assign to new user
     226$conf['id_group'] = 1;
     227
    225228// +-----------------------------------------------------------------------+
    226229// |                               metadata                                |
  • trunk/include/functions_user.inc.php

    r1568 r1581  
    9494    mass_inserts(USERS_TABLE, array_keys($insert), array($insert));
    9595
     96  // Assign by default one group
     97  if(isset($conf['id_group']))
     98  {
     99    $query = '
     100select count(*) from '.GROUPS_TABLE.' where id = '.$conf['id_group'].';';
     101    list($exist_group) = mysql_fetch_array(pwg_query($query));
     102
     103    if ($exist_group == 1)
     104    {
     105      $insert =
     106        array(
     107          'user_id' => $next_id,
     108          'group_id' => $conf['id_group']
     109          );
     110
     111      include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     112      mass_inserts(USER_GROUP_TABLE, array_keys($insert), array($insert));
     113    }
     114  }
     115
    96116    create_user_infos($next_id);
    97117  }
Note: See TracChangeset for help on using the changeset viewer.