]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
add a wrapper for standard error codes returned by backend, also add explanation...
[tt-rss.git] / backend.php
index 84abc97304b83db640e64af02254db18b2efcc7b..150481cfe89d7e39c7257fbc1c581b99ba4c8296 100644 (file)
@@ -63,7 +63,7 @@
        if ($_SESSION["uid"]) {
                if (!validate_session()) {
                        header("Content-Type: text/json");
-                       print json_encode(array("error" => array("code" => 6)));
+                       print error_json(6);
                        return;
                }
                load_user_plugins( $_SESSION["uid"]);
                5 => __("Power User"),
                10 => __("Administrator"));
 
-       #$error = sanity_check();
-
-       #if ($error['code'] != 0 && $op != "logout") {
-       #       print json_encode(array("error" => $error));
-       #       return;
-       #}
-
        $op = str_replace("-", "_", $op);
 
        $override = PluginHost::getInstance()->lookup_handler($op, $method);
                                        return;
                                } else {
                                        header("Content-Type: text/json");
-                                       print json_encode(array("error" => array("code" => 6)));
+                                       print error_json(6);
                                        return;
                                }
                        } else {
                                header("Content-Type: text/json");
-                               print json_encode(array("error" => array("code" => 6)));
+                               print error_json(6);
                                return;
                        }
                }
        }
 
        header("Content-Type: text/json");
-       print json_encode(array("error" => array("code" => 7)));
+       print error_json(13);
 
 ?>