X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-user_contct.php;h=f040f8fe9f31f17d4899a51cedd35e8e6c5c9fa5;hb=6b1e55213d76a67e9aa3d9f1e4dcb55e0bbf12ee;hp=98ffbbc2193c8f15d1bf873077cd9babdef479d4;hpb=414570c5081d337bb6c28dcf521bd8bca02f69e7;p=mailer.git diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index 98ffbbc219..f040f8fe9f 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(REQUEST_GET('uid'))), __FILE__, __LINE__); - +if ((isGetRequestElementSet('userid')) && (isValidId(getRequestElement('userid')))) { // 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['uid'] = bigintval(REQUEST_GET('uid')); + // Including user id + $content['userid'] = bigintval(getRequestElement('userid')); // Shall we send the email? - if (IS_FORM_SENT()) { + if (isFormSent()) { // Insert text - $content['text'] = trim(strip_tags(REQUEST_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'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $msg); - LOAD_TEMPLATE("admin_settings_saved", false, getMessage('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(REQUEST_GET('uid')))); + displayMessage('{%message,ADMIN_USER_ACCOUNT_404=' . bigintval(getRequestElement('userid')) . '%}'); } - - // Free result - SQL_FREERESULT($result); } else { // Display selection box - ADD_MEMBER_SELECTION_BOX(); + addMemberSelectionBox(); } -// +// [EOF] ?>