2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 09/28/2003 *
4 * =================== Last change: 06/10/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-edit_user.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Edit member's profiles *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Mitgliederprofile aendern *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * @TODO Add support for ext-country *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * Copyright (c) 2009 - 2011 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if ((!defined('__SECURITY')) || (!isAdmin())) {
45 // Add description as navigation point
46 addYouAreHereLink('admin', __FILE__);
50 if (isGetRequestParameterSet('userid')) {
52 $result_main = SQL_QUERY_ESC("SELECT
53 `userid`, `gender`, `surname`, `family`, `street_nr`, `zip`, `city`, `country`,
55 `birth_day`, `birth_month`, `birth_year`,
58 `{?_MYSQL_PREFIX?}_user_data`
63 bigintval(getRequestParameter('userid'))
64 ), __FILE__, __LINE__);
67 if ((!isGetRequestParameterSet('userid')) || (SQL_NUMROWS($result_main) == 1)) {
69 if (!isGetRequestParameterSet('userid')) {
70 // Output selection form with all confirmed user accounts listed
71 addMemberSelectionBox();
72 } elseif (isFormSent('edit')) {
73 // Ok, change the account...
74 $updateUser = false; $add = '';
75 if ((!isPostRequestParameterSet('pass1')) && (!isPostRequestParameterSet('pass2'))) {
76 // Don't change the password
78 } elseif ((postRequestParameter('pass1') == postRequestParameter('pass2'))) {
79 // Change the password
81 $add = ", `password`='" . generateHash(postRequestParameter('pass1')) . "'";
84 if ($updateUser === true) {
85 // We have to add the following things: birthday and max receive mails
87 `{?_MYSQL_PREFIX?}_user_data`
102 substr(postRequestParameter('gender'), 0, 1),
103 postRequestParameter('surname'),
104 postRequestParameter('family'),
105 postRequestParameter('street_nr'),
106 postRequestParameter('country'),
107 bigintval(postRequestParameter('zip')),
108 postRequestParameter('city'),
109 postRequestParameter('email'),
110 bigintval(getRequestParameter('userid')),
111 ), __FILE__, __LINE__);
112 $content = '{--ADMIN_USER_ACCOUNT_SAVED--}';
114 // Problem while saving data
115 $content = '{--ADMIN_USER_ACCOUNT_NOT_SAVED--}';
119 displayMessage($content);
122 $content = SQL_FETCHARRAY($result_main);
125 loadTemplate('admin_edit_user', false, $content);
128 // Account does not exists!
129 loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestParameter('userid')) . '%}');
133 SQL_FREERESULT($result_main);