aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/config_default.inc.php3
-rw-r--r--include/functions_user.inc.php20
2 files changed, 23 insertions, 0 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index b70b24e21..657c0c0e2 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -222,6 +222,9 @@ $conf['check_upgrade_feed'] = true;
// rate_items: available rates for a picture
$conf['rate_items'] = array(0,1,2,3,4,5);
+// Dafault groups to assign to new user
+$conf['id_group'] = 1;
+
// +-----------------------------------------------------------------------+
// | metadata |
// +-----------------------------------------------------------------------+
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);
}