* -------------------------------------------------------------------- *
* Kurzbeschreibung : Der Sponsor kann sein Account verwalten *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: 856 $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: stelzi $ *
+ * 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 *
$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;
}
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
// 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)) {
$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
} 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