]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-order.php
Direct registration added, typo fixed, admin session on missing/failed login fixed...
[mailer.git] / inc / modules / member / what-order.php
index 462f6bad3ca594836d96eb94ba61ee24a80a61b8..1f216e16b72a314189dd5c00b6e46a1c7ce3f801 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
+ADD_DESCR("member", __FILE__);
 
 $URL = ""; $id = 0;
 $whereStatement = " WHERE visible='Y'";
@@ -53,14 +53,7 @@ if (empty($_GET['msg']))       $_GET['msg']       = "";
 if (empty($_POST['zip']))      $_POST['zip']      = "";
 if (empty($_POST['html']))     $_POST['html']     = "";
 if (empty($_POST['receiver'])) $_POST['receiver'] = "";
-if (is_admin()) $whereStatement = "";
-
-// Add slashes to every value
-foreach($_POST as $key => $value)
-{
-       // Skip submit buttons
-       if (($key != "data") && ($key != "frametester")) $_POST[$key] = addslashes($value);
-}
+if (IS_ADMIN()) $whereStatement = "";
 
 // Minimum mails / order
 define('__MIN_VALUE', $_CONFIG['order_min']);
@@ -138,7 +131,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
                                // URL found!
                                $URL = URL."/modules.php?module=login&what=order&msg=".CODE_URL_FOUND;
                        }
-                       $TEST = str_replace("\n", "", str_replace("\r", "", addslashes($_POST['text'])));
+                       $TEST = str_replace("\n", "", str_replace("\r", "", $_POST['text']));
                        if (strlen($TEST) > $_CONFIG['max_tlength'])
                        {
                                // Text is too long!
@@ -211,14 +204,16 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
        {
                // Check if category and number of receivers is okay
                $ADD = "";
-               if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) $ADD = "AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
+               if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) {
+                       // Choose recipients by ZIP code
+                       $ADD = " AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
+               } // END - if
 
                // Check for userids
                $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM "._MYSQL_PREFIX."_user_cats AS c
 LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON c.userid=d.userid
-WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0
-".$ADD."
+WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0".$ADD."
 ORDER BY d.%s %s",
  array(
        bigintval($_POST['cat']),
@@ -297,8 +292,8 @@ WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIME
  VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s','%s')",
 array(
        $GLOBALS['userid'],
-       addslashes($_POST['subject']),
-       addslashes($_POST['text']),
+       $_POST['subject'],
+       $_POST['text'],
        $RECEIVER,
        bigintval($_POST['type']),
        $TIME,
@@ -316,8 +311,8 @@ array(
  VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s')",
 array(
        $GLOBALS['userid'],
-       addslashes($_POST['subject']),
-       addslashes($_POST['text']),
+       $_POST['subject'],
+       $_POST['text'],
        $RECEIVER,
        bigintval($_POST['type']),
        $TIME,