// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set module
$GLOBALS['module'] = 'doubler';
// Only check this if refid is provided!
if ($GLOBALS['refid'] > 0) {
- // Probe for nickname extension and if a nickname was supplied by URL
- $probe_nickname = ((EXT_IS_ACTIVE('nickname')) && ((''.round($GLOBALS['refid']).'') != $GLOBALS['refid']));
-
// Do we have nickname or userid set?
- if ($probe_nickname === true) {
+ if (isNicknameUsed($GLOBALS['refid'])) {
// Nickname in URL, so load the ID
$result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
// Begin with doubling process
if ((REQUEST_ISSET_POST(('userid'))) && (REQUEST_ISSET_POST(('pass'))) && (REQUEST_ISSET_POST(('points')))) {
// Probe for nickname extension and if a nickname was entered
- $probe_nickname = ((EXT_IS_ACTIVE('nickname')) && ((''.round(REQUEST_POST('userid')).'') != REQUEST_POST('userid')));
- if ($probe_nickname) {
+ if (isNickNameUsed(REQUEST_POST('userid'))) {
// Nickname in URL, so load the ID
$result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
array(REQUEST_POST('userid')), __FILE__, __LINE__);
} elseif (REQUEST_POST('points') > getConfig('doubler_max')) {
// Too much points entered
define('__ERROR_MSG', getMessage('DOUBLER_FORM_POINTS_MAX'));
- } elseif ($probe_nickname) {
+ } elseif (isNickNameUsed(REQUEST_POST('userid'))) {
// Cannot resolv nickname -> userid
define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_NICKNAME'));
} else {