X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-del_user.php;h=56e14dfc3a8521b49b3a5ebe8d8bf4ba835d82ad;hb=eb301334eb0960dd060cc0d59e6021260a41f835;hp=f3b27c75ff65e2960bd3dbe3ff7dc8240c51f357;hpb=7c9cf221f2f7ef99d45fc233bf346c9f9168ef3e;p=mailer.git
diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php
index f3b27c75ff..56e14dfc3a 100644
--- a/inc/modules/admin/what-del_user.php
+++ b/inc/modules/admin/what-del_user.php
@@ -10,9 +10,14 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Mitglieder loeschen *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $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!!!!!! *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -32,57 +37,66 @@
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Display only title when no form was submitted
-ADD_DESCR("admin", __FILE__);
+addMenuDescription('admin', __FILE__);
// User exists..
-if ((isset($_POST['ok'])) || ((isset($_POST['del'])) && (!empty($_POST['reason'])))) {
+if ((isFormSent()) || ((isPostRequestElementSet('del')) && (isPostRequestElementSet(('reason'))))) {
// Delete users account
- $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+ $result_user = SQL_QUERY_ESC("SELECT userid FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result_user) == 1) {
// Free memory
SQL_FREERESULT($result_user);
// Delete user account
- DELETE_USER_ACCOUNT(bigintval($_GET['u_id']), $_POST['reason']);
- LOAD_TEMPLATE("admin_settings_saved", false, "
".ADMIN_DEL_COMPLETED."
");
+ deleteUserAccount(getRequestElement('userid'), postRequestElement('reason'));
+
+ // Output message
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
} else {
// Account does not exists!
- LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."
");
+ loadTemplate('admin_settings_saved', false, "".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."
");
}
-} elseif (!empty($_POST['no'])) {
+} elseif (isPostRequestElementSet('no')) {
// Do not delete him...
- LOAD_URL("modules.php?module=admin&what=list_user&u_id=".$_GET['u_id']);
-} elseif (empty($_GET['u_id'])) {
+ redirectToUrl(adminCreateUserLink(getRequestElement('userid')));
+} elseif (!isGetRequestElementSet('userid')) {
// Output selection form with all confirmed user accounts listed
- ADD_MEMBER_SELECTION_BOX();
+ addMemberSelectionBox();
} else {
// Realy want to delete?
- $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `email`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
+
+ // Found a row?
if (SQL_NUMROWS($result) == 1) {
// Load data
- list ($email, $sname, $fname) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ list ($email, $surname, $family) = SQL_FETCHROW($result);
- // Transfer data to constants for the template
- define('__EMAIL', CREATE_EMAIL_LINK($email, "user_data"));
- define('__SNAME', $sname);
- define('__FNAME', $fname);
- define('__UID' , $_GET['u_id']);
+ // Prepare content
+ $content = array(
+ 'email' => generateEmailLink($email, 'user_data'),
+ 'surname' => $surname,
+ 'family' => $family,
+ 'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), getRequestElement('userid')),
+ 'text' => sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), getRequestElement('userid')),
+ 'userid' => getRequestElement('userid')
+ );
// Display form
- LOAD_TEMPLATE("admin_del_user");
+ loadTemplate('admin_del_user', false, $content);
} else {
// Account does not exists!
- LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."
");
+ loadTemplate('admin_settings_saved', false, "".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."
");
}
+
+ // Free the result
+ SQL_FREERESULT($result);
}
//