b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_profile.disp.php - 109 lines - 3388 bytes - Text - Print

Description: This is the template that displays the user profile form. It gets POSTed to /htsrv/profile_update.php.

   1  <?php
   2  /**
   3   * This is the template that displays the user profile form. It gets POSTed to /htsrv/profile_update.php.
   4   *
   5   * This file is not meant to be called directly.
   6   * It is meant to be called by an include in the main.page.php template.
   7   * To display a feedback, you should call a stub AND pass the right parameters
   8   * For example: /blogs/index.php?disp=profile
   9   * Note: don't code this URL by hand, use the template functions to generate it!
  10   *
  11   *
  12   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
  13   * See also {@link http://sourceforge.net/projects/evocms/}.
  14   *
  15   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}.
  16   *
  17   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * Daniel HAHLER grants Francois PLANQUE the right to license
  21   * Daniel HAHLER's contributions to this file and the b2evolution project
  22   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  23   *
  24   * PROGIDISTRI grants Francois PLANQUE the right to license
  25   * PROGIDISTRI's contributions to this file and the b2evolution project
  26   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  27   * }}
  28   *
  29   * @package evoskins
  30   *
  31   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  32   * @author blueyed: Daniel HAHLER
  33   * @author fplanque: Francois PLANQUE.
  34   *
  35   * @version $Id: _profile.disp.php 6136 2014-03-08 07:59:48Z manuel $
  36   */
  37  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  38  
  39  load_class( 'regional/model/_country.class.php', 'Country' );
  40  
  41  global $Blog, $Session, $Messages, $inc_path;
  42  global $action, $user_profile_only, $edited_User, $form_action;
  43  
  44  $form_action = get_secure_htsrv_url().'profile_update.php';
  45  
  46  if( ! is_logged_in() )
  47  { // must be logged in!
  48      echo '<p class="error">'.T_( 'You are not logged in.' ).'</p>';
  49      return;
  50  }
  51  
  52  $user_profile_only = true;
  53  // check if there is unsaved User object stored in Session
  54  $edited_User = $Session->get( 'core.unsaved_User' );
  55  if( $edited_User == NULL )
  56  { // edited_User is the current_User
  57      $edited_User = $current_User;
  58  }
  59  else
  60  { // unsaved user exists, delete it from Session
  61      $Session->delete( 'core.unsaved_User' );
  62      if( $edited_User->ID != $current_User->ID )
  63      { // edited user ID must be the same as current User
  64          debug_die( 'Inconsistent state, you are allowed to edit only your profile' );
  65      }
  66  }
  67  
  68  // Display tabs
  69  echo '<div class="tabs">';
  70  $entries = get_user_sub_entries( false, NULL );
  71  foreach( $entries as $entry => $entry_data )
  72  {
  73      if( $entry == $disp )
  74      {
  75          echo '<div class="selected">';
  76      }
  77      else
  78      {
  79          echo '<div class="option">';
  80      }
  81      echo '<a href='.$entry_data['href'].'>'.$entry_data['text'].'</a>';
  82      echo '</div>';
  83  }
  84  echo '</div>';
  85  echo '<div class="clear"></div>';
  86  
  87  // Display form
  88  switch( $disp )
  89  {
  90      case 'profile':
  91          require $inc_path.'users/views/_user_identity.form.php';
  92          break;
  93      case 'avatar':
  94          require $inc_path.'users/views/_user_avatar.form.php';
  95          break;
  96      case 'pwdchange':
  97          require $inc_path.'users/views/_user_password.form.php';
  98          break;
  99      case 'userprefs':
 100          require $inc_path.'users/views/_user_preferences.form.php';
 101          break;
 102      case 'subs':
 103          require $inc_path.'users/views/_user_subscriptions.form.php';
 104          break;
 105      default:
 106          debug_die( "Unknown user tab" );
 107  }
 108  
 109  ?>

title

Description

title

Description

title

Description

title

title

Body