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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.