$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
} elseif (!EXT_IS_ACTIVE('sponsor')) {
- addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('sponsor'));
+ addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('sponsor'));
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
}
// Data for the formular
-$result = SQL_QUERY_ESC("SELECT company, position, tax_ident,
-gender, surname, family, street_nr1, street_nr2, zip, city, country,
-phone, fax, cell, email, url,
-status, receive_warnings
+$result = SQL_QUERY_ESC("SELECT `company`, `position`, `tax_ident`,
+`gender`, `surname`, `family`, `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
+`phone`, `fax`, `cell`, `email`, `url`,
+`status`, `receive_warnings`
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE `id`='%s' AND password='%s' LIMIT 1",
-array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
+WHERE `id`='%s' AND `password`='%s' LIMIT 1",
+ array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Check if form was submitted or not
if (isFormSent()) {
// Check passwords
- if (!REQUEST_ISSET_POST(('pass_old'))) {
+ if (!REQUEST_ISSET_POST('pass_old')) {
// No current password entered
$message = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
} elseif (md5(REQUEST_POST('pass_old')) != getSession('sponsorpass')) {
// Entered password didn't match password in DB
$message = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB');
- } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
+ } elseif ((REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2')) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
// Both new passwords did not match
$message = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH');
- } elseif ((!REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
+ } elseif ((!REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2'))) {
// No password one entered
$message = getMessage('SPONSOR_PASSWORD_ONE_EMPTY');
- } elseif ((REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass2')))) {
+ } elseif ((REQUEST_ISSET_POST('pass1')) && (!REQUEST_ISSET_POST('pass2'))) {
// No password two entered
$message = getMessage('SPONSOR_PASSWORD_TWO_EMPTY');
- } elseif ((REQUEST_ISSET_POST(('pass1'))) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
+ } elseif ((REQUEST_ISSET_POST('pass1')) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
// Too short password
$message = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
} else {
$PASS_AND = ''; $PASS_DATA = '';
// Check if we want to change password or not
- if ((REQUEST_POST('pass1') == REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_POST('pass1') != REQUEST_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(REQUEST_POST('pass1'));
// Check for gender selection
switch ($content['gender'])
{
- case "M": // Male
+ case 'M': // Male
define('__GENDER_M', ' selected="selected"');
define('__GENDER_F', '');
define('__GENDER_C', '');
break;
- case "F": // Female
+ case 'F': // Female
define('__GENDER_M', '');
define('__GENDER_F', ' selected="selected"');
define('__GENDER_C', '');
break;
- case "C": // Company
+ case 'C': // Company
define('__GENDER_M', '');
define('__GENDER_F', '');
define('__GENDER_C', ' selected="selected"');
}
// Output formular
- $OUT = LOAD_TEMPLATE("sponsor_account_form", true, $content);
+ $OUT = LOAD_TEMPLATE('sponsor_account_form', true, $content);
}
} else {
// Locked or so?