//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content).'<br />');
if (($UID > 0) && (is_array($content))) {
// If nickname extension is installed, fetch nickname as well
- if (isNicknameUsed($UID)) {
+ if ((isExtensionActive('nickname')) && (isNicknameUsed($UID))) {
//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />");
// Load by nickname
fetchUserData($UID, 'nickname');
$found = false;
// Do we have nickname or userid set?
- if (isNicknameUsed($GLOBALS['refid'])) {
+ if ((isExtensionActive('nickname')) && (isNicknameUsed($GLOBALS['refid']))) {
// Nickname in URL, so load the id
$found = fetchUserData($GLOBALS['refid'], 'nickname');
} elseif ($GLOBALS['refid'] > 0) {
);
// Check login data
- if ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) {
+ if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
// Nickname entered
fetchUserData($userid, 'nickname');
+ } elseif (isNicknameUsed($userid)) {
+ // No nickname installed
+ $errorCode = getCode('EXTENSION_PROBLEM');
} else {
// Direct userid entered
fetchUserData($userid);
}
- // Load entry
- $content = getUserDataArray();
- if (!empty($content['userid'])) $userid = bigintval($content['userid']);
-
// Is there an entry?
- if ((isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && ((isNicknameUsed($content['userid'] === true) && (!empty($content['userid']))) || ($content['userid'] == $userid))) {
+ if (((isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && (!empty($content['userid']))) || ($content['userid'] == $userid)) {
+ // Load entry
+ $content = getUserDataArray();
+ if (!empty($content['userid'])) $userid = bigintval($content['userid']);
+
// Check for old MD5 passwords
if ((strlen($content['password']) == 32) && (md5($passwd) == $content['password'])) {
// Just set the hash to the password from DB... :)
// Wrong password!
$errorCode = getCode('WRONG_PASS');
}
- } elseif (((isNicknameUsed($content['userid'])) && (!empty($content['userid']))) || ($content['userid'] == $userid)) {
+ } elseif (((isExtensionActive('nickname')) && (isNicknameUsed($content['userid'])) && (!empty($content['userid']))) || ($content['userid'] == $userid)) {
// Other account status?
if (fetchUserData($userid)) {
// Create an error code from given status
$userid = getMemberId();
} elseif ((isPostRequestElementSet('id')) && (isPostRequestElementSet('password')) && (isFormSent())) {
// Set userid and crypt password when login data was submitted
- if (isNicknameUsed(postRequestElement('id'))) {
+ if ((isExtensionActive('nickname')) && (isNicknameUsed(postRequestElement('id')))) {
// Nickname entered
$userid = SQL_ESCAPE(postRequestElement('id'));
} else {
if ((getOutputMode() != 0) || (!isResetModeEnabled()) || (getConfig('beg_rallye') == 'Y')) return;
//* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
-// Reset accounts
-$result = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=0.00000 WHERE `beg_points` > 0",
- __FILE__, __LINE__);
+// @TODO This should be converted in a daily beg rallye
// [EOF]
?>
$isUsed = $GLOBALS['is_nickname_used'][$userid];
} else {
// Determine it
- $isUsed = ((isExtensionActive('nickname')) && (('' . round($userid) . '') != $userid));
+ $isUsed = (('' . round($userid) . '') != $userid);
// And write it to the cache
$GLOBALS['is_nickname_used'][$userid] = $isUsed;