]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/sponsor/settings.php
Even more rewrites/fixes from EL branch (please report any broken part after you...
[mailer.git] / inc / modules / sponsor / settings.php
index eea9919374076586dfa1ba5615bcd8f09d8eeea4..f49a345912321f9c8795c58b7f23422c7f7befe8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/11/2005 *
- * ===============                              Last change: 05/19/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 10/11/2005 *
+ * ===================                          Last change: 05/19/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : settings.php                                     *
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -57,7 +58,8 @@ $result = SQL_QUERY_ESC("SELECT
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 WHERE
-       `id`='%s' AND `password`='%s'
+       `id`=%s AND
+       `password`='%s'
 LIMIT 1",
        array(
                bigintval(getSession('sponsorid')),
@@ -71,10 +73,10 @@ if (SQL_NUMROWS($result) == 1) {
                // Check if form was submitted or not
                if (isFormSent()) {
                        // Check passwords
-                       if (!isPostRequestElementSet('password')) {
+                       if (!isPostRequestParameterSet('password')) {
                                // No current password entered
                                $message = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
-                       } elseif (md5(postRequestElement('password')) != getSession('sponsorpass')) {
+                       } elseif (md5(postRequestParameter('password')) != getSession('sponsorpass')) {
                                // Entered password didn't match password in DB
                                $message = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB;
                        } else {
@@ -87,11 +89,11 @@ if (SQL_NUMROWS($result) == 1) {
 
                                // Remove all (maybe spoofed) unsafe data from array
                                foreach ($UNSAFE as $remove) {
-                                       unsetPostRequestElement($remove);
+                                       unsetPostRequestParameter($remove);
                                } // END - if
 
                                // Set last change timestamp
-                               setRequestPostElement('last_change', 'UNIX_TIMESTAMP()');
+                               setPostRequestParameter('last_change', 'UNIX_TIMESTAMP()');
 
                                // Save data
                                $message = saveSponsorData(postRequestArray(), $content);
@@ -110,20 +112,17 @@ if (SQL_NUMROWS($result) == 1) {
                        $content['receive_warnings_n'] = '';
                        $content['receive_warnings_' . strtolower($content['receive_warnings'])] = ' checked="checked"';
 
-                       // Translate current interval into fancy string
-                       $content['current'] = createFancyTime($content['warning_interval']);
-
                        // Output formular
                        $OUT = loadTemplate('sponsor_settings_form', true, $content);
                }
        } else {
                // Locked or so?
                $STATUS = sponsorTranslateUserStatus($content['status']);
-               $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
+               $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_FAILED', $STATUS));
        }
 } else {
        // Sponsor account not found!
-       $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), getSession('sponsorid')));
+       $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsorid')));
 }
 
 // Free memory