// Check if hash for confirmation of email address is given...
if (isGetRequestElementSet('hash')) {
// Lookup sponsor
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`id`, `status`, `gender`, `surname`, `family`,
`company`, `position`, `tax_ident`,
`street_nr1`, `street_nr2`, `country`, `zip`, `city`, `email`, `phone`, `fax`, `cell`,
`status`='EMAIL'
)
LIMIT 1", array(getRequestElement('hash')), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
+ if (sqlNumRows($result) == 1) {
// Sponsor found, load his data...
- $data = SQL_FETCHARRAY($result);
+ $data = sqlFetchArray($result);
// Unconfirmed account or changed email address?
if ($data['status'] == 'UNCONFIRMED') {
// Set account to pending
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_sponsor_data`
SET
`status`='PENDING',
), __FILE__, __LINE__);
// Check on success
- if (!SQL_HASZEROAFFECTED()) {
+ if (!ifSqlHasZeroAffectedRows()) {
// Prepare mail and send it to the sponsor
$message = loadEmailTemplate('sponsor_pending', $data);
sendEmail($data['email'], '{--SPONSOR_ACCOUNT_PENDING_SUBJECT--}', $message);
}
} elseif ($data['status'] == 'EMAIL') {
// Changed email adress need to be confirmed
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_sponsor_data`
SET
`status`='CONFIRMED',
array(bigintval($data['id']), getRequestElement('hash')), __FILE__, __LINE__);
// Check on success
- if (!SQL_HASZEROAFFECTED()) {
+ if (!ifSqlHasZeroAffectedRows()) {
// Sponsor account is unlocked again
displayMessage('{--SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN--}');
} else {
}
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} elseif ($mode == 'activate') {
// Send activation link again
if (isFormSent('login')) {
if (isFormSent('login')) {
// Check email
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`id`,
`hash`,
`status`,
array(postRequestElement('email')), __FILE__, __LINE__);
// Entry found?
- if (SQL_NUMROWS($result) == 1) {
+ if (sqlNumRows($result) == 1) {
// Unconfirmed sponsor account found so let's load the requested data
- $data = SQL_FETCHARRAY($result);
+ $data = sqlFetchArray($result);
// Translate some data
$data['sponsor_created'] = generateDateTime($data['sponsor_created']);
}
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} else {
// Load form
loadTemplate('guest_sponsor_activate');
if (isFormSent('login')) {
// Check email
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`id`,
`hash`,
`remote_addr`,
array(postRequestElement('email'), bigintval(postRequestElement('id'))), __FILE__, __LINE__);
// Entry found?
- if (SQL_NUMROWS($result) == 1) {
+ if (sqlNumRows($result) == 1) {
// Unconfirmed sponsor account found so let's load the requested data
- $content = SQL_FETCHARRAY($result);
+ $content = sqlFetchArray($result);
// Generate password/translate some data
$content['password'] = generatePassword();
sendEmail(postRequestElement('email'), '{--SPONSOR_LOST_PASSWORD_SUBJECT--}', $message_sponsor);
// Update password
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_sponsor_data`
SET
`password`='%s'
}
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} else {
// Load form
loadTemplate('guest_sponsor_lost');
}
} elseif (isFormSent('login')) {
// Check status and login data ...
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`status`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
md5(postRequestElement('password'))
), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
+ if (sqlNumRows($result) == 1) {
// Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
- list($status) = SQL_FETCHROW($result);
+ list($status) = sqlFetchRow($result);
if ($status == 'CONFIRMED') {
// Is confirmed so both is fine and we can continue with login procedure
$login = ((setSession('sponsor_id' , bigintval(postRequestElement('sponsor_id')))) &&
}
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} else {
// Login formular and other links
loadTemplate('guest_sponsor_login');