b2evolution PHP Cross Reference Blogging Systems

Source: /inc/users/views/_registration.form.php - 198 lines - 11433 bytes - Text - Print

Description: This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file is part of the evoCore framework - {@link http://evocore.net/}
   4   * See also {@link http://sourceforge.net/projects/evocms/}.
   5   *
   6   * @copyright (c)2009-2014 by Francois PLANQUE - {@link http://fplanque.net/}
   7   * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
   8   *
   9   * {@internal License choice
  10   * - If you have received this file as part of a package, please find the license.txt file in
  11   *   the same folder or the closest folder above for complete license terms.
  12   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  13   *   then you must choose one of the following licenses before using the file:
  14   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  15   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  16   * }}
  17   *
  18   * {@internal Open Source relicensing agreement:
  19   * The Evo Factory grants Francois PLANQUE the right to license
  20   * The Evo Factory's contributions to this file and the b2evolution project
  21   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  22   * }}
  23   *
  24   * @package evocore
  25   *
  26   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  27   * @author efy-bogdan: Evo Factory / Bogdan.
  28   * @author fplanque: Francois PLANQUE.
  29   *
  30   * @version $Id: _registration.form.php 6136 2014-03-08 07:59:48Z manuel $
  31   */
  32  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  33  
  34  /**
  35   * @var User
  36   */
  37  global $current_User;
  38  /**
  39   * @var GeneralSettings
  40   */
  41  global $Settings;
  42  
  43  global $dispatcher;
  44  
  45  global $collections_Module;
  46  
  47  global $baseurl;
  48  
  49  $Form = new Form( NULL, 'settings_checkchanges' );
  50  $Form->begin_form( 'fform', '',
  51      // enable all form elements on submit (so values get sent):
  52      array( 'onsubmit'=>'var es=this.elements; for( var i=0; i < es.length; i++ ) { es[i].disabled=false; };' ) );
  53  
  54      $Form->add_crumb( 'registration' );
  55      $Form->hidden( 'ctrl', 'registration' );
  56      $Form->hidden( 'action', 'update' );
  57      $Form->hidden( 'tab', 'registration' );
  58  
  59  // --------------------------------------------
  60  
  61  $Form->begin_fieldset( T_('Default user permissions').get_manual_link('default-user-permissions') );
  62  
  63      $Form->checkbox( 'newusers_canregister', $Settings->get('newusers_canregister'), T_('New users can register'), T_('Check to allow new users to register themselves.' ) );
  64  
  65      $GroupCache = & get_GroupCache();
  66      $Form->select_object( 'newusers_grp_ID', $Settings->get('newusers_grp_ID'), $GroupCache, T_('Group for new users'), T_('Groups determine user roles and permissions.') );
  67  
  68      $Form->text_input( 'newusers_level', $Settings->get('newusers_level'), 1, T_('Level for new users'), T_('Levels determine hierarchy of users in blogs.' ), array( 'maxlength'=>1, 'required'=>true ) );
  69  
  70  $Form->end_fieldset();
  71  
  72  // --------------------------------------------
  73  
  74  $Form->begin_fieldset( T_('Default user settings').get_manual_link('default-user-settings') );
  75  
  76      $messaging_options = array( array( 'enable_PM', 1, T_( 'private messages on this site.' ), $Settings->get( 'def_enable_PM' ) ) );
  77      if( $Settings->get( 'emails_msgform' ) != 'never' )
  78      {
  79          $messaging_options[] = array( 'enable_email', 1, T_( 'emails through a message form that will NOT reveal my email address.' ), $Settings->get( 'def_enable_email' ) );
  80      }
  81      $Form->checklist( $messaging_options, 'default_user_msgform', T_( 'Other users can send me' ) );
  82  
  83      $notify_options = array(
  84          array( 'notify_messages', 1, T_( 'I receive a private message.' ),  $Settings->get( 'def_notify_messages' ) ),
  85          array( 'notify_unread_messages', 1, T_( 'I have unread private messages for more than 24 hours.' ),  $Settings->get( 'def_notify_unread_messages' ), false, T_( 'This notification is sent only once every 3 days.' ) ),
  86          array( 'notify_published_comments', 1, T_( 'a comment is published on one of <strong>my</strong> posts.' ), $Settings->get( 'def_notify_published_comments' ) ),
  87          array( 'notify_comment_moderation', 1, T_( 'a comment is posted and I have permissions to moderate it.' ), $Settings->get( 'def_notify_comment_moderation' ) ),
  88          array( 'notify_post_moderation', 1, T_( 'a post is created and I have permissions to moderate it.' ), $Settings->get( 'def_notify_post_moderation' ) ),
  89      );
  90      $Form->checklist( $notify_options, 'default_user_notification', T_( 'Notify me by email whenever' ) );
  91  
  92      $newsletter_options = array(
  93          array( 'newsletter_news', 1, T_( 'Send me news about this site.' ).' <span class="note">'.T_('Each message contains an easy 1 click unsubscribe link.').'</span>', $Settings->get( 'def_newsletter_news' ) ),
  94          array( 'newsletter_ads', 1, T_( 'I want to receive ADs that may be relevant to my interests.' ), $Settings->get( 'def_newsletter_ads' ) )
  95      );
  96      $Form->checklist( $newsletter_options, 'default_user_newsletter', T_( 'Newsletter' ) );
  97  
  98      $Form->text_input( 'notification_email_limit', $Settings->get( 'def_notification_email_limit' ), 3, T_( 'Limit notification emails to' ), T_( 'emails per day' ), array( 'maxlength' => 3, 'required' => true ) );
  99      $Form->text_input( 'newsletter_limit', $Settings->get( 'def_newsletter_limit' ), 3, T_( 'Limit newsletters to' ), T_( 'emails per day' ), array( 'maxlength' => 3, 'required' => true ) );
 100  
 101  $Form->end_fieldset();
 102  
 103  // --------------------------------------------
 104  
 105  $Form->begin_fieldset( T_('Account activation').get_manual_link('account-activation-settings'), array( 'id' => 'account_activation' ) );
 106  
 107      $Form->checkbox( 'newusers_mustvalidate', $Settings->get('newusers_mustvalidate'), T_('New users must activate by email'), T_('Check to require users to activate their account by clicking a link sent to them via email.' ) );
 108  
 109      $Form->checkbox( 'newusers_revalidate_emailchg', $Settings->get('newusers_revalidate_emailchg'), T_('Reactivate after email change'), T_('Check to require users to re-activate their account when they change their email address.' ) );
 110  
 111      $Form->radio( 'validation_process', $Settings->get( 'validation_process' ), array(
 112                      array( 'secure', T_( 'Secure account activation process' ), T_( 'Users must validate their account in the same session. Prevents activation of an account by someone else if an incorrect email address is entered. No reminder emails can be sent.' ) ),
 113                      array( 'easy', T_( 'Easy account activation process' ), T_( 'Allows to send reminder emails to unregistered accounts.' ) )
 114                  ), T_( 'Activation process' ), true );
 115  
 116      $Form->duration_input( 'activate_requests_limit', $Settings->get( 'activate_requests_limit' ), T_('Limit activation email requests to'), 'minutes', 'minutes', array( 'minutes_step' => 5, 'required' => true, 'note' => T_('Only one activation email can be sent to the same email address in every given minutes.') ) );
 117  
 118      $Form->checkbox( 'newusers_findcomments', $Settings->get('newusers_findcomments'), T_('Find old comments'), T_('After each activation, find comments left by the user based on the validated email address and attach them to the user account.' ) );
 119  
 120      if( $Settings->get( 'after_email_validation' ) == 'return_to_original' )
 121      { // return to original url
 122          $after_email_validation = 'return_to_original';
 123          $after_validation_url = $baseurl;
 124      }
 125      else
 126      { // set specific URL
 127          $after_email_validation = 'specific_url';
 128          $after_validation_url = $Settings->get( 'after_email_validation' );
 129      }
 130      $Form->radio( 'after_email_validation', $after_email_validation, array(
 131                      array( 'return_to_original', T_( 'Return to original page' ) ),
 132                      array( 'specific_url', T_( 'Go to specific URL' ).':', '',
 133                          '<input type="text" id="specific_after_validation_url" class="form_text_input" name="specific_after_validation_url" size="50" maxlength="120" value="'
 134                          .format_to_output( $after_validation_url, 'formvalue' ).'"
 135                          onfocus="document.getElementsByName(\'after_email_validation\')[1].checked=true;" />' )
 136                  ), T_( 'After email activation' ), true );
 137  
 138  $Form->end_fieldset();
 139  
 140  // --------------------------------------------
 141  
 142  
 143  $Form->begin_fieldset( T_('Security options').get_manual_link('registration-security-settings') );
 144  
 145      $Form->text_input( 'user_minpwdlen', (int)$Settings->get('user_minpwdlen'), 2, T_('Minimum password length'), T_('characters.'), array( 'maxlength'=>2, 'required'=>true ) );
 146  
 147      $Form->checkbox_input( 'js_passwd_hashing', (bool)$Settings->get('js_passwd_hashing'), T_('Login password hashing'), array( 'note'=>T_('Check to enable the login form to hash the password with Javascript before transmitting it. This provides extra security on non-SSL connections.')) );
 148  
 149      $Form->checkbox_input( 'passwd_special', (bool)$Settings->get('passwd_special'), T_('Require specials characters'), array( 'note'=>T_('Check to require at least 1 special character (not a letter nor a digit).')) );
 150  
 151      $Form->checkbox_input( 'strict_logins', (bool)$Settings->get('strict_logins'), T_('Require strict logins'), array( 'note'=>sprintf( T_('Check to require only plain ACSII characters in user logins. Uncheck to allow any characters and symbols. The following characters are never allowed for security reasons: %s'), '\', ", >, <, @') ) );
 152  
 153  $Form->end_fieldset();
 154  
 155  // --------------------------------------------
 156  
 157  $Form->begin_fieldset( T_('Other options').get_manual_link('other-registration-settings') );
 158  
 159      $Form->checkbox_input( 'registration_require_country', $Settings->get('registration_require_country'), T_('Require country'), array( 'note'=>T_('New users will have to specify their country in order to register.') ) );
 160  
 161      $Form->checkbox_input( 'registration_require_firstname', $Settings->get('registration_require_firstname'), T_('Require first name'), array( 'note'=>T_('New users will have to specify their first name in order to register.') ) );
 162  
 163      $Form->checkbox_input( 'registration_ask_locale', $Settings->get('registration_ask_locale'), T_('Ask for language'), array( 'note'=>T_('New users will be prompted for their preferred language/locale.') ) );
 164  
 165      $Form->radio( 'registration_require_gender',$Settings->get('registration_require_gender'), array(
 166                      array( 'hidden', T_('Hidden') ),
 167                      array( 'optional', T_('Optional') ),
 168                      array( 'required', T_('Required') ),
 169                  ), T_('Gender'), true );
 170  
 171      if( $Settings->get( 'after_registration' ) == 'return_to_original' )
 172      { // return to original url
 173          $after_registration = 'return_to_original';
 174          $after_registration_url = url_add_param( $baseurl, 'disp=profile' );
 175      }
 176      else
 177      { // set specific URL
 178          $after_registration = 'specific_url';
 179          $after_registration_url = $Settings->get( 'after_registration' );
 180      }
 181      $Form->radio( 'after_registration', $after_registration, array(
 182                      array( 'return_to_original', T_( 'Return to original page' ) ),
 183                      array( 'specific_url', T_( 'Go to specific URL' ).':', '',
 184                          '<input type="text" id="specific_after_registration_url" class="form_text_input" name="specific_after_registration_url" size="50" maxlength="120" value="'
 185                          .format_to_output( $after_registration_url, 'formvalue' ).'"
 186                          onfocus="document.getElementsByName(\'after_registration\')[1].checked=true;" />' )
 187                  ), T_( 'After registration' ), true );
 188  
 189  $Form->end_fieldset();
 190  // --------------------------------------------
 191  
 192  if( $current_User->check_perm( 'users', 'edit' ) )
 193  {
 194      $Form->end_form( array( array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 195                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 196  }
 197  
 198  ?>

title

Description

title

Description

title

Description

title

title

Body