aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-03-28 22:30:04 +0000
committerrub <rub@piwigo.org>2007-03-28 22:30:04 +0000
commit69b26ddc47829d3876fbf786ad1c4e5b33f05b76 (patch)
treec187aba3cfcdddb984254b4f9f8fc1a41af1a4a5 /include/functions_user.inc.php
parent60903d8c88c976ff4886fd72a7e5e37f7c7a79b8 (diff)
Issue 578
User guest must be real user Step 2: Installation finished, guest must be used on list and group, corrections git-svn-id: http://piwigo.org/svn/trunk@1930 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_user.inc.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 635055f1a..0bae2a0d7 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -726,6 +726,13 @@ function get_default_user_info($convert_str = true)
$result = pwg_query($query);
$page['cache_default_user'] = mysql_fetch_assoc($result);
+
+ if ($page['cache_default_user'] !== false)
+ {
+ unset($page['cache_default_user']['user_id']);
+ unset($page['cache_default_user']['status']);
+ unset($page['cache_default_user']['registration_date']);
+ }
}
if (is_array($page['cache_default_user']) and $convert_str)
@@ -793,8 +800,9 @@ function get_default_language()
* add user informations based on default values
*
* @param int user_id / array of user_if
+ * @param array of values used to override default user values
*/
-function create_user_infos($arg_id)
+function create_user_infos($arg_id, $override_values = null)
{
global $conf;
@@ -822,7 +830,12 @@ function create_user_infos($arg_id)
// Default on structure are used
$default_user = array();
}
-
+
+ if (!is_null($override_values))
+ {
+ $default_user = array_merge($default_user, $override_values);
+ print_r($default_user);
+ }
foreach ($user_ids as $user_id)
{
@@ -840,12 +853,13 @@ function create_user_infos($arg_id)
$status = 'normal';
}
- $insert =
+ $insert = array_merge(
+ $default_user,
array(
'user_id' => $user_id,
'status' => $status,
'registration_date' => $dbnow
- );
+ ));
array_push($inserts, $insert);
}