2 /************************************************************************
3 * MXChange v0.2.1 Start: 09/28/2003 *
4 * =============== Last change: 06/10/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-del_user.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Delete members *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Mitglieder loeschen *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!isAdmin())) {
44 // Display only title when no form was submitted
45 addMenuDescription('admin', __FILE__);
48 if ((isFormSent()) || ((isPostRequestElementSet('del')) && (isPostRequestElementSet(('reason'))))) {
49 // Delete users account
50 $result_user = SQL_QUERY_ESC("SELECT userid FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
51 array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
52 if (SQL_NUMROWS($result_user) == 1) {
54 SQL_FREERESULT($result_user);
56 // Delete user account
57 deleteUserAccount(getRequestElement('userid'), postRequestElement('reason'));
60 loadTemplate('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
62 // Account does not exists!
63 loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
65 } elseif (isPostRequestElementSet('no')) {
66 // Do not delete him...
67 redirectToUrl(adminCreateUserLink(getRequestElement('userid')));
68 } elseif (!isGetRequestElementSet('userid')) {
69 // Output selection form with all confirmed user accounts listed
70 addMemberSelectionBox();
72 // Realy want to delete?
73 $result = SQL_QUERY_ESC("SELECT `email`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
74 array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
77 if (SQL_NUMROWS($result) == 1) {
79 list ($email, $surname, $family) = SQL_FETCHROW($result);
83 'email' => generateEmailLink($email, 'user_data'),
84 'surname' => $surname,
86 'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), getRequestElement('userid')),
87 'text' => sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), getRequestElement('userid')),
88 'userid' => getRequestElement('userid')
92 loadTemplate('admin_del_user', false, $content);
94 // Account does not exists!
95 loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
99 SQL_FREERESULT($result);