<?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 *
* 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 *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
************************************************************************/
// 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 ((IS_FORM_SENT()) || ((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('del')) && (isPostRequestParameterSet('reason')))) {
+ // Is the account there?
+ if (fetchUserData(getRequestParameter('userid'))) {
// Delete user account
- DELETE_USER_ACCOUNT(REQUEST_GET('uid'), REQUEST_POST('reason'));
+ deleteUserAccount(getRequestParameter('userid'), postRequestParameter('reason'));
// Output message
- LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_DEL_COMPLETED'));
+ loadTemplate('admin_settings_saved', false, '{--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, getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))));
}
-} elseif (REQUEST_ISSET_POST(('no'))) {
+} elseif (isPostRequestParameterSet('no')) {
// Do not delete him...
- LOAD_URL(ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid')));
-} elseif (!REQUEST_ISSET_GET(('uid'))) {
+ redirectToUrl(adminCreateUserLink(getRequestParameter('userid')));
+} elseif (!isGetRequestParameterSet('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__);
- if (SQL_NUMROWS($result) == 1) {
- // Load data
- list ($email, $sname, $fname) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
+ if (fetchUserData(getRequestParameter('userid'))) {
// Prepare content
$content = array(
- 'email' => CREATE_EMAIL_LINK($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'))
+ 'email' => generateEmailLink(getUserData('email'), 'user_data'),
+ 'userid' => bigintval(getRequestParameter('userid'))
);
// Display form
- LOAD_TEMPLATE("admin_del_user", false, $content);
+ loadTemplate('admin_del_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, getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))));
}
}
-//
+// [EOF]
?>