<?
session_start();
- if (!$_SESSION["uid"]) { exit; }
+ $op = $_REQUEST["op"];
+
+ if (($op == "rpc" || $op == "updateAllFeeds" ||
+ $op == "forceUpdateAllFeeds") && !$_REQUEST["noxml"]) {
+ header("Content-Type: application/xml");
+ }
+
+ if (!$_SESSION["uid"]) {
+
+ if (($op == "rpc" || $op == "updateAllFeeds" ||
+ $op == "forceUpdateAllFeeds")) {
+ print "<error error-code=\"6\"/>";
+ }
+ exit;
+ }
define(SCHEMA_VERSION, 2);
require_once "functions.php";
require_once "magpierss/rss_fetch.inc";
- $op = $_REQUEST["op"];
-
- if (($op == "rpc" || $op == "updateAllFeeds") && !$_REQUEST["noxml"]) {
- header("Content-Type: application/xml");
- }
-
$script_started = getmicrotime();
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$error_code = 5;
}
- print "<error code='$error_code'/>";
+ print "<error error-code='$error_code'/>";
}
if ($subop == "globalPurge") {
$ERRORS[5] = "Incorrect database schema version.";
+ $ERRORS[6] = "Not authorized.";
+
+ if ($_GET["c"] == 6) {
+ header("Location: login.php");
+ }
+
?>
<html>
notify("refetch_callback: backend did not return valid XML");
return;
}
-
+
var reply = xmlhttp.responseXML.firstChild;
if (!reply) {
return;
}
+ var error_code = reply.getAttribute("error-code");
+
+ if (error_code && error_code != 0) {
+ return fatalError(error_code);
+ }
+
var f_document = window.frames["feeds-frame"].document;
for (var l = 0; l < reply.childNodes.length; l++) {
return;
}
- var error_code = reply.getAttribute("code");
+ var error_code = reply.getAttribute("error-code");
if (error_code && error_code != 0) {
return fatalError(error_code);