default: // Do stuff when extension is loaded
// The translation table
- $yoomediaTranslationTable = array(
+ $GLOBALS['translation_tables']['yoomedia'] = array(
// Error messages
'error_codes' => array(
1 => 'wrong_pass',
// Generates an error code from given account status
function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
// Default error code if unknown account status
- $ERROR = getCode('UNKNOWN_STATUS');
+ $errorCode = getCode('UNKNOWN_STATUS');
// Generate constant name
$constantName = sprintf("ID_%s", $status);
// Is the constant there?
if (isCodeSet($constantName)) {
// Then get it!
- $ERROR = getCode($constantName);
+ $errorCode = getCode($constantName);
} else {
// Unknown status
DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown error status %s detected.", $status));
}
// Return error code
- return $ERROR;
+ return $errorCode;
}
// Clears the output buffer. This function does *NOT* backup sent content.
// Load URL data by given search term and column
function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
- global $lastUrlData;
-
// By default nothing is found
- $lastUrlData = array();
+ $GLOBALS['last_url_data'] = array();
// Is the column an id number?
if (($column == "id") || ($column == "userid")) {
// Shall we group these results?
if ($group == "id") {
// Add the row by id as index
- $lastUrlData[$dataRow['id']] = $dataRow;
+ $GLOBALS['last_url_data'][$dataRow['id']] = $dataRow;
} else {
// Group entries
- $lastUrlData[$dataRow[$group]][$dataRow['id']] = $dataRow;
+ $GLOBALS['last_url_data'][$dataRow[$group]][$dataRow['id']] = $dataRow;
}
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return the result
- return $lastUrlData;
+ return $GLOBALS['last_url_data'];
}
// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
list($status) = SQL_FETCHROW($result);
// Create an error code from given status
- $ERROR = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+ $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
} else {
// ID not found!
- $ERROR = getCode('WRONG_ID');
+ $errorCode = getCode('WRONG_ID');
}
// Construct URL
- $URL = "modules.php?module=index&what=login&login=".$ERROR;
+ $URL = "modules.php?module=index&what=login&login=".$errorCode;
} else {
// ID not found!
$URL = "modules.php?module=index&what=login&login=".getCode('WRONG_ID');
if (!empty($email)) $email = str_replace("{DOT}", '.', $email);
// Init result and error
- $ERROR = "";
+ $errorCode = "";
$result = false;
// Probe userid/nickname
} else {
// Userid not set!
DEBUG_LOG(__FUNCTION__, __LINE__, "Userid is not set! BUG!");
- $ERROR = getCode('WRONG_ID');
+ $errorCode = getCode('WRONG_ID');
}
// Any entry found?
LOAD_TEMPLATE("admin_settings_saved", false, getMessage('GUEST_NEW_PASSWORD_SEND'));
} else {
// Account is locked or unconfirmed
- $ERROR = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+ $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
// Load URL
- LOAD_URL("modules.php?module=index&what=login&login=".$ERROR);
+ LOAD_URL("modules.php?module=index&what=login&login=".$errorCode);
}
} else {
// ID or email is wrong
}
// Return the error code
- return $ERROR;
+ return $errorCode;
}
// [EOF]
// "Translates" the index number into an assosiative value
function YOOMEDIA_TRANSLATE_INDEX ($type, $index) {
- global $yoomediaTranslationTable;
-
// Default is the index
$return = $index;
// Is the element there?
- if (isset($yoomediaTranslationTable[$type][$index])) {
+ if (isset($GLOBALS['translation_tables']['yoomedia'][$type][$index])) {
// Use this element
- $return = $yoomediaTranslationTable[$type][$index];
+ $return = $GLOBALS['translation_tables']['yoomedia'][$type][$index];
} else {
// Not found!
DEBUG_LOG(__FUNCTION__, __LINE__, " type={$type},index={$index} not found.");
// "Translate" error code
function YOOMEDIA_TRANSLATE_ERROR ($errorCode) {
- global $yoomediaTranslationTable;
-
// Default is "failed"
$return = "failed";
// Is the entry there?
- if (isset($yoomediaTranslationTable['error_codes'][$errorCode])) {
+ if (isset($GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode])) {
// Entry found!
- $return = $yoomediaTranslationTable['error_codes'][$errorCode];
+ $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
} else {
// Log missing entries
DEBUG_LOG(__FUNCTION__, __LINE__, " errorCode={$errorCode}");
// Add description as navigation point
ADD_DESCR("guest", __FILE__);
-global $DATA, $ERROR;
+global $DATA;
// Initialize variables
-$ERROR = 0;
+$errorCode = 0;
$probe_nickname = false;
$uid = false;
$hash = "";
$URL = "modules.php?module=login";
} elseif ((IS_FORM_SENT()) && ("".$uid."" != "".REQUEST_POST('id')."")) {
// Invalid input (no nickname extension installed but nickname entered)
- $ERROR = getCode('EXTENSION_PROBLEM');
+ $errorCode = getCode('EXTENSION_PROBLEM');
} elseif (IS_FORM_SENT()) {
// Try the login (see inc/libs/user_functions.php)
$URL = USER_DO_LOGIN(REQUEST_POST('id'), REQUEST_POST('password'));
} elseif ((REQUEST_ISSET_POST(('new_pass'))) && (isset($uid))) {
// Try the userid/email lookup (see inc/libs/user_functions.php)
- $ERROR = USER_DO_NEW_PASSWORD(REQUEST_POST('email'), $uid);
+ $errorCode = USER_DO_NEW_PASSWORD(REQUEST_POST('email'), $uid);
}
// Login problems?
if (REQUEST_ISSET_GET(('login'))) {
// Use code from URL
- $ERROR = REQUEST_GET(('login'));
+ $errorCode = REQUEST_GET(('login'));
} // END - if
// Login problems?
-if (!empty($ERROR)) {
+if (!empty($errorCode)) {
// Ok, which one now?
$message = "<tr>
<td width=\"10\" class=\"seperator\"> </td>
<td colspan=\"7\" align=\"center\">
<span class=\"guest_failed\">";
- switch ($ERROR) {
+ switch ($errorCode) {
case getCode('WRONG_PASS'):
$message .= getMessage('LOGIN_WRONG_PASS');
break;
break;
default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR));
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $errorCode));
$message .= getMessage('LOGIN_WRONG_ID');
break;
}
if ($status != "CONFIRMED") {
// If the status is different than confirmed move the user away from here
- $ERROR = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+ $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
// Load URL
- LOAD_URL("modules.php?module=index&what=login&login=".$ERROR);
+ LOAD_URL("modules.php?module=index&what=login&login=".$errorCode);
} // END - if
// Load adverstising template
function IS_MEMBER () {
// @TODO Why is this global??? #100
global $status;
+
if (!is_array($GLOBALS['last'])) $GLOBALS['last'] = array();
$ret = false;