[ 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/ -> settings.ctrl.php (source)

   1  <?php
   2  /**

   3   * This file implements the UI controller for settings management.

   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   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   *

  11   * {@internal License choice

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

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

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

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

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

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

  18   * }}

  19   *

  20   * {@internal Open Source relicensing agreement:

  21   * Daniel HAHLER grants Francois PLANQUE the right to license

  22   * Daniel HAHLER's contributions to this file and the b2evolution project

  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).

  24   * }}

  25   *

  26   * @package admin

  27   *

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

  29   * @author blueyed: Daniel HAHLER

  30   * @author fplanque: Francois PLANQUE

  31   *

  32   * @version $Id: settings.ctrl.php,v 1.1 2007/06/25 11:01:18 fplanque Exp $

  33   */
  34  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  35  
  36  
  37  // Check minimum permission:

  38  $current_User->check_perm( 'options', 'view', true );
  39  
  40  
  41  $AdminUI->set_path( 'options', 'general' );
  42  
  43  param( 'action', 'string' );
  44  param( 'edit_locale', 'string' );
  45  param( 'loc_transinfo', 'integer', 0 );
  46  
  47  if( in_array( $action, array( 'update', 'reset', 'updatelocale', 'createlocale', 'deletelocale', 'extract', 'prioup', 'priodown' )) )
  48  { // We have an action to do..
  49      // Check permission:

  50      $current_User->check_perm( 'options', 'edit', true );
  51  
  52      // clear settings cache

  53      $cache_settings = '';
  54  
  55      // UPDATE general settings:

  56  
  57      param( 'newusers_canregister', 'integer', 0 );
  58      $Settings->set( 'newusers_canregister', $newusers_canregister );
  59  
  60      param( 'newusers_mustvalidate', 'integer', 0 );
  61      $Settings->set( 'newusers_mustvalidate', $newusers_mustvalidate );
  62  
  63      param( 'newusers_revalidate_emailchg', 'integer', 0 );
  64      $Settings->set( 'newusers_revalidate_emailchg', $newusers_revalidate_emailchg );
  65  
  66      param( 'newusers_grp_ID', 'integer', true );
  67      $Settings->set( 'newusers_grp_ID', $newusers_grp_ID );
  68  
  69      param_integer_range( 'newusers_level', 0, 9, T_('User level must be between %d and %d.') );
  70      $Settings->set( 'newusers_level', $newusers_level );
  71  
  72      param( 'default_blog_ID', 'integer', true );
  73      $Settings->set( 'default_blog_ID', $default_blog_ID );
  74  
  75      param_integer_range( 'user_minpwdlen', 1, 32, T_('Minimun password length must be between %d and %d.') );
  76      $Settings->set( 'user_minpwdlen', $user_minpwdlen );
  77  
  78      param( 'js_passwd_hashing', 'integer', 0 );
  79      $Settings->set( 'js_passwd_hashing', $js_passwd_hashing );
  80  
  81  
  82      // Session timeout

  83      $timeout_sessions = param( 'timeout_sessions', 'integer', $Settings->get_default('timeout_sessions') );
  84      if( $timeout_sessions < 300 )
  85      { // lower than 5 minutes: not allowed
  86          param_error( 'timeout_sessions', sprintf( T_( 'You cannot set a session timeout below %d seconds.' ), 300 ) );
  87      }
  88      elseif( $timeout_sessions < 86400 )
  89      { // lower than 1 day: notice/warning
  90          $Messages->add( sprintf( T_( 'Warning: your session timeout is just %d seconds. Your users may have to re-login often!' ), $timeout_sessions ), 'note' );
  91      }
  92      $Settings->set( 'timeout_sessions', $timeout_sessions );
  93  
  94      param_integer_range( 'reloadpage_timeout', 0, 99999, T_('Reload-page timeout must be between %d and %d.') );
  95      $Settings->set( 'reloadpage_timeout', $reloadpage_timeout );
  96  
  97      if( ! $Messages->count('error') )
  98      {
  99          if( $Settings->dbupdate() )
 100          {
 101              $Messages->add( T_('General settings updated.'), 'success' );
 102          }
 103      }
 104  
 105  }
 106  
 107  
 108  // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)

 109  $AdminUI->disp_html_head();
 110  
 111  // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)

 112  $AdminUI->disp_body_top();
 113  
 114  // Begin payload block:

 115  $AdminUI->disp_payload_begin();
 116  
 117  // Display VIEW:

 118  $AdminUI->disp_view( 'settings/views/_general.form.php' );
 119  
 120  // End payload block:

 121  $AdminUI->disp_payload_end();
 122  
 123  // Display body bottom, debug info and close </html>:

 124  $AdminUI->disp_global_footer();
 125  
 126  /*

 127   * $Log: settings.ctrl.php,v $

 128   * Revision 1.1  2007/06/25 11:01:18  fplanque

 129   * MODULES (refactored MVC)

 130   *

 131   * Revision 1.16  2007/04/26 00:11:14  fplanque

 132   * (c) 2007

 133   *

 134   * Revision 1.15  2007/03/25 13:20:52  fplanque

 135   * cleaned up blog base urls

 136   * needs extensive testing...

 137   *

 138   * Revision 1.14  2007/03/24 20:41:16  fplanque

 139   * Refactored a lot of the link junk.

 140   * Made options blog specific.

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

 142   *

 143   * Revision 1.13  2006/12/15 22:54:14  fplanque

 144   * allow disabling of password hashing

 145   *

 146   * Revision 1.12  2006/12/07 00:55:52  fplanque

 147   * reorganized some settings

 148   *

 149   * Revision 1.11  2006/12/04 19:41:11  fplanque

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

 151   *

 152   * Revision 1.10  2006/12/04 18:16:50  fplanque

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

 154   *

 155   * Revision 1.9  2006/11/24 18:27:23  blueyed

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

 157   */
 158  ?>


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