Several fixes on core and wernis extension
authorRoland Häder <roland@mxchange.org>
Tue, 25 Mar 2008 18:44:12 +0000 (18:44 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 25 Mar 2008 18:44:12 +0000 (18:44 +0000)
inc/functions.php
inc/language/wernis_de.php
inc/libs/wernis_functions.php
inc/session.php
templates/de/html/ext/ext_wernis.tpl

index 1ef5165a5a35d301c484bb8fce92f98306cdc59e..3cdabf7e3e09ff0c32816a90d0a133e6ad209b27 100644 (file)
@@ -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("&amp;", "&", $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("", "", "");
        }
index fc61ac1acbe9cc389265e344a0de4ee2f5cd08a8..0bbf728c54b59a19c03f7a11fa60766ce5b3be9c 100644 (file)
@@ -99,8 +99,8 @@ define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes {!POINTS!}-Guthaben")
 define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes {!POINTS!}-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
 define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr {!POINTS!}-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei {!POINTS!}-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.");
-define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
-define('WERNIS_MEMBER_WDS66_PASSWORD', "{!POINTS!}-Passwort (nicht Accountpasswort!): [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://192.168.1.17/new_autoinstaller/wds66/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_PASSWORD', "{!POINTS!}-Passwort (nicht Accountpasswort!): [<A href=\"http://192.168.1.17/new_autoinstaller/wds66/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
 define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
 define('WERNIS_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <u>%s</u> erkannt! Bitte links im Men&uuml; fortfahren.");
 define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben.");
index ae8ed57e564828690e966d5b168488d99e497471..e665277234890a9f6feb7218f93b080a7049c9c1 100644 (file)
@@ -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",
index b8143d261719da51ea8037746008c6150b2bff81..f3b02711625248d411212863a9e373eda9a167b8 100644 (file)
@@ -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'])) {
index e06711f84a9aa70a5d206ef363d67989d052b879..45a67401a466fb00aaa7e6dc46c549e53dc8413f 100644 (file)
@@ -8,4 +8,4 @@ mit einem API-Account. Mehr dazu auf
 . Damit Ihr System einheitlicher ist, sollten Sie unter
 <A href="{!URL!}/modules.php?module=admin&amp;what=config_other"
        target="_blank">Sonstige Einstellungen</A>
-die W&auml;hrung Ihres {!MT_WORD2!} auf Wernis umstellen.
+die W&auml;hrung Ihres {!MT_WORD2!} von {!POINTS!} auf Wernis umstellen.