]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
backend/loading: add missed break
[tt-rss.git] / backend.php
index 9ed250cf5f4386aaaf234d0f11923cb80f41cccc..308ade0a727a44e1230f28e5d1f2e6c362dba61b 100644 (file)
@@ -60,7 +60,7 @@
 
        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.