1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 14:15:56 +00:00

rework initial sanitycheck to use JSON

This commit is contained in:
Andrew Dolgov
2011-03-18 17:39:23 +03:00
parent 81f6deea47
commit ebb948c24e
7 changed files with 22 additions and 127 deletions

View File

@@ -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":