Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolved Issue ID 0000526:
  o Add default group to new user

Change default value and $conf name.


git-svn-id: http://piwigo.org/svn/trunk@1582 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Oct 29, 2006
1 parent 2433a7c commit a0e9811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/config_default.inc.php
Expand Up @@ -223,7 +223,7 @@
$conf['rate_items'] = array(0,1,2,3,4,5);

// Dafault groups to assign to new user
$conf['id_group'] = 1;
$conf['default_group_id'] = -1;

// +-----------------------------------------------------------------------+
// | metadata |
Expand Down
6 changes: 3 additions & 3 deletions include/functions_user.inc.php
Expand Up @@ -94,18 +94,18 @@ function register_user($login, $password, $mail_address)
mass_inserts(USERS_TABLE, array_keys($insert), array($insert));

// Assign by default one group
if(isset($conf['id_group']))
if(isset($conf['default_group_id']))
{
$query = '
select count(*) from '.GROUPS_TABLE.' where id = '.$conf['id_group'].';';
select count(*) from '.GROUPS_TABLE.' where id = '.$conf['default_group_id'].';';
list($exist_group) = mysql_fetch_array(pwg_query($query));

if ($exist_group == 1)
{
$insert =
array(
'user_id' => $next_id,
'group_id' => $conf['id_group']
'group_id' => $conf['default_group_id']
);

include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
Expand Down

0 comments on commit a0e9811

Please sign in to comment.