$GLOBALS['translation_tables']['yoomedia'] = array(
// Error messages
'error_codes' => array(
- 1 => 'wrong_pass',
- 2 => 'wrong_sid',
- 3 => 'website_locked',
- 4 => 'api_data_error',
- 5 => 'requests_depleted',
- 6 => 'zero_result',
- 7 => 'no_campaigns_with_interface',
- 10 => 'incomplete_request'
+ -999 => 'unknown_error',
+ 1 => 'wrong_pass',
+ 2 => 'wrong_sid',
+ 3 => 'website_locked',
+ 4 => 'api_data_error',
+ 5 => 'requests_depleted',
+ 6 => 'zero_result',
+ 7 => 'no_campaigns_with_interface',
+ 10 => 'incomplete_request'
),
// For text mails
'textmail' => array(
'ADMIN_YOOMEDIA_TM_ACTIONS' => "Aktionen",
// Error messages for admin
+ 'ADMIN_YOOMEDIA_ERROR_UNKNOWN' => "Unbekannter/leerer Fehler von API erhalten. Möglicherweise keine API-Daten angegeben.",
'ADMIN_YOOMEDIA_ERROR_FAILED' => "Allgemeiner Fehler von API, nicht weiter spezifiziert.",
'ADMIN_YOOMEDIA_ERROR_TITLE' => "Fehler bei Abfrage der Yoo!Media API 2.0",
'ADMIN_YOOMEDIA_ERROR_WRONG_PASS' => "Falsches Interfacepasswort angegeben.",
$return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
} else {
// Log missing entries
- debug_report_bug(sprintf("Unknown error code <strong>%s</strong> detected.", $errorCode));
+ debug_report_bug(sprintf("Unknown error code <strong>%s[%s]</strong> detected.", $errorCode, gettype($errorCode)));
}
// Return value
if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) {
// Remove entry
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_yoomedia_reload` WHERE `id`=%s LIMIT 1",
- array($id), __FUNCTION__, __LINE__);
+ array($id), __FUNCTION__, __LINE__);
} else {
// Dont' sent again this mail
$reloaded = $time;
// Remove carrige-return
$code = str_replace("\n", '', $code);
+
} else {
// Should not happen!
debug_report_bug('Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
}
+ // Fix empty code to bad
+ if (empty($code)) {
+ $code = -999;
+ } // END - if
+
// Return error code
return $code;
}
// Checks wether the admin hash is set
function isAdminHashSet ($admin) {
- if (!isset($GLOBALS['cache_array']['admin'])) debug_report_bug('Cache not set.');
+ /**
+ * @TODO Do we really need this check? If yes, try to fix this:
+ * 1.:functions.php:2504, debug_get_mailable_backtrace(0)
+ * 2.:wrapper-functions.php:744, debug_report_bug(1)
+ * 3.:mysql-manager.php:728, isAdminHashSet(1)
+ * 4.:filters.php:384, isAdmin(0)
+ * 5.:debug_get_mailable_backtrace:2457, FILTER_DETERMINE_USERNAME(1)
+ * 6.:filter-functions.php:280, call_user_func_array(2)
+ * 7.:load_cache.php:74, runFilterChain(1)
+ * 8.:inc-functions.php:131, include(1)
+ * 9.:inc-functions.php:145, loadInclude(1)
+ * 10.:mysql-connect.php:104, loadIncludeOnce(1)
+ * 11.:inc-functions.php:131, include(1)
+ * 12.:inc-functions.php:145, loadInclude(1)
+ * 13.:config-global.php:106, loadIncludeOnce(1)
+ * 14.:js.php:57, require(1)
+ */
+ if (!isset($GLOBALS['cache_array']['admin'])) {
+ debug_report_bug('Cache not set.');
+ } // END - if
+
+ // Check for admin hash
return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
}