--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 01/29/2008 *
+ * ================ Last change: 01/29/2008 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-user_contct.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Contact the user over a form *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Das Mitglied ueber ein Formular kontaktieren *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder *
+ * For more information visit: http://www.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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__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=%d LIMIT 1",
+ array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+
+ // Is a user account found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load the data
+ $content = SQL_FETCHARRAY($result);
+
+ // Including user ID
+ $content['u_id'] = bigintval($_GET['u_id']);
+
+ // Shall we send the email?
+ if (isset($_POST['ok'])) {
+ // Insert text
+ $content['text'] = trim(strip_tags($_POST['text']));
+
+ // 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);
+ } else {
+ // Load contact form template
+ LOAD_TEMPLATE("admin_contct_user_form", false, $content);
+ }
+ } else {
+ // Not found?
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(USER_ACCOUNT_404, bigintval($_GET['u_id'])));
+ }
+
+ // Free result
+ SQL_FREERESULT($result);
+} else {
+ // Display selection box
+ ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>