-rw-r--r-- | backend/php/src/index.php | 6 | ||||
-rwxr-xr-x | frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/backend/php/src/index.php b/backend/php/src/index.php index 35752f4..58c10a9 100644 --- a/backend/php/src/index.php +++ b/backend/php/src/index.php @@ -702,46 +702,46 @@ error_log("message"); updateUserCredentials($parameters["parameters"]["credentials"], $user); updateUserData($parameters["parameters"]["user"], $user); $otpList = $parameters["parameters"]["oneTimePasswords"]; foreach($otpList as $otpReference=>$otpData) { $otpList = $otp->GetList(array(array("reference", "=", $otpReference))); $currentOtp = $otpList[0]; $currentOtp->data = $otpData; $currentOtp->Save(); } $user->Save(); $result["lock"] = $user->lock; $result["result"] = "done"; //============================================================= } else if ($message == "echo") { $result["result"] = $parameters; } //============================================================= } else if (isset($_SESSION['K'])) { $result["error"] = "Wrong shared secret!"; - } else { - $result["result"] = "EXCEPTION"; - $result["message"] = "Trying to communicate without an active connection"; + } else { + $result["result"] = "EXCEPTION"; + $result["message"] = "Trying to communicate without an active connection"; } break; case "logout": error_log("logout"); session_destroy(); break; default: error_log("default"); $result["result"] = $parameters; break; } session_write_close(); echo(json_encode($result)); error_log("result: ".json_encode($result)); ?> diff --git a/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js b/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js index 6a4f637..6185fd6 100755 --- a/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js +++ b/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js @@ -217,49 +217,49 @@ YAHOO.extendX(Clipperz.PM.Proxy.PHP, Clipperz.PM.Proxy, { //MochiKit.Logging.logDebug("<<< Proxy.PHP.sendRemoteMessage - result: " + deferredResult); return deferredResult; */ var deferredResult; var parameters; //MochiKit.Logging.logDebug(">>> Proxy.PHP.sendRemoteMessage('" + aFunctionName + "', " + Clipperz.Base.serializeJSON(someParameters) + ") - " + this); parameters = {}; parameters['method'] = aFunctionName; // parameters['version'] = someParameters['version']; // parameters['message'] = someParameters['message']; parameters['parameters'] = Clipperz.Base.serializeJSON(someParameters); //MochiKit.Logging.logDebug("--- Proxy.PHP.sendRemoteMessage('" + Clipperz.Base.serializeJSON(parameters) + ") - " + this); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Async.doXHR, "./php/index.php", { method:'POST', sendContent:MochiKit.Base.queryString(parameters), headers:{"Content-Type":"application/x-www-form-urlencoded"} }); //deferredResult.addCallback(function(res) {MochiKit.Logging.logDebug("Proxy.PHP.response - 2: " + res.responseText); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("Proxy.PHP.response - ERROR: " + res); return res;}); deferredResult.addCallback(MochiKit.Async.evalJSONRequest); - deferredResult.addCallback(function (someValues) { - if (someValues['result'] == 'EXCEPTION') { - throw someValues['message']; - } - return someValues; - }) + deferredResult.addCallback(function (someValues) { + if (someValues['result'] == 'EXCEPTION') { + throw someValues['message']; + } + return someValues; + }) deferredResult.callback(); return deferredResult; }, //========================================================================= 'isReadOnly': function() { return false; }, //========================================================================= __syntaxFix__: "syntax fix" }); //============================================================================= //Clipperz.PM.Proxy.defaultProxy = new Clipperz.PM.Proxy.PHP("Proxy.PHP - async test"); |