<?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-del_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!!!!!! *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 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 *
************************************************************************/
// 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__);
+addYouAreHereLink('admin', __FILE__);
// User exists..
-if ((isFormSent()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('reason'))))) {
- // Delete users account
- $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_user) == 1) {
- // Free memory
- SQL_FREERESULT($result_user);
-
+if ((isFormSent()) || ((isFormSent('delete')) && (isPostRequestElementSet('reason')))) {
+ // Is the account there?
+ if (fetchUserData(getRequestElement('userid'))) {
// Delete user account
- deleteUserAccount(REQUEST_GET('uid'), REQUEST_POST('reason'));
+ deleteUserAccount(getRequestElement('userid'), postRequestElement('reason'));
// Output message
- LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
+ displayMessage('{--ADMIN_DELETE_COMPLETED--}');
} else {
// Account does not exists!
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
}
-} elseif (REQUEST_ISSET_POST('no')) {
+} elseif (isPostRequestElementSet('no')) {
// Do not delete him...
- redirectToUrl(ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid')));
-} elseif (!REQUEST_ISSET_GET('uid')) {
+ 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(REQUEST_GET('uid'))), __FILE__, __LINE__);
-
- // Found a row?
- if (SQL_NUMROWS($result) == 1) {
- // Load data
- list ($email, $sname, $fname) = SQL_FETCHROW($result);
-
+ if (fetchUserData(getRequestElement('userid'))) {
// Prepare content
$content = array(
- 'email' => generateEmailLink($email, 'user_data'),
- 'surname' => $sname,
- 'family' => $fname,
- 'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), REQUEST_GET('uid')),
- 'text' => sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), REQUEST_GET('uid')),
- 'userid' => REQUEST_GET('uid')
+ 'email' => generateEmailLink(getUserData('email'), 'user_data'),
+ 'userid' => bigintval(getRequestElement('userid'))
);
// Display form
- LOAD_TEMPLATE('admin_del_user', false, $content);
+ loadTemplate('admin_delete_user', FALSE, $content);
} else {
// Account does not exists!
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
}
-
- // Free the result
- SQL_FREERESULT($result);
}
-//
+// [EOF]
?>