]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-edit_user.php
Continued:
[mailer.git] / inc / modules / admin / what-edit_user.php
index 1288289943c50d535668c31e6dd8e84df7677040..2d5128f9e3d3e31cd211e693668ba3edf30675c8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/28/2003 *
- * ===============                              Last change: 06/10/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 09/28/2003 *
+ * ===================                          Last change: 06/10/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-edit_user.php                               *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * @TODO Add support for ext-country                                    *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -44,14 +43,14 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
 // Fix a notice
-$result_main = false;
+$result_main = FALSE;
 if (isGetRequestElementSet('userid')) {
        // Load user entry
-       $result_main = SQL_QUERY_ESC("SELECT
-       `userid`, `gender`, `surname`, `family`, `street_nr`, `zip`, `city`, `country`,
+       $result_main = sqlQueryEscaped("SELECT
+       `userid`, `sex`, `surname`, `family`, `street_nr`, `zip`, `city`, `country`,
        `email`,
        `birth_day`, `birth_month`, `birth_year`,
        `max_mails`
@@ -65,38 +64,42 @@ LIMIT 1",
                ), __FILE__, __LINE__);
 } // END - if
 
-if ((SQL_NUMROWS($result_main) == 1) || (!isGetRequestElementSet('userid'))) {
+if ((!isGetRequestElementSet('userid')) || (sqlNumRows($result_main) == 1)) {
        // User found
        if (!isGetRequestElementSet('userid')) {
                // Output selection form with all confirmed user accounts listed
                addMemberSelectionBox();
-       } elseif (isPostRequestElementSet('edit')) {
+       } elseif (isFormSent('edit')) {
                // Ok, change the account...
-               $updateUser = false; $add = '';
-               if ((!isPostRequestElementSet('pass1')) && (!isPostRequestElementSet('pass2'))) {
+               $updateUser = FALSE; $add = '';
+               if ((!isPostRequestElementSet('password1')) && (!isPostRequestElementSet('password2'))) {
                        // Don't change the password
-                       $updateUser = true;
-               } elseif ((postRequestElement('pass1') == postRequestElement('pass2'))) {
+                       $updateUser = TRUE;
+               } elseif ((postRequestElement('password1') == postRequestElement('password2'))) {
                        // Change the password
-                       $updateUser = true;
-                       $add = ", `password`='" . generateHash(postRequestElement('pass1')) . "'";
+                       $updateUser = TRUE;
+                       $add = ",`password`='" . generateHash(postRequestElement('password1')) . "'";
                }
 
-               if ($updateUser === true) {
+               if ($updateUser === TRUE) {
                        // We have to add the following things: birthday and max receive mails
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET
-`gender`='%s',
-`surname`='%s',
-`family`='%s',
-`street_nr`='%s',
-`country`='%s',
-`zip`=%s,
-`city`='%s',
-`email`='%s'
-".$add."
-WHERE `userid`=%s LIMIT 1",
+                       sqlQueryEscaped("UPDATE
+       `{?_MYSQL_PREFIX?}_user_data`
+SET
+       `sex`='%s',
+       `surname`='%s',
+       `family`='%s',
+       `street_nr`='%s',
+       `country`='%s',
+       `zip`=%s,
+       `city`='%s',
+       `email`='%s'
+       ".$add."
+WHERE
+       `userid`=%s
+LIMIT 1",
                        array(
-                               substr(postRequestElement('gender'), 0, 1),
+                               substr(postRequestElement('sex'), 0, 1),
                                postRequestElement('surname'),
                                postRequestElement('family'),
                                postRequestElement('street_nr'),
@@ -106,36 +109,28 @@ WHERE `userid`=%s LIMIT 1",
                                postRequestElement('email'),
                                bigintval(getRequestElement('userid')),
                        ), __FILE__, __LINE__);
-                       $content = getMessage('USER_ACCOUNT_SAVED');
+                       $content = '{--ADMIN_USER_ACCOUNT_SAVED--}';
                } else {
                        // Problem while saving data
-                       $content = getMessage('USER_ACCOUNT_NOT_SAVED');
+                       $content = '{--ADMIN_USER_ACCOUNT_NOT_SAVED--}';
                }
 
                // Load template
-               loadTemplate('admin_settings_saved', false, $content);
+               displayMessage($content);
        } else {
                // Load entry
-               $content = SQL_FETCHARRAY($result_main);
-
-               // Init entries
-               foreach (array('gender_m','gender_f','gender_c') as $entry) {
-                       $content[$entry] = '';
-               } // END - foreach
-
-               // Prepare selections
-               $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
+               $content = sqlFetchArray($result_main);
 
                // Load template
-               loadTemplate('admin_edit_user', false, $content);
+               loadTemplate('admin_edit_user', FALSE, $content);
        }
 } else {
        // Account does not exists!
-       loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+       displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
 }
 
 // Free the result
-SQL_FREERESULT($result_main);
+sqlFreeResult($result_main);
 
 // [EOF]
 ?>