Changeset 1652


Ignore:
Timestamp:
Dec 13, 2006, 2:05:38 AM (17 years ago)
Author:
rvelices
Message:
  • feature 599: option to forbid user registration
  • 1 language cleanup
  • added page_forbidden function (sends 403)
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r1617 r1652  
    5353    'history_guest',
    5454    'login_history',
    55     'email_admin_on_new_user'
     55    'email_admin_on_new_user',
     56    'allow_user_registration',
    5657   );
    5758
  • trunk/identification.php

    r1615 r1652  
    5858  {
    5959    $remember_me = false;
    60     if ($conf['authorize_remembering']
    61         and isset($_POST['remember_me'])
     60    if (isset($_POST['remember_me'])
    6261        and $_POST['remember_me'] == 1)
    6362    {
     
    8685$template->assign_vars(
    8786  array(
    88 
    8987    'U_REGISTER' => PHPWG_ROOT_PATH.'register.php',
    9088    'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
     
    9997  $template->assign_block_vars('remember_me',array());
    10098}
     99if ($conf['allow_user_registration'])
     100{
     101  $template->assign_block_vars('register',array());
     102}
     103
    101104//-------------------------------------------------------------- errors display
    102105if ( sizeof( $errors ) != 0 )
  • trunk/include/functions_html.inc.php

    r1649 r1652  
    615615
    616616/**
     617 * exits the current script with 403 code
     618 * @param string msg a message to display
     619 * @param string alternate_url redirect to this url
     620 */
     621function page_forbidden($msg, $alternate_url=null)
     622{
     623  set_status_header(403);
     624  if ($alternate_url==null)
     625    $alternate_url = make_index_url();
     626  redirect_html( $alternate_url,
     627    '<div style="text-align:left; margin-left:5em;margin-bottom:5em;">
     628<h1 style="text-align:left; font-size:36px;">Forbidden</h1><br/>'
     629.$msg.'</div>',
     630    5 );
     631}
     632
     633/**
    617634 * exits the current script with 404 code when a page cannot be found
    618635 * @param string msg a message to display
  • trunk/include/menubar.inc.php

    r1650 r1652  
    207207if ($user['is_the_guest'])
    208208{
    209   $template->assign_block_vars('register', array());
    210209  $template->assign_block_vars('login', array());
    211210
     
    214213  {
    215214    $template->assign_block_vars('quickconnect.remember_me', array());
     215  }
     216  if ($conf['allow_user_registration'])
     217  {
     218    $template->assign_block_vars('register', array());
     219    $template->assign_block_vars('quickconnect.register', array());
    216220  }
    217221}
  • trunk/install/config.sql

    r1617 r1652  
    2323INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('history_guest','true','keep a history of guest visits on your website');
    2424INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('login_history','true','keep a history of user logins on your website');
     25INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('allow_user_registration','true','allow visitors to register?');
    2526-- Notification by mail
    2627INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail');
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r1617 r1652  
    4949$lang['Add selected elements to caddie'] = 'Add selected elements to caddie';
    5050$lang['Add'] = 'Add';
     51$lang['Allow user registration'] = 'Allow user registration';
    5152$lang['Apply to subcategories'] = 'Apply to subcategories';
    5253$lang['Are you sure?'] = 'Are you sure?';
     
    153154$lang['Rating'] = 'Rating';
    154155$lang['Recent period'] = 'Recent period';
    155 $lang['Registration date'] = 'Registration date';
    156156$lang['Reject All'] = 'Reject All';
    157157$lang['Reject'] = 'Reject';
  • trunk/language/fr_FR.iso-8859-1/admin.lang.php

    r1617 r1652  
    4949$lang['Add selected elements to caddie'] = 'Ajouter les éléments sélectionnés au panier';
    5050$lang['Add'] = 'Ajouter';
     51$lang['Allow user registration'] = 'Permettre l\'enregistrement des utilisateurs';
    5152$lang['Apply to subcategories'] = 'Appliquer au sous-catégories';
    5253$lang['Are you sure?'] = 'Etes-vous sur?';
     
    153154$lang['Rating'] = 'Notation';
    154155$lang['Recent period'] = 'Période récente';
    155 $lang['Registration date'] = 'Date d\'enregistrement';
    156156$lang['Reject All'] = 'Tout rejeter';
    157157$lang['Reject'] = 'Rejeter';
  • trunk/register.php

    r1615 r1652  
    3030include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131//----------------------------------------------------------- user registration
     32
     33if (!$conf['allow_user_registration'])
     34{
     35  page_forbidden('User registration closed');
     36}
     37
    3238$errors = array();
    3339if (isset($_POST['submit']))
  • trunk/template/yoga/admin/configuration.tpl

    r1617 r1652  
    5757        <span class="property">{lang:Email admin when a new user registers}</span>
    5858        <input type="checkbox" name="email_admin_on_new_user" {general.EMAIL_ADMIN_ON_NEW_USER} />
     59      </label>
     60    </li>
     61
     62    <li>
     63      <label for="allow_user_registration">
     64        <span class="property">{lang:Allow user registration}</span>
     65        <input type="checkbox" name="allow_user_registration" id="allow_user_registration" {general.ALLOW_USER_REGISTRATION} />
    5966      </label>
    6067    </li>
  • trunk/template/yoga/admin/picture_modify.tpl

    r1119 r1652  
    2424
    2525      <tr>
    26         <td><strong>{lang:Registration date}</strong></td>
     26        <td><strong>{lang:Post date}</strong></td>
    2727        <td>{REGISTRATION_DATE}</td>
    2828      </tr>
     
    104104      </tr>
    105105
    106      
     106
    107107      <tr>
    108108        <td><strong>{lang:Description}</strong></td>
  • trunk/template/yoga/default-layout.css

    r1537 r1652  
    182182  padding: 0;
    183183  line-height: 1.8em;
     184  clear: left;
    184185}
    185186
  • trunk/template/yoga/identification.tpl

    r1620 r1652  
    55    <ul class="categoryActions">
    66      <li><a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}"><img src="{themeconf:icon_dir}/lost_password.png" class="button" alt="{lang:Forgot your password?}"></a></li>
     7<!-- BEGIN register -->
    78      <li><a href="{U_REGISTER}" title="{lang:Create a new account}"><img src="{themeconf:icon_dir}/register.png" class="button" alt="{lang:register}"/></a></li>
     9<!-- END register -->
    810      <li><a href="{U_HOME}" title="{lang:Go through the gallery as a visitor}"><img src="{themeconf:icon_dir}/home.png" class="button" alt="{lang:home}"/></a></li>
    911    </ul>
     
    6163
    6264  <p>
    63     <a href="{U_REGISTER}"><img src="{themeconf:icon_dir}/register.png" class="button" alt=""> {lang:Register}</a>
    64     <a href="{U_LOST_PASSWORD}"><img src="{themeconf:icon_dir}/lost_password.png" class="button" alt=""> {lang:Forgot your password?}</a>
     65<!-- BEGIN register -->
     66    <a href="{U_REGISTER}" title="{lang:Create a new account}"><img src="{themeconf:icon_dir}/register.png" class="button" alt=""> {lang:Register}</a>
     67<!-- END register -->
     68    <a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}"><img src="{themeconf:icon_dir}/lost_password.png" class="button" alt=""> {lang:Forgot your password?}</a>
    6569  </p>
    6670
  • trunk/template/yoga/menubar.tpl

    r1651 r1652  
    8080    <ul>
    8181      <!-- BEGIN register -->
    82       <li><a href="{U_REGISTER}" rel="nofollow">{lang:Register}</a></li>
     82      <li><a href="{U_REGISTER}" title="{lang:Create a new account}" rel="nofollow">{lang:Register}</a></li>
    8383      <!-- END register -->
    8484      <!-- BEGIN login -->
     
    122122    <ul class="actions">
    123123      <li><a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/lost_password.png" class="button" alt="{lang:Forgot your password?}"></a></li>
     124      <!-- BEGIN register -->
    124125      <li><a href="{U_REGISTER}" title="{lang:Create a new account}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/register.png" class="button" alt="{lang:register}"/></a></li>
     126      <!-- END register -->
    125127    </ul>
    126128
Note: See TracChangeset for help on using the changeset viewer.