if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds" &&
$op != "rss" && $op != "getUnread" && $op != "getProfiles" &&
- $op != "pubsub") {
+ $op != "logout" && $op != "pubsub") {
header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 6)));
$error = sanity_check($link);
- if ($error['code'] != 0) {
+ if ($error['code'] != 0 && $op != "logout") {
print json_encode(array("error" => $error));
return;
}
} else if ($mode == "zoom") {
array_push($articles, format_article($link, $id, false, true, true));
} else if ($mode == "raw") {
- if ($_REQUEST['html']) header("Content-Type: text/html");
+ if ($_REQUEST['html']) {
+ header("Content-Type: text/html");
+ print '<link rel="stylesheet" type="text/css" href="tt-rss.css"/>';
+ }
$article = format_article($link, $id, false);
- print $article['id'] . "\n\n";
print $article['content'];
return;
} else {
break; // digestSend
case "loading":
+ header("Content-type: text/html");
print __("Loading, please wait...") . " " .
"<img src='images/indicator_tiny.gif'>";
+ break;
case "getProfiles":
$login = db_escape_string($_REQUEST["login"]);
}
break;
+
+ case "logout":
+ logout_user();
+ header("Location: tt-rss.php");
+ break;
+
+ default:
+ header("Content-Type: text/plain");
+ print json_encode(array("error" => array("code" => 7)));
+ break;
} // Select action according to $op value.
// We close the connection to database.