aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_user.inc.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index dac173f3e..6db576609 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -93,6 +93,26 @@ SELECT MAX('.$conf['user_fields']['id'].') + 1
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
mass_inserts(USERS_TABLE, array_keys($insert), array($insert));
+ // Assign by default one group
+ if(isset($conf['id_group']))
+ {
+ $query = '
+select count(*) from '.GROUPS_TABLE.' where id = '.$conf['id_group'].';';
+ list($exist_group) = mysql_fetch_array(pwg_query($query));
+
+ if ($exist_group == 1)
+ {
+ $insert =
+ array(
+ 'user_id' => $next_id,
+ 'group_id' => $conf['id_group']
+ );
+
+ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+ mass_inserts(USER_GROUP_TABLE, array_keys($insert), array($insert));
+ }
+ }
+
create_user_infos($next_id);
}