Index: trunk/admin/configuration.php
===================================================================
--- trunk/admin/configuration.php	(revision 652)
+++ trunk/admin/configuration.php	(revision 653)
@@ -167,4 +167,6 @@
     $notif_yes = ($conf['mail_notification']=='true')?'checked="checked"':'';
     $notif_no = ($conf['mail_notification']=='false')?'checked="checked"':'';
+    $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
+    $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
     
     $template->assign_block_vars(
@@ -180,4 +182,6 @@
         'L_CONF_NOTIFICATION'=>$lang['conf_notification'],
         'L_CONF_NOTIFICATION_INFO'=>$lang['conf_notification_info'],
+        'L_CONF_GALLERY_LOCKED'=>$lang['conf_gallery_locked'],
+        'L_CONF_GALLERY_LOCKED_INFO'=>$lang['conf_gallery_locked_info'],
           
         'ADMIN_MAIL'=>$conf['mail_webmaster'],
@@ -186,5 +190,7 @@
         'HISTORY_NO'=>$history_no,
         'NOTIFICATION_YES'=>$notif_yes,
-        'NOTIFICATION_NO'=>$notif_no
+        'NOTIFICATION_NO'=>$notif_no,
+        'GALLERY_LOCKED_YES'=>$lock_yes,
+        'GALLERY_LOCKED_NO'=>$lock_no,
         ));
     break;
Index: trunk/include/common.inc.php
===================================================================
--- trunk/include/common.inc.php	(revision 652)
+++ trunk/include/common.inc.php	(revision 653)
@@ -164,10 +164,3 @@
 
 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'];
-}
 ?>
Index: trunk/include/functions_user.inc.php
===================================================================
--- trunk/include/functions_user.inc.php	(revision 652)
+++ trunk/include/functions_user.inc.php	(revision 653)
@@ -159,5 +159,5 @@
 function check_login_authorization($guest_allowed = true)
 {
-  global $user,$lang;
+  global $user,$lang,$conf,$template;
 
   if ($user['is_the_guest'] and !$guest_allowed)
@@ -166,4 +166,15 @@
     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();
+    }
   }
 }
Index: trunk/include/user.inc.php
===================================================================
--- trunk/include/user.inc.php	(revision 652)
+++ trunk/include/user.inc.php	(revision 653)
@@ -106,4 +106,18 @@
 }
 
+// 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
@@ -139,4 +153,11 @@
 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)
Index: trunk/install/config.sql
===================================================================
--- trunk/install/config.sql	(revision 652)
+++ trunk/install/config.sql	(revision 653)
@@ -27,2 +27,3 @@
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_exif','true','Show EXIF metadata on picture.php if asked by user');
 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('authorize_remembering','true','Authorize users to be remembered, see $conf{remember_me_length}');
+INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
Index: trunk/language/en_UK.iso-8859-1/admin.lang.php
===================================================================
--- trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 652)
+++ trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 653)
@@ -154,4 +154,6 @@
 $lang['conf_notification'] = 'Mail notification';
 $lang['conf_notification_info'] = 'Automated mail notification for adminsitrators (and only for them) when a user add a comment or upload a picture.';
+$lang['conf_gallery_locked'] = 'Lock gallery';
+$lang['conf_gallery_locked_info'] = 'Lock the entire gallery for maintenance. Only administrator users will be able to reach the gallery';
 
 // Configuration -> comments
@@ -345,7 +347,3 @@
 $lang['cat_unknown_id'] = 'This category is unknown in the database';
 $lang['install_warning'] = 'The file "install.php" is still present. Please remove it from your server. It is not secure to keep it.';
-
-
-
-
 ?>
Index: trunk/language/en_UK.iso-8859-1/common.lang.php
===================================================================
--- trunk/language/en_UK.iso-8859-1/common.lang.php	(revision 652)
+++ trunk/language/en_UK.iso-8859-1/common.lang.php	(revision 653)
@@ -316,3 +316,5 @@
 $lang['random_cat_hint'] = 'Displays a set of random pictures';
 $lang['picture_high'] = 'Click on the picture to see it in high definition';
+
+$lang['gallery_locked_message'] = 'The gallery is locked for maintenance. Please, come back later or loggin as an administrator to enter the gallery : <a href="'.PHPWG_ROOT_PATH.'identification.php">Identification</a>';
 ?>
Index: trunk/template/default/admin/configuration.tpl
===================================================================
--- trunk/template/default/admin/configuration.tpl	(revision 652)
+++ trunk/template/default/admin/configuration.tpl	(revision 653)
@@ -38,4 +38,9 @@
 	<input type="radio" class="radio" name="mail_notification" value="false" {general.NOTIFICATION_NO} />{L_NO}</td>
   </tr>
+  <tr>
+    <td><strong>{general.L_CONF_GALLERY_LOCKED}&nbsp;:</strong><br /><span class="small">{general.L_CONF_GALLERY_LOCKED_INFO}</span></td>
+        <td class="row1"><input type="radio" class="radio" name="gallery_locked" value="true" {general.GALLERY_LOCKED_YES} />{L_YES}&nbsp;&nbsp;
+        <input type="radio" class="radio" name="gallery_locked" value="false" {general.GALLERY_LOCKED_NO} />{L_NO}</td>
+  </tr>
 <!-- END general -->
 <!-- BEGIN comments -->
