[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/settings/views/ -> _general.form.php (source)

   1  <?php
   2  /**

   3   * This file implements the UI view for the general settings.

   4   *

   5   * This file is part of the evoCore framework - {@link http://evocore.net/}

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   9   *

  10   * {@internal License choice

  11   * - If you have received this file as part of a package, please find the license.txt file in

  12   *   the same folder or the closest folder above for complete license terms.

  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)

  14   *   then you must choose one of the following licenses before using the file:

  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php

  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php

  17   * }}

  18   *

  19   * {@internal Open Source relicensing agreement:

  20   * }}

  21   *

  22   * @package admin

  23   *

  24   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  25   * @author fplanque: Francois PLANQUE.

  26   * @author blueyed: Daniel HAHLER.

  27   *

  28   * @version $Id: _general.form.php,v 1.2 2007/09/12 21:00:32 fplanque Exp $

  29   */
  30  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  31  
  32  /**

  33   * @var User

  34   */
  35  global $current_User;
  36  /**

  37   * @var GeneralSettings

  38   */
  39  global $Settings;
  40  
  41  $Form = & new Form( NULL, 'settings_checkchanges' );
  42  $Form->begin_form( 'fform', T_('General Settings'),
  43      // enable all form elements on submit (so values get sent):

  44      array( 'onsubmit'=>'var es=this.elements; for( var i=0; i < es.length; i++ ) { es[i].disabled=false; };' ) );
  45  
  46  $Form->hidden( 'ctrl', 'settings' );
  47  $Form->hidden( 'action', 'update' );
  48  $Form->hidden( 'tab', 'general' );
  49  
  50  // --------------------------------------------

  51  
  52  $Form->begin_fieldset( T_('Display options') );
  53  
  54  $BlogCache = & get_Cache( 'BlogCache' );
  55  $Form->select_object( 'default_blog_ID', $Settings->get('default_blog_ID'), $BlogCache, T_('Default blog to display'),
  56                                          T_('This blog will be displayed on index.php.').' <a href="admin.php?ctrl=collections&action=new">'.T_('Create new blog').' &raquo;</a>', true );
  57  
  58  $Form->end_fieldset();
  59  
  60  // --------------------------------------------

  61  
  62  $Form->begin_fieldset( T_('Default user permissions') );
  63  
  64      $Form->checkbox( 'newusers_canregister', $Settings->get('newusers_canregister'), T_('New users can register'), T_('Check to allow new users to register themselves.' ) );
  65  
  66      $GroupCache = & get_Cache( 'GroupCache' );
  67      $Form->select_object( 'newusers_grp_ID', $Settings->get('newusers_grp_ID'), $GroupCache, T_('Group for new users'), T_('Groups determine user roles and permissions.') );
  68  
  69      $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 ) );
  70  
  71  $Form->end_fieldset();
  72  
  73  // --------------------------------------------

  74  
  75  $Form->begin_fieldset( T_('Email validation') );
  76  
  77      $Form->checkbox( 'newusers_mustvalidate', $Settings->get('newusers_mustvalidate'), T_('New users must validate email'), T_('Check to require users to validate their email by clicking a link sent to them.' ) );
  78  
  79      $Form->checkbox( 'newusers_revalidate_emailchg', $Settings->get('newusers_revalidate_emailchg'), T_('Validate email changes'), T_('Check to require users to re-validate when they change their email address.' ) );
  80  
  81  $Form->end_fieldset();
  82  
  83  // --------------------------------------------

  84  
  85  $Form->begin_fieldset( T_('Security options') );
  86  
  87      $Form->text_input( 'user_minpwdlen', (int)$Settings->get('user_minpwdlen'), 2, T_('Minimum password length'), T_('characters.'), array( 'maxlength'=>2, 'required'=>true ) );
  88  
  89      $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.')) );
  90  
  91  $Form->end_fieldset();
  92  
  93  // --------------------------------------------

  94  
  95  $Form->begin_fieldset( T_('Timeouts') );
  96  
  97      // fp>TODO: enhance UI with a general Form method for Days:Hours:Minutes:Seconds

  98      $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) );
  99  
 100      // fp>TODO: It may make sense to have a different (smaller) timeout for sessions with no logged user.

 101      // fp>This might reduce the size of the Sessions table. But this needs to be checked against the hit logging feature.

 102  
 103      $Form->text_input( 'reloadpage_timeout', (int)$Settings->get('reloadpage_timeout'), 5,
 104                                  T_('Reload-page timeout'), T_('Time (in seconds) that must pass before a request to the same URI from the same IP and useragent is considered as a new hit.'), array( 'maxlength'=>5, 'required'=>true ) );
 105  
 106  $Form->end_fieldset();
 107  
 108  // --------------------------------------------

 109  
 110  if( $current_User->check_perm( 'options', 'edit' ) )
 111  {
 112      $Form->end_form( array( array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 113                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 114  }
 115  
 116  /*

 117   * $Log: _general.form.php,v $

 118   * Revision 1.2  2007/09/12 21:00:32  fplanque

 119   * UI improvements

 120   *

 121   * Revision 1.1  2007/06/25 11:01:27  fplanque

 122   * MODULES (refactored MVC)

 123   *

 124   * Revision 1.29  2007/04/26 00:11:12  fplanque

 125   * (c) 2007

 126   *

 127   * Revision 1.28  2007/03/25 13:20:52  fplanque

 128   * cleaned up blog base urls

 129   * needs extensive testing...

 130   *

 131   * Revision 1.27  2007/03/24 20:41:16  fplanque

 132   * Refactored a lot of the link junk.

 133   * Made options blog specific.

 134   * Some junk still needs to be cleaned out. Will do asap.

 135   *

 136   * Revision 1.26  2006/12/15 22:54:14  fplanque

 137   * allow disabling of password hashing

 138   *

 139   * Revision 1.25  2006/12/11 00:32:26  fplanque

 140   * allow_moving_chapters stting moved to UI

 141   * chapters are now called categories in the UI

 142   *

 143   * Revision 1.24  2006/12/09 01:55:36  fplanque

 144   * feel free to fill in some missing notes

 145   * hint: "login" does not need a note! :P

 146   *

 147   * Revision 1.23  2006/12/07 00:55:52  fplanque

 148   * reorganized some settings

 149   *

 150   * Revision 1.22  2006/12/06 22:30:08  fplanque

 151   * Fixed this use case:

 152   * Users cannot register themselves.

 153   * Admin creates users that are validated by default. (they don't have to validate)

 154   * Admin can invalidate a user. (his email, address actually)

 155   *

 156   * Revision 1.21  2006/12/04 19:41:11  fplanque

 157   * Each blog can now have its own "archive mode" settings

 158   *

 159   * Revision 1.20  2006/12/04 18:16:51  fplanque

 160   * Each blog can now have its own "number of page/days to display" settings

 161   *

 162   * Revision 1.19  2006/12/03 01:25:49  blueyed

 163   * Use & instead of &amp; when it gets encoded for output

 164   *

 165   * Revision 1.18  2006/11/26 01:37:30  fplanque

 166   * The URLs are meant to be translated!

 167   *

 168   * Revision 1.17  2006/11/24 18:27:26  blueyed

 169   * Fixed link to b2evo CVS browsing interface in file docblocks

 170   */
 171  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics