]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/sponsor/account.php
Damn typo fixed... ;-)
[mailer.git] / inc / modules / sponsor / account.php
index a228a9aef92cfec6bbd93d02ad328cc2ace43225..dea2bdb1565b24c5879bbd61f111816157437db6 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Der Sponsor kann sein Account verwalten          *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -35,11 +40,11 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor"))
-       addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE);
+       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       addFatalMessage(SPONSOR_ONLY_AREA_ENTERED);
+       addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
        return;
 }
 
@@ -50,41 +55,43 @@ phone, fax, cell, email, url,
 status, receive_warnings
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
 WHERE id='%s' AND password='%s' LIMIT 1",
- array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
+       array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
+
+// Entry found?
 if (SQL_NUMROWS($result) == 1) {
        // Load sponsor data
        $content = SQL_FETCHARRAY($result);
        if ($content['status'] == "CONFIRMED") {
                // Check if form was submitted or not
-               if (!empty($_POST['ok'])) {
+               if (IS_FORM_SENT()) {
                        // Check passwords
-                       if (empty($_POST['pass_old'])) {
+                       if (!REQUEST_ISSET_POST(('pass_old'))) {
                                // No current password entered
-                               $MSG = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
-                       } elseif (md5($_POST['pass_old']) != get_session('sponsorpass')) {
+                               $MSG = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
+                       } elseif (md5(REQUEST_POST('pass_old')) != get_session('sponsorpass')) {
                                // Entered password didn't match password in DB
-                               $MSG = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB;
-                       } elseif ((!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] != $_POST['pass2'])) {
+                               $MSG = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB');
+                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
                                // Both new passwords did not match
-                               $MSG = SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH;
-                       } elseif ((empty($_POST['pass1'])) && (!empty($_POST['pass2']))) {
+                               $MSG = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH');
+                       } elseif ((!REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
                                // No password one entered
-                               $MSG = SPONSOR_PASSWORD_ONE_EMPTY;
-                       } elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) {
+                               $MSG = getMessage('SPONSOR_PASSWORD_ONE_EMPTY');
+                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass2')))) {
                                // No password two entered
-                               $MSG = SPONSOR_PASSWORD_TWO_EMPTY;
-                       } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) {
+                               $MSG = getMessage('SPONSOR_PASSWORD_TWO_EMPTY');
+                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
                                // Too short password
-                               $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.getConfig('pass_len').SPONSOR_PASSWORD_TOO_SHORT_2;
+                               $MSG = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
                        } else {
                                // Default is we don't want to change password!
                                $PASS_AND = ""; $PASS_DATA = "";
 
                                // Check if we want to change password or not
-                               if (($_POST['pass1'] == $_POST['pass2']) && (!empty($_POST['pass1'])) && ($_POST['pass1'] != $_POST['pass_old'])) {
+                               if ((REQUEST_POST('pass1') == REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass_old'))) {
                                        // Change current password
                                        $PASS_AND  = ", password='%s'";
-                                       $PASS_DATA = md5($_POST['pass1']);
+                                       $PASS_DATA = md5(REQUEST_POST('pass1'));
                                }
 
                                // Unsecure data which we don't want here
@@ -92,14 +99,14 @@ if (SQL_NUMROWS($result) == 1) {
 
                                // Remove all (maybe spoofed) unsafe data from array
                                foreach ($UNSAFE as $remove) {
-                                       unset($_POST[$remove]);
+                                       REQUEST_UNSET_POST($remove);
                                }
 
                                // Set last change timestamp
-                               $_POST['last_change'] = time();
+                               REQUEST_SET_POST('last_change', "UNIX_TIMESTAMP()");
 
                                // Save data
-                               $MSG = SPONSOR_SAVE_DATA($_POST, $content);
+                               $MSG = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content);
                        }
 
                        if (!empty($MSG)) {
@@ -107,7 +114,7 @@ if (SQL_NUMROWS($result) == 1) {
                                $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $MSG);
                        } else {
                                // No message generated
-                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_MESSAGE_GENERATED);
+                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('SPONSOR_NO_MESSAGE_GENERATED'));
                        }
                } else {
                        // Check for gender selection
@@ -138,11 +145,11 @@ if (SQL_NUMROWS($result) == 1) {
        } else {
                // Locked or so?
                $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
-               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_FAILED_1.$STATUS.SPONSOR_ACCOUNT_FAILED_2);
+               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
        }
 } else {
        // Sponsor account not found!
-       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_404_1.get_session('sponsorid').SPONSOR_ACCOUNT_404_2);
+       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid')));
 }
 
 // Free memory