<?php
/************************************************************************
- * MXChange v0.2.1 Start: 01/29/2008 *
- * ================ Last change: 01/29/2008 *
+ * Mailer v0.2.1-FINAL Start: 01/29/2008 *
+ * =================== Last change: 01/29/2008 *
* *
* -------------------------------------------------------------------- *
* File : what-user_contct.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Das Mitglied ueber ein Formular kontaktieren *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * 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 - 2011 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
// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addYouAreHereLink('admin', __FILE__);
// Is a user id given?
-if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) {
- // Load user data and display it
- $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
-
+if ((isGetRequestElementSet('userid')) && (bigintval(getRequestElement('userid')) > 0)) {
// Is a user account found?
- if (SQL_NUMROWS($result) == 1) {
+ if (fetchUserData(getRequestElement('userid'))) {
// Load the data
- $content = SQL_FETCHARRAY($result);
+ $content = getUserDataArray();
- // Including user ID
- $content['u_id'] = bigintval($_GET['u_id']);
+ // Including user id
+ $content['userid'] = bigintval(getRequestElement('userid'));
// Shall we send the email?
- if (isset($_POST['ok'])) {
+ if (isFormSent()) {
// Insert text
- $content['text'] = trim(strip_tags($_POST['text']));
+ $content['text'] = postRequestElement('text');
+
+ // Load email template
+ $message = loadEmailTemplate('member_contct', $content, getRequestElement('userid'));
// Send contact form out
- $msg = LOAD_EMAIL_TEMPLATE("member_contct", $content);
- SEND_EMAIL($content['email'], ADMIN_CONTACT_USER_SUBJECT, $msg);
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_USER_CONTACTED);
+ sendEmail($content['userid'], '{--ADMIN_CONTACT_USER_SUBJECT--}', $message);
+
+ // Display message
+ displayMessage('{--ADMIN_USER_CONTACTED--}');
} else {
// Load contact form template
- LOAD_TEMPLATE("admin_contct_user_form", false, $content);
+ loadTemplate('admin_contct_user_form', false, $content);
}
} else {
// Not found?
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(USER_ACCOUNT_404, bigintval($_GET['u_id'])));
+ displayMessage('{%message,ADMIN_USER_ACCOUNT_404=' . bigintval(getRequestElement('userid')) . '%}');
}
-
- // Free result
- SQL_FREERESULT($result);
} else {
// Display selection box
- ADD_MEMBER_SELECTION_BOX();
+ addMemberSelectionBox();
}
-//
+// [EOF]
?>