From 0da26ebf67e1a6c8e5ab5f23639c6abd99d84b2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 25 Mar 2008 18:44:12 +0000 Subject: [PATCH] Several fixes on core and wernis extension --- inc/functions.php | 7 +++---- inc/language/wernis_de.php | 4 ++-- inc/libs/wernis_functions.php | 10 +++++----- inc/session.php | 4 +--- templates/de/html/ext/ext_wernis.tpl | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 1ef5165a5a..3cdabf7e3e 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -930,7 +930,7 @@ function LOAD_URL($URL, $addUrlData=true) { } else { // Output error message include(PATH."inc/header.php"); - LOAD_TEMPLATE("redirect_url", false, $URL); + LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL)); include(PATH."inc/footer.php"); } exit(); @@ -1635,7 +1635,7 @@ function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) { } // -function MXCHANGE_OPEN($script) { +function MXCHANGE_OPEN ($script) { // Compile the script name $script = COMPILE_CODE($script); @@ -1659,8 +1659,7 @@ function MXCHANGE_OPEN($script) { // Open connection $fp = @fsockopen($host, 80, $errno, $errdesc, 30); - if (!$fp) - { + if (!$fp) { // Failed! return array("", "", ""); } diff --git a/inc/language/wernis_de.php b/inc/language/wernis_de.php index fc61ac1acb..0bbf728c54 100644 --- a/inc/language/wernis_de.php +++ b/inc/language/wernis_de.php @@ -99,8 +99,8 @@ define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlfähiges {!POINTS!}-Guthaben") define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes {!POINTS!}-Guthaben"); define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchführen"); define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr {!POINTS!}-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei {!POINTS!}-Betrag nur gerade Beträge eingeben! Überprüfen Sie vor dem Absenden Ihren WDS66-Usernamen."); -define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [Vergessen?]"); -define('WERNIS_MEMBER_WDS66_PASSWORD', "{!POINTS!}-Passwort (nicht Accountpasswort!): [Vergessen?]"); +define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [Vergessen?]"); +define('WERNIS_MEMBER_WDS66_PASSWORD', "{!POINTS!}-Passwort (nicht Accountpasswort!): [Vergessen?]"); define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu überweisenden Betrag eingeben:"); define('WERNIS_MEMBER_MODE_INVALID', "Ungültiger Modus %s erkannt! Bitte links im Menü fortfahren."); define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben."); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index ae8ed57e56..e665277234 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -65,9 +65,6 @@ function GET_WERNIS_ERROR_CODE () { if (isset($WERNIS['status'])) { // Use raw message return $WERNIS['status']; - } elseif (isset($WERNIS['status'])) { - // Fall-back to status - return sprintf(WERNIS_ERROR_STATUS, $WERNIS['status']); } else { // Something bad happend return WERNIS_UNKNOWN_ERROR; @@ -109,7 +106,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { if (strpos($response[0], "200") === false) { // Something bad happend... :( return array( - 'status' => "request_eror", + 'status' => "request_error", 'message' => sprintf(WERNIS_API_REQUEST_ERROR, $response[0]) ); } @@ -130,9 +127,10 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { $return = array(); // We use only the first two entries (which shall be fine) - if ($data[0] == "error") { + if ($data[0] === "error") { // The request has failed... :( switch ($data[1]) { + case "404": // Invalid API ID case "AUTH": // Authorization has failed $return = array( 'status' => "auth_failed", @@ -140,6 +138,8 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { ); break; + case "LOCKED": // User account is locked! + case "PASS": // Bad passphrase entered case "USER": // Missing account or invalid password $return = array( 'status' => "user_failed", diff --git a/inc/session.php b/inc/session.php index b8143d2617..f3b0271162 100644 --- a/inc/session.php +++ b/inc/session.php @@ -56,9 +56,7 @@ set_session("mx_lang", $mx_lang); if ((!empty($_GET['user'])) && ($CLICK == 1) && ($_SERVER['PHP_SELF'] == "click.php")) { // The variable user comes from the click-counter script click.php and we only accept this here $GLOBALS['refid'] = bigintval($_GET['user']); -} - -if (!empty($_POST['refid'])) { +} elseif (!empty($_POST['refid'])) { // Get referral id from variable refid (so I hope this makes my script more compatible to other scripts) $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid'])); } elseif (!empty($_GET['refid'])) { diff --git a/templates/de/html/ext/ext_wernis.tpl b/templates/de/html/ext/ext_wernis.tpl index e06711f84a..45a67401a4 100644 --- a/templates/de/html/ext/ext_wernis.tpl +++ b/templates/de/html/ext/ext_wernis.tpl @@ -8,4 +8,4 @@ mit einem API-Account. Mehr dazu auf . Damit Ihr System einheitlicher ist, sollten Sie unter Sonstige Einstellungen -die Währung Ihres {!MT_WORD2!} auf Wernis umstellen. +die Währung Ihres {!MT_WORD2!} von {!POINTS!} auf Wernis umstellen. -- 2.30.2