aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-10-29 10:36:54 +0000
committerrub <rub@piwigo.org>2006-10-29 10:36:54 +0000
commit2433a7cb54c024e8142ad81d182440ff692e377b (patch)
tree5cf15b8eb42be78e90b53ab27904ec43f4295135 /include/functions_user.inc.php
parent2b3bc579e4dcd4bf64c712eeca86f05e2d70fbf0 (diff)
Resolved Issue ID 0000526:
o Add default group to new user git-svn-id: http://piwigo.org/svn/trunk@1581 68402e56-0260-453c-a942-63ccdbb3a9ee
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);
}