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.php13
-rw-r--r--include/user.inc.php21
3 files changed, 33 insertions, 8 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 7e843488b..626d5e91a 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -163,11 +163,4 @@ while ( $row =mysql_fetch_array( $result ) )
}
include(PHPWG_ROOT_PATH.'include/user.inc.php');
-
-// displaying the username in the language of the connected user, instead of
-// "guest" as you can find in the database
-if ($user['is_the_guest'])
-{
- $user['username'] = $lang['guest'];
-}
?>
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 97087827f..f8b47083b 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -158,7 +158,7 @@ function update_user( $user_id, $mail_address, $status,
function check_login_authorization($guest_allowed = true)
{
- global $user,$lang;
+ global $user,$lang,$conf,$template;
if ($user['is_the_guest'] and !$guest_allowed)
{
@@ -166,6 +166,17 @@ function check_login_authorization($guest_allowed = true)
echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
exit();
}
+
+ if ($conf['gallery_locked'])
+ {
+ echo '<div style="text-align:center;">';
+ echo $lang['gallery_locked_message'];
+ echo '</div>';
+ if ($user['status'] != 'admin')
+ {
+ exit();
+ }
+ }
}
function setup_style($style)
diff --git a/include/user.inc.php b/include/user.inc.php
index c4dc68987..468eca3f0 100644
--- a/include/user.inc.php
+++ b/include/user.inc.php
@@ -105,6 +105,20 @@ foreach ($row as $key => $value)
}
}
+// properties of user guest are found in the configuration
+if ($user['is_the_guest'])
+{
+ $user['template'] = $conf['default_template'];
+ $user['nb_image_line'] = $conf['nb_image_line'];
+ $user['nb_line_page'] = $conf['nb_line_page'];
+ $user['language'] = $conf['default_language'];
+ $user['maxwidth'] = $conf['default_maxwidth'];
+ $user['maxheight'] = $conf['default_maxheight'];
+ $user['recent_period'] = $conf['recent_period'];
+ $user['expand'] = $conf['auto_expand'];
+ $user['show_nb_comments'] = $conf['show_nb_comments'];
+}
+
// if no information were found about user in user_forbidden table OR the
// forbidden categories must be updated
if (!isset($user['need_update'])
@@ -138,6 +152,13 @@ if (empty($user['language'])
}
include_once(PHPWG_ROOT_PATH.'language/'.$user['language'].'/common.lang.php');
+// displaying the username in the language of the connected user, instead of
+// "guest" as you can find in the database
+if ($user['is_the_guest'])
+{
+ $user['username'] = $lang['guest'];
+}
+
// only if we are in the administration section
if (defined('IN_ADMIN') and IN_ADMIN)
{