b2evolution PHP Cross Reference Blogging Systems

Source: /inc/users/views/_settings.form.php - 103 lines - 4934 bytes - Text - Print

   1  <?php
   2  
   3  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
   4  
   5  /**
   6   * @var instance of GeneralSettings class
   7   */
   8  global $Settings;
   9  /**
  10   * @var instance of User class
  11   */
  12  global $current_User;
  13  
  14  $current_User->check_perm( 'users', 'view', true );
  15  
  16  $Form = new Form( NULL, 'usersettings_checkchanges' );
  17  
  18  $Form->begin_form( 'fform', '' );
  19  
  20      $Form->add_crumb( 'usersettings' );
  21      $Form->hidden( 'ctrl', 'usersettings' );
  22      $Form->hidden( 'action', 'update' );
  23  
  24  $Form->begin_fieldset( T_('Session Timeouts').get_manual_link('session-timeouts') );
  25  
  26      // fp>TODO: enhance UI with a general Form method for Days:Hours:Minutes:Seconds
  27  
  28      $Form->duration_input( 'timeout_sessions', $Settings->get('timeout_sessions'), T_('Session timeout'), 'months', 'seconds',
  29                          array( 'minutes_step' => 1, 'required' => true, 'note' => T_( 'If the user stays inactive for this long, he will have to log in again.' ) ) );
  30      // $Form->text_input( 'timeout_sessions', $Settings->get('timeout_sessions'), 9, T_('Session timeout'), T_('seconds. How long can a user stay inactive before automatic logout?'), array( 'required'=>true) );
  31  
  32      // fp>TODO: It may make sense to have a different (smaller) timeout for sessions with no logged user.
  33      // fp>This might reduce the size of the Sessions table. But this needs to be checked against the hit logging feature.
  34  
  35      $Form->duration_input( 'timeout_online', $Settings->get('timeout_online'), T_('Online/Offline timeout'), 'hours', 'seconds',
  36                          array( 'minutes_step' => 1, 'required' => true, 'note' => T_( 'If the user stays inactive for this long, we will no longer display him as "online" and we will start sending him email notifications when things happen while he is away.' ) ) );
  37  $Form->end_fieldset();
  38  
  39  $Form->begin_fieldset( T_('User latitude').get_manual_link('user-profile-latitude-settings') );
  40  
  41      $Form->checkbox_input( 'allow_avatars', $Settings->get( 'allow_avatars', true ), T_('Allow profile pictures'), array( 'note'=>T_('Allow users to upload profile pictures.') ) );
  42  
  43      $Form->text_input( 'uset_min_picture_size', $Settings->get( 'min_picture_size' ), 5, T_('Minimum picture size'), '', array( 'note' => T_('pixels (width and height)') ) );
  44  
  45      $name_editing_options = array(
  46              array( 'edited-user', T_('Can be edited by user') ),
  47              array( 'edited-user-required', T_('Can be edited by user + required') ),
  48              array( 'edited-admin', T_('Can be edited by admins only') ),
  49              array( 'hidden', T_('Hidden') )
  50          );
  51  
  52      $Form->radio( 'uset_nickname_editing', $Settings->get( 'nickname_editing' ), $name_editing_options, T_('Nickname'), true );
  53  
  54      $Form->radio( 'uset_firstname_editing', $Settings->get( 'firstname_editing' ), $name_editing_options, T_('Fistname'), true );
  55  
  56      $Form->radio( 'uset_lastname_editing', $Settings->get( 'lastname_editing' ), $name_editing_options, T_('Lastname'), true );
  57  
  58      $location_options = array(
  59              array( 'optional', T_('Optional') ),
  60              array( 'required', T_('Required') ),
  61              array( 'hidden', T_('Hidden') )
  62          );
  63  
  64      $Form->radio( 'uset_location_country', $Settings->get( 'location_country' ), $location_options, T_('Country') );
  65  
  66      $Form->radio( 'uset_location_region', $Settings->get( 'location_region' ), $location_options, T_('Region') );
  67  
  68      $Form->radio( 'uset_location_subregion', $Settings->get( 'location_subregion' ), $location_options, T_('Sub-region') );
  69  
  70      $Form->radio( 'uset_location_city', $Settings->get( 'location_city' ), $location_options, T_('City') );
  71  
  72      $Form->text_input( 'uset_minimum_age', $Settings->get( 'minimum_age' ), 5, T_('Minimum age'), '', array( 'input_suffix' => ' '.T_('years') ) );
  73  
  74      $Form->radio( 'uset_multiple_sessions', $Settings->get( 'multiple_sessions' ), array(
  75                      array( 'never', T_('Never allow') ),
  76                      array( 'adminset_default_no', T_('Let admins decide for each user, default to "no" for new users') ),
  77                      array( 'userset_default_no', T_('Let users decide, default to "no" for new users') ),
  78                      array( 'userset_default_yes', T_('Let users decide, default to "yes" for new users') ),
  79                      array( 'adminset_default_yes', T_('Let admins decide for each user, default to "yes" for new users') ),
  80                      array( 'always', T_('Always allow') )
  81                  ), T_('Multiple sessions'), true );
  82  
  83      $Form->radio( 'uset_emails_msgform', $Settings->get( 'emails_msgform' ), array(
  84                      array( 'never', T_('Never allow') ),
  85                      array( 'adminset', T_('Let admins decide for each user, default set on Registration tab') ),
  86                      array( 'userset', T_('Let users decide, default set on Registration tab') ),
  87                  ), T_('Receiving emails through a message form'), true );
  88  
  89  $Form->end_fieldset();
  90  
  91  if( $current_User->check_perm( 'users', 'edit' ) )
  92  {
  93      $Form->buttons( array( array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
  94                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  95  }
  96  
  97  $Form->end_form();
  98  
  99  
 100  load_funcs( 'regional/model/_regional.funcs.php' );
 101  echo_regional_required_js( 'uset_location_' );
 102  
 103  ?>

title

Description

title

Description

title

Description

title

title

Body