b2evolution PHP Cross Reference Blogging Systems

Source: /inc/users/display.ctrl.php - 114 lines - 4258 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   * @version $Id: display.ctrl.php 6136 2014-03-08 07:59:48Z manuel $
  27   */
  28  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  29  
  30  // Check minimum permission:
  31  $current_User->check_perm( 'users', 'view', true );
  32  
  33  $AdminUI->set_path( 'users', 'usersettings', 'display' );
  34  
  35  param_action();
  36  
  37  switch ( $action )
  38  {
  39      case 'update':
  40          // Check that this action request is not a CSRF hacked request:
  41          $Session->assert_received_crumb( 'display' );
  42  
  43          // Check permission:
  44          $current_User->check_perm( 'users', 'edit', true );
  45  
  46          // UPDATE display settings:
  47          param( 'use_gravatar', 'integer', 0 );
  48          param( 'default_gravatar', 'string', 'b2evo' );
  49          param( 'gender_colored', 'integer', 0 );
  50          param( 'bubbletip', 'integer', 0 );
  51          param( 'bubbletip_size_admin', 'string', '' );
  52          param( 'bubbletip_size_front', 'string', '' );
  53          param( 'bubbletip_anonymous', 'integer', 0 );
  54          param( 'bubbletip_size_anonymous', 'string', '' );
  55          param( 'bubbletip_overlay' );
  56          param( 'allow_anonymous_user_list', 'integer', 0 );
  57          param( 'allow_anonymous_user_profiles', 'integer', 0 );
  58  
  59          $Settings->set_array( array(
  60                                       array( 'use_gravatar', $use_gravatar ),
  61                                       array( 'default_gravatar', $default_gravatar ),
  62                                       array( 'gender_colored', $gender_colored ),
  63                                       array( 'bubbletip', $bubbletip ),
  64                                       array( 'bubbletip_size_admin', $bubbletip_size_admin ),
  65                                       array( 'bubbletip_size_front', $bubbletip_size_front ),
  66                                       array( 'bubbletip_anonymous', $bubbletip_anonymous ),
  67                                       array( 'bubbletip_size_anonymous', $bubbletip_size_anonymous ),
  68                                       array( 'bubbletip_overlay', $bubbletip_overlay ),
  69                                       array( 'allow_anonymous_user_list', $allow_anonymous_user_list ),
  70                                       array( 'allow_anonymous_user_profiles', $allow_anonymous_user_profiles ) ) );
  71  
  72          if( ! $Messages->has_errors() )
  73          {
  74              if( $Settings->dbupdate() )
  75              {
  76                  // invalidate all PageCaches
  77                  invalidate_pagecaches();
  78  
  79                  $Messages->add( T_('Display settings updated.'), 'success' );
  80                  // Redirect so that a reload doesn't write to the DB twice:
  81                  header_redirect( '?ctrl=display', 303 ); // Will EXIT
  82                  // We have EXITed already at this point!!
  83              }
  84          }
  85  
  86          break;
  87  }
  88  
  89  
  90  $AdminUI->breadcrumbpath_init( false );  // fp> I'm playing with the idea of keeping the current blog in the path here...
  91  $AdminUI->breadcrumbpath_add( T_('Users'), '?ctrl=users' );
  92  $AdminUI->breadcrumbpath_add( T_('Settings'), '?ctrl=usersettings' );
  93  $AdminUI->breadcrumbpath_add( T_('Display'), '?ctrl=display' );
  94  
  95  
  96  // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
  97  $AdminUI->disp_html_head();
  98  
  99  // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
 100  $AdminUI->disp_body_top();
 101  
 102  // Begin payload block:
 103  $AdminUI->disp_payload_begin();
 104  
 105  // Display VIEW:
 106  $AdminUI->disp_view( 'users/views/_display.form.php' );
 107  
 108  // End payload block:
 109  $AdminUI->disp_payload_end();
 110  
 111  // Display body bottom, debug info and close </html>:
 112  $AdminUI->disp_global_footer();
 113  
 114  ?>

title

Description

title

Description

title

Description

title

title

Body