diff options
author | rub <rub@piwigo.org> | 2006-03-08 23:14:53 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2006-03-08 23:14:53 +0000 |
commit | b263f0c996eac52afc222b99fb1e9bcb6b064d65 (patch) | |
tree | 2cb3716ad84764801710483ab7538589c177a6a6 /include/functions_user.inc.php | |
parent | cba56c06ede13f30483ca587f0c79cb0e4d82aaa (diff) |
Step 1 improvement issue 0000301:
o Change status of table #_user_infos
o Don't send password to webmaster, guest, generic
Next Step:
o Functions Check of status
o Restricted Access for user generic
git-svn-id: http://piwigo.org/svn/trunk@1070 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r-- | include/functions_user.inc.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index af695718a..64b12dfab 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -292,7 +292,7 @@ SELECT id } // if user is not an admin, locked categories can be considered as private$ - if ($user_status != 'admin') + if (!is_admin()) { $query = ' SELECT id @@ -439,7 +439,7 @@ function create_user_infos($user_id) $insert = array( 'user_id' => $user_id, - 'status' => $user_id == $conf['webmaster_id'] ? 'admin' : 'guest', + 'status' => $user_id == $conf['webmaster_id'] ? 'admin' : 'normal', 'template' => $conf['default_template'], 'nb_image_line' => $conf['nb_image_line'], 'nb_line_page' => $conf['nb_line_page'], @@ -536,4 +536,15 @@ function log_user($user_id, $remember_me) $_SESSION['id'] = $user_id; } +/* + * Return if current is an administrator + * @return bool +*/ +function is_admin() +{ + global $user; + + return ($user['status'] == 'webmaster' or $user['status'] == 'admin') ? true : false; +} + ?>
\ No newline at end of file |