aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.inc.php7
-rw-r--r--include/functions_user.inc.php6
2 files changed, 13 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index db94ed740..cba46b781 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -187,6 +187,13 @@ else
$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme'] );
}
+if (isset($user['internal_status']['guest_must_be_guest'])
+ and
+ $user['internal_status']['guest_must_be_guest'] === true)
+{
+ $header_msgs[] = l10n('guest_must_be_guest');
+}
+
if ($conf['gallery_locked'])
{
$header_msgs[] = $lang['gallery_locked_message'];
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 564b4b2c7..40a8e7280 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -150,6 +150,12 @@ function build_user( $user_id, $use_cache )
$user['is_the_guest'] = ($user['id'] == $conf['guest_id']);
$user['is_the_default'] = ($user['id'] == $conf['default_user_id']);
+ if ($user['is_the_guest'] and $user['status'] <> 'guest')
+ {
+ $user['status'] = 'guest';
+ $user['internal_status']['guest_must_be_guest'] = true;
+ }
+
// calculation of the number of picture to display per page
$user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];