X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-user_contct.php;h=c9f523573ca39306e37bb5768d33e7396a9bda50;hp=be76d576ed91f4716981b40ceb2aa26ef0cf8d4f;hb=7c15ca79161bf475e958810a5b585bce869a2af9;hpb=75ad748a68473ace540251427a74fb781b1145e9 diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index be76d576ed..c9f523573c 100644 --- a/inc/modules/admin/what-user_contct.php +++ b/inc/modules/admin/what-user_contct.php @@ -10,9 +10,14 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Das Mitglied ueber ein Formular kontaktieren * * -------------------------------------------------------------------- * - * * + * $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, 2004, 2005, 2006, 2007 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,52 +37,44 @@ ************************************************************************/ // 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); -} +if ((!defined('__SECURITY')) || (!isAdmin())) { + die(); +} // END - if // Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); +addMenuDescription('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=%d 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'] = trim(secureString(postRequestElement('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); + $message = loadEmailTemplate('member_contct', $content); + sendEmail($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $message); + loadTemplate('admin_settings_saved', false, getMessage('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']))); + loadTemplate('admin_settings_saved', false, sprintf(getMessage('USER_ACCOUNT_404'), bigintval(getRequestElement('userid')))); } - - // Free result - SQL_FREERESULT($result); } else { // Display selection box - ADD_MEMBER_SELECTION_BOX(); + addMemberSelectionBox(); } -// +// [EOF] ?>