* -------------------------------------------------------------------- *
* Kurzbeschreibung : Loginformular und Neues Passwort fuer Sponsor *
* -------------------------------------------------------------------- *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Loginformular und Neues Passwort fuer Sponsor *
* -------------------------------------------------------------------- *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* -------------------------------------------------------------------- *
* 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"))) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))) {
- if (IS_ADMIN()) {
- addFatalMessage(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "sponsor"));
- } else {
- addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "sponsor");
- }
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
{
case "activate" : $MODE = "activate"; break; // Activation link requested
case "lost_pass": $MODE = "lost_pass"; break; // Request new password
{
case "activate" : $MODE = "activate"; break; // Activation link requested
case "lost_pass": $MODE = "lost_pass"; break; // Request new password
// Lookup sponsor
$result = SQL_QUERY_ESC("SELECT id, status, gender, surname, family,
company, position, tax_ident,
street_nr1, street_nr2, country, zip, city, email, phone, fax, cell,
points_amount AS points, last_pay AS pay, last_curr AS curr
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
// Lookup sponsor
$result = SQL_QUERY_ESC("SELECT id, status, gender, surname, family,
company, position, tax_ident,
street_nr1, street_nr2, country, zip, city, email, phone, fax, cell,
points_amount AS points, last_pay AS pay, last_curr AS curr
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE hash='%s' AND (status='UNCONFIRMED' OR status='EMAIL')
-LIMIT 1", array($_GET['hash']), __FILE__, __LINE__);
+WHERE hash='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL')
+LIMIT 1", array(REQUEST_GET('hash')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Sponsor found, load his data...
$SPONSOR = SQL_FETCHARRAY($result);
if (SQL_NUMROWS($result) == 1) {
// Sponsor found, load his data...
$SPONSOR = SQL_FETCHARRAY($result);
// Unconfirmed account or changed email address?
if ($SPONSOR['status'] == "UNCONFIRMED") {
// Set account to pending
// Unconfirmed account or changed email address?
if ($SPONSOR['status'] == "UNCONFIRMED") {
// Set account to pending
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='PENDING'
-WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1",
- array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='PENDING'
+WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
+ array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
// Check on success
if (SQL_AFFECTEDROWS() == 1) {
// Prepare mail and send it to the sponsor
$MSG = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR);
// Check on success
if (SQL_AFFECTEDROWS() == 1) {
// Prepare mail and send it to the sponsor
$MSG = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR);
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED'
-WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1",
- array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='CONFIRMED'
+WHERE id='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
+ array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
- array($_POST['email']), __FILE__, __LINE__);
+WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
+ array(REQUEST_POST('email')), __FILE__, __LINE__);
// Confirmed email address
$msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
}
// Confirmed email address
$msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
}
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1",
- array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__);
+WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
+ array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Unconfirmed sponsor account found so let's load the requested data
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Unconfirmed sponsor account found so let's load the requested data
// Prepare email and send it to the sponsor
$msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
// Prepare email and send it to the sponsor
$msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
// Output message
array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
// Output message
// Check status and login data ...
$result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
// Check status and login data ...
$result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
- array(bigintval($_POST['sponsorid']), md5($_POST['pass'])), __FILE__, __LINE__);
+ array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
list($status) = SQL_FETCHROW($result);
if ($status == "CONFIRMED") {
// Is confirmed so both is fine and we can continue with login procedure
if (SQL_NUMROWS($result) == 1) {
// Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
list($status) = SQL_FETCHROW($result);
if ($status == "CONFIRMED") {
// Is confirmed so both is fine and we can continue with login procedure
- $login = ((set_session('sponsorid' , bigintval($_POST['sponsorid']))) &&
- (set_session('sponsorpass', md5($_POST['pass']) ))
+ $login = ((set_session('sponsorid' , bigintval(REQUEST_POST('sponsorid')))) &&
+ (set_session('sponsorpass', md5(REQUEST_POST('pass')) ))
// Status is not fine
$content = constant('SPONSOR_LOGIN_FAILED_'.strtoupper($status).'');
LOAD_TEMPLATE("admin_settings_saved", false, $content);
// Status is not fine
$content = constant('SPONSOR_LOGIN_FAILED_'.strtoupper($status).'');
LOAD_TEMPLATE("admin_settings_saved", false, $content);
// Login formular and other links
LOAD_TEMPLATE("guest_sponsor_login");
}
} else {
// Account missing or wrong pass! We shall not find this out for the "hacker folks"...
// Login formular and other links
LOAD_TEMPLATE("guest_sponsor_login");
}
} else {
// Account missing or wrong pass! We shall not find this out for the "hacker folks"...