diff options
author | Andrew Dolgov <[email protected]> | 2011-03-18 17:39:23 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-03-18 17:39:23 +0300 |
commit | ebb948c24e667f651fe882100cc478f0534b8760 (patch) | |
tree | ad1817f8625575ba03614863e413bb1acb869a66 /backend.php | |
parent | 81f6deea473257379ef43ceb07077527b9d91dbb (diff) |
rework initial sanitycheck to use JSON
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/backend.php b/backend.php index 5839c0d2b..d13b2d62a 100644 --- a/backend.php +++ b/backend.php @@ -69,18 +69,6 @@ authenticate_user($link, "admin", null); } - /* if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds" - && $op != "rss" && $op != "getUnread" && $op != "publish" && $op != "getProfiles") { - - if ($op == "rpc" || $op == "viewfeed" || $op == "view") { - print_error_xml(6); exit; - } else { - header("Location: tt-rss.php?return=" . - urlencode($_SERVER['REQUEST_URI'])); - } - exit; - } */ - if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds" && $op != "rss" && $op != "getUnread" && $op != "getProfiles") { @@ -144,7 +132,12 @@ require_once "modules/pref-labels.php"; require_once "modules/pref-users.php"; - if (!sanity_check($link)) { return; } + $error = sanity_check($link); + + if ($error['code'] != 0) { + print json_encode(array("error" => $error)); + return; + } switch($op) { // Select action according to $op value. case "rpc": |