Changeset 653


Ignore:
Timestamp:
Dec 21, 2004, 12:54:59 AM (19 years ago)
Author:
plg
Message:
  • new feature : lock temporary your gallery for maintenance
  • $user keys for guest user are initialized with default values of $conf
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r651 r653  
    167167    $notif_yes = ($conf['mail_notification']=='true')?'checked="checked"':'';
    168168    $notif_no = ($conf['mail_notification']=='false')?'checked="checked"':'';
     169    $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
     170    $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
    169171   
    170172    $template->assign_block_vars(
     
    180182        'L_CONF_NOTIFICATION'=>$lang['conf_notification'],
    181183        'L_CONF_NOTIFICATION_INFO'=>$lang['conf_notification_info'],
     184        'L_CONF_GALLERY_LOCKED'=>$lang['conf_gallery_locked'],
     185        'L_CONF_GALLERY_LOCKED_INFO'=>$lang['conf_gallery_locked_info'],
    182186         
    183187        'ADMIN_MAIL'=>$conf['mail_webmaster'],
     
    186190        'HISTORY_NO'=>$history_no,
    187191        'NOTIFICATION_YES'=>$notif_yes,
    188         'NOTIFICATION_NO'=>$notif_no
     192        'NOTIFICATION_NO'=>$notif_no,
     193        'GALLERY_LOCKED_YES'=>$lock_yes,
     194        'GALLERY_LOCKED_NO'=>$lock_no,
    189195        ));
    190196    break;
  • trunk/include/common.inc.php

    r650 r653  
    164164
    165165include(PHPWG_ROOT_PATH.'include/user.inc.php');
    166 
    167 // displaying the username in the language of the connected user, instead of
    168 // "guest" as you can find in the database
    169 if ($user['is_the_guest'])
    170 {
    171   $user['username'] = $lang['guest'];
    172 }
    173166?>
  • trunk/include/functions_user.inc.php

    r651 r653  
    159159function check_login_authorization($guest_allowed = true)
    160160{
    161   global $user,$lang;
     161  global $user,$lang,$conf,$template;
    162162
    163163  if ($user['is_the_guest'] and !$guest_allowed)
     
    166166    echo '<a href="./identification.php">'.$lang['ident_title'].'</a></div>';
    167167    exit();
     168  }
     169
     170  if ($conf['gallery_locked'])
     171  {
     172    echo '<div style="text-align:center;">';
     173    echo $lang['gallery_locked_message'];
     174    echo '</div>';
     175    if ($user['status'] != 'admin')
     176    {
     177      exit();
     178    }
    168179  }
    169180}
  • trunk/include/user.inc.php

    r650 r653  
    106106}
    107107
     108// properties of user guest are found in the configuration
     109if ($user['is_the_guest'])
     110{
     111  $user['template'] = $conf['default_template'];
     112  $user['nb_image_line'] = $conf['nb_image_line'];
     113  $user['nb_line_page'] = $conf['nb_line_page'];
     114  $user['language'] = $conf['default_language'];
     115  $user['maxwidth'] = $conf['default_maxwidth'];
     116  $user['maxheight'] = $conf['default_maxheight'];
     117  $user['recent_period'] = $conf['recent_period'];
     118  $user['expand'] = $conf['auto_expand'];
     119  $user['show_nb_comments'] = $conf['show_nb_comments'];
     120}
     121
    108122// if no information were found about user in user_forbidden table OR the
    109123// forbidden categories must be updated
     
    139153include_once(PHPWG_ROOT_PATH.'language/'.$user['language'].'/common.lang.php');
    140154
     155// displaying the username in the language of the connected user, instead of
     156// "guest" as you can find in the database
     157if ($user['is_the_guest'])
     158{
     159  $user['username'] = $lang['guest'];
     160}
     161
    141162// only if we are in the administration section
    142163if (defined('IN_ADMIN') and IN_ADMIN)
  • trunk/install/config.sql

    r651 r653  
    2727INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_exif','true','Show EXIF metadata on picture.php if asked by user');
    2828INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('authorize_remembering','true','Authorize users to be remembered, see $conf{remember_me_length}');
     29INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r651 r653  
    154154$lang['conf_notification'] = 'Mail notification';
    155155$lang['conf_notification_info'] = 'Automated mail notification for adminsitrators (and only for them) when a user add a comment or upload a picture.';
     156$lang['conf_gallery_locked'] = 'Lock gallery';
     157$lang['conf_gallery_locked_info'] = 'Lock the entire gallery for maintenance. Only administrator users will be able to reach the gallery';
    156158
    157159// Configuration -> comments
     
    345347$lang['cat_unknown_id'] = 'This category is unknown in the database';
    346348$lang['install_warning'] = 'The file "install.php" is still present. Please remove it from your server. It is not secure to keep it.';
    347 
    348 
    349 
    350 
    351349?>
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r649 r653  
    316316$lang['random_cat_hint'] = 'Displays a set of random pictures';
    317317$lang['picture_high'] = 'Click on the picture to see it in high definition';
     318
     319$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>';
    318320?>
  • trunk/template/default/admin/configuration.tpl

    r651 r653  
    3838        <input type="radio" class="radio" name="mail_notification" value="false" {general.NOTIFICATION_NO} />{L_NO}</td>
    3939  </tr>
     40  <tr>
     41    <td><strong>{general.L_CONF_GALLERY_LOCKED}&nbsp;:</strong><br /><span class="small">{general.L_CONF_GALLERY_LOCKED_INFO}</span></td>
     42        <td class="row1"><input type="radio" class="radio" name="gallery_locked" value="true" {general.GALLERY_LOCKED_YES} />{L_YES}&nbsp;&nbsp;
     43        <input type="radio" class="radio" name="gallery_locked" value="false" {general.GALLERY_LOCKED_NO} />{L_NO}</td>
     44  </tr>
    4045<!-- END general -->
    4146<!-- BEGIN comments -->
Note: See TracChangeset for help on using the changeset viewer.