X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-user_contct.php;h=93ed6696dfb1e8c2c0812fbb9937a5b8cb81880d;hp=33bdd57b2410377457fdd595c5135a3dbcc8b04f;hb=c3b4eaf29946349ff058691db2dcb615a5379bb2;hpb=cca98f57dff720b174d21d071cee8303462485d7 diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index 33bdd57b24..93ed6696df 100644 --- a/inc/modules/admin/what-user_contct.php +++ b/inc/modules/admin/what-user_contct.php @@ -1,7 +1,7 @@ 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 ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('userid')) > 0)) { // Is a user account found? - if (SQL_NUMROWS($result) == 1) { + if (fetchUserData(getRequestParameter('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(getRequestParameter('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(postRequestParameter('text'))); + + // Load email template + $message = loadEmailTemplate('member_contct', $content, getRequestParameter('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['email'], '{--ADMIN_CONTACT_USER_SUBJECT--}', $message); + + // Display message + loadTemplate('admin_settings_saved', false, '{--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, getMaskedMessage('ADMIN_USER_ACCOUNT_404', bigintval(getRequestParameter('userid')))); } - - // Free result - SQL_FREERESULT($result); } else { // Display selection box - ADD_MEMBER_SELECTION_BOX(); + addMemberSelectionBox(); } -// +// [EOF] ?>