[geeklog-cvs] geeklog-1.3/public_html usersettings.php,1.108,1.109

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Wed Dec 15 10:08:24 EST 2004


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv28753

Modified Files:
	usersettings.php 
Log Message:
Fix: Display the "benefits" message again when called up by an anonymous user.
Also made it default to the user's preferences when called without a "mode" parameter.


Index: usersettings.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** usersettings.php	14 Nov 2004 20:55:14 -0000	1.108
--- usersettings.php	15 Dec 2004 15:08:21 -0000	1.109
***************
*** 35,40 ****
  // $Id$
  
! require_once('lib-common.php');
! require_once($_CONF['path_system'] . 'lib-user.php');
  
  // Set this to true to have this script generate various debug messages in
--- 35,40 ----
  // $Id$
  
! require_once ('lib-common.php');
! require_once ($_CONF['path_system'] . 'lib-user.php');
  
  // Set this to true to have this script generate various debug messages in
***************
*** 45,49 ****
  // to the script.  This will sometimes cause errors but it will allow you to see
  // the data being passed in a POST operation
! // echo COM_debug($HTTP_POST_VARS);
  
  /**
--- 45,49 ----
  // to the script.  This will sometimes cause errors but it will allow you to see
  // the data being passed in a POST operation
! // echo COM_debug($_POST);
  
  /**
***************
*** 650,654 ****
  function handlePhotoUpload ($delete_photo = '')
  {
!     global $_CONF, $_TABLES, $_USER, $LANG24, $HTTP_POST_FILES;
  
      require_once ($_CONF['path_system'] . 'classes/upload.class.php');
--- 650,654 ----
  function handlePhotoUpload ($delete_photo = '')
  {
!     global $_CONF, $_TABLES, $_USER, $LANG24;
  
      require_once ($_CONF['path_system'] . 'classes/upload.class.php');
***************
*** 705,709 ****
  
      // see if user wants to upload a (new) photo
!     $newphoto = $HTTP_POST_FILES['photo'];
      if (!empty ($newphoto['name'])) {
          $pos = strrpos ($newphoto['name'], '.') + 1;
--- 705,709 ----
  
      // see if user wants to upload a (new) photo
!     $newphoto = $_FILES['photo'];
      if (!empty ($newphoto['name'])) {
          $pos = strrpos ($newphoto['name'], '.') + 1;
***************
*** 777,781 ****
  function saveuser($A) 
  {
!     global $_CONF, $_TABLES, $_USER, $LANG24, $_US_VERBOSE, $HTTP_POST_FILES;
  
      if ($_US_VERBOSE) {
--- 777,781 ----
  function saveuser($A) 
  {
!     global $_CONF, $_TABLES, $_USER, $LANG24, $_US_VERBOSE;
  
      if ($_US_VERBOSE) {
***************
*** 1073,1099 ****
  // MAIN
  $mode = '';
! if (isset ($HTTP_POST_VARS['mode'])) {
!     $mode = COM_applyFilter ($HTTP_POST_VARS['mode']);
  }
! else if (isset ($HTTP_GET_VARS['mode'])) {
!     $mode = COM_applyFilter ($HTTP_GET_VARS['mode']);
  }
  $display = '';
  
! if (isset ($_USER['uid']) && ($_USER['uid'] > 1) && !empty ($mode)) {
      switch ($mode) {
-     case 'preferences':
-     case 'comments':
-         $display .= COM_siteHeader ('menu', $LANG01[49]);
-         $msg = COM_applyFilter ($HTTP_GET_VARS['msg'], true);
-         if ($msg > 0) {
-             $display .= COM_showMessage ($msg);
-         }
-         $display .= editpreferences();
-         $display .= COM_siteFooter();
-         break;
      case 'edit':
          $display .= COM_siteHeader ('menu', $LANG04[16]);
!         $msg = COM_applyFilter ($HTTP_GET_VARS['msg'], true);
          if ($msg > 0) {
              $display .= COM_showMessage ($msg);
--- 1073,1089 ----
  // MAIN
  $mode = '';
! if (isset ($_POST['mode'])) {
!     $mode = COM_applyFilter ($_POST['mode']);
  }
! else if (isset ($_GET['mode'])) {
!     $mode = COM_applyFilter ($_GET['mode']);
  }
  $display = '';
  
! if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
      switch ($mode) {
      case 'edit':
          $display .= COM_siteHeader ('menu', $LANG04[16]);
!         $msg = COM_applyFilter ($_GET['msg'], true);
          if ($msg > 0) {
              $display .= COM_showMessage ($msg);
***************
*** 1102,1117 ****
          $display .= COM_siteFooter();
          break;
      case 'saveuser':
!         $display .= saveuser($HTTP_POST_VARS);
          PLG_profileExtrasSave ();
          break;
      case 'savepreferences':
!         savepreferences ($HTTP_POST_VARS);
          $display .= COM_refresh ($_CONF['site_url']
                                   . '/usersettings.php?mode=preferences&msg=6');
          break;
      case 'confirmdelete':
          if (($_CONF['allow_account_delete'] == 1) && ($_USER['uid'] > 1)) {
!             $accountId = COM_applyFilter ($HTTP_POST_VARS['account_id']);
              if (!empty ($accountId)) {
                  $display .= confirmAccountDelete ($accountId);
--- 1092,1110 ----
          $display .= COM_siteFooter();
          break;
+ 
      case 'saveuser':
!         $display .= saveuser($_POST);
          PLG_profileExtrasSave ();
          break;
+ 
      case 'savepreferences':
!         savepreferences ($_POST);
          $display .= COM_refresh ($_CONF['site_url']
                                   . '/usersettings.php?mode=preferences&msg=6');
          break;
+ 
      case 'confirmdelete':
          if (($_CONF['allow_account_delete'] == 1) && ($_USER['uid'] > 1)) {
!             $accountId = COM_applyFilter ($_POST['account_id']);
              if (!empty ($accountId)) {
                  $display .= confirmAccountDelete ($accountId);
***************
*** 1123,1129 ****
          }
          break;
      case 'deleteconfirmed':
          if (($_CONF['allow_account_delete'] == 1) && ($_USER['uid'] > 1)) {
!             $accountId = COM_applyFilter ($HTTP_POST_VARS['account_id']);
              if (!empty ($accountId)) {
                  $display .= deleteUserAccount ($accountId);
--- 1116,1123 ----
          }
          break;
+ 
      case 'deleteconfirmed':
          if (($_CONF['allow_account_delete'] == 1) && ($_USER['uid'] > 1)) {
!             $accountId = COM_applyFilter ($_POST['account_id']);
              if (!empty ($accountId)) {
                  $display .= deleteUserAccount ($accountId);
***************
*** 1135,1157 ****
          }
          break;
      case 'plugin':
!         PLG_profileExtrasSave ($HTTP_POST_VARS['plugin']);
          $display = COM_refresh ($_CONF['site_url']
                                  . '/usersettings.php?mode=edit&msg=5');
          break;
!     default:
!         $display = COM_refresh($_CONF['site_url'] . '/index.php');
          break;
      }
  } else {
!     if ($mode == 'preferences') {
!         $display .= COM_siteHeader('menu');
!         $display .= COM_startBlock($LANG04[70] . '!');
!         $display .= '<br>' . $LANG04[71] . '<br><br>';
!         $display .= COM_endBlock();
!         $display .= COM_siteFooter();
!     } else {
!         $display = COM_refresh($_CONF['site_url'] . '/index.php');
!     }
  }
  
--- 1129,1155 ----
          }
          break;
+ 
      case 'plugin':
!         PLG_profileExtrasSave ($_POST['plugin']);
          $display = COM_refresh ($_CONF['site_url']
                                  . '/usersettings.php?mode=edit&msg=5');
          break;
! 
!     default: // also if $mode == 'preferences' or 'comments'
!         $display .= COM_siteHeader ('menu', $LANG01[49]);
!         $msg = COM_applyFilter ($_GET['msg'], true);
!         if ($msg > 0) {
!             $display .= COM_showMessage ($msg);
!         }
!         $display .= editpreferences();
!         $display .= COM_siteFooter();
          break;
      }
  } else {
!     $display .= COM_siteHeader ('menu');
!     $display .= COM_startBlock ($LANG04[70] . '!');
!     $display .= '<br>' . $LANG04[71] . '<br><br>';
!     $display .= COM_endBlock ();
!     $display .= COM_siteFooter ();
  }
  




More information about the geeklog-cvs mailing list