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 // Is the account there?
50 if (fetchUserData(getRequestElement('userid'))) {
51 // Delete user account
52 deleteUserAccount(getRequestElement('userid'), postRequestElement('reason'));
55 loadTemplate('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
57 // Account does not exists!
58 loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
60 } elseif (isPostRequestElementSet('no')) {
61 // Do not delete him...
62 redirectToUrl(adminCreateUserLink(getRequestElement('userid')));
63 } elseif (!isGetRequestElementSet('userid')) {
64 // Output selection form with all confirmed user accounts listed
65 addMemberSelectionBox();
67 // Realy want to delete?
68 if (fetchUserData(getRequestElement('userid'))) {
71 'email' => generateEmailLink(getUserData('email'), 'user_data'),
72 'surname' => getUserData('surname'),
73 'family' => getUserData('family'),
74 'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), getRequestElement('userid')),
75 'text' => sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), getRequestElement('userid')),
76 'userid' => getRequestElement('userid')
80 loadTemplate('admin_del_user', false, $content);
82 // Account does not exists!
83 loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");