]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-user_contct.php
Complete rewrite of and , wrapper functions added, see bug #101
[mailer.git] / inc / modules / admin / what-user_contct.php
index 4475fed1d567c8ef5d398b2e3ea6d4097a3588a5..0fda63c56a1715cad9337df707d8f8921f11f562 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!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__));
+ADD_DESCR("admin", __FILE__);
 
 // Is a user id given?
-if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) {
+if ((REQUEST_ISSET_GET(('uid'))) && (bigintval(REQUEST_GET('uid')) > 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__);
+       $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__);
 
        // Is a user account found?
        if (SQL_NUMROWS($result) == 1) {
@@ -52,24 +52,24 @@ if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) {
                $content = SQL_FETCHARRAY($result);
 
                // Including user ID
-               $content['u_id'] = bigintval($_GET['u_id']);
+               $content['uid'] = bigintval(REQUEST_GET('uid'));
 
                // Shall we send the email?
-               if (isset($_POST['ok'])) {
+               if (IS_FORM_SENT()) {
                        // Insert text
-                       $content['text'] = trim(strip_tags($_POST['text']));
+                       $content['text'] = trim(strip_tags(REQUEST_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);
+                       SEND_EMAIL($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $msg);
+                       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('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'])));
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(USER_ACCOUNT_404, bigintval(REQUEST_GET('uid'))));
        }
 
        // Free result