]> git.wh0rd.org Git - tt-rss.git/commitdiff
merge logout.php inside backend.php
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Apr 2011 20:14:37 +0000 (00:14 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Apr 2011 20:14:37 +0000 (00:14 +0400)
backend.php
db-updater.php
digest.php
logout.php [deleted file]
register.php
tt-rss.php

index 72535113b90a68d4eb41763112d2fd842b6df9a4..c78284c6affa3aa07de68a280184efd652732674 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)));
                        }
 
                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.
index 6df74a864e64c29161e29c20b139cb31672a70a2..dca3a374d1f46e131da7910e6851f4d631e7dde2 100644 (file)
@@ -155,7 +155,7 @@ function confirmOP() {
                print "<p>".T_sprintf("Finished. Performed <b>%d</b> update(s) up to schema
                        version <b>%d</b>.", $num_updates, $version)."</p>";
 
-               print "<form method=\"GET\" action=\"logout.php\">
+               print "<form method=\"GET\" action=\"backend.php?op=logout\">
                        <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
                        </form>";
 
index 366be994ef791499bc52a8bb0d5c696cb4936383..63da77620fafb8525aaf6d82d3dab502e14c9245 100644 (file)
@@ -1,12 +1,12 @@
 <?php
-       require_once "functions.php"; 
+       require_once "functions.php";
        require_once "sessions.php";
        require_once "sanity_check.php";
-       require_once "version.php"; 
+       require_once "version.php";
        require_once "config.php";
        require_once "db-prefs.php";
 
-       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
+       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 
        login_sequence($link);
 
@@ -15,9 +15,9 @@
        no_cache_incantation();
 
        header('Content-Type: text/html; charset=utf-8');
-       
+
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -60,7 +60,7 @@
                <img src="images/indicator_white.gif"/>
                        <?php echo __("Loading, please wait...") ?>
                </div>
-       </div> 
+       </div>
 
        <div id="header">
 
@@ -71,7 +71,7 @@
        <?php } ?>
 
        <?php if (!SINGLE_USER_MODE) { ?>
-                       <a href="logout.php"><?php echo __('Logout') ?></a>
+                       <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
        <?php } ?>
 
        </div>
                </div>
 
                <div id="headlines">
-                       <h1><a href="#" onclick="viewfeed(-4)"><?php echo __('headlines') ?></a>: 
+                       <h1><a href="#" onclick="viewfeed(-4)"><?php echo __('headlines') ?></a>:
                                <span id="headlines-title"></span></h1>
 
                        <ul id="headlines-content"> </ul>
 
        <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
        <?php if (!defined('HIDE_VERSION')) { ?>
-                v<?php echo VERSION ?> 
+                v<?php echo VERSION ?>
        <?php } ?>
-       &copy; 2005&ndash;<?php echo date('Y') ?> 
+       &copy; 2005&ndash;<?php echo date('Y') ?>
        <a href="http://fakecake.org/">Andrew Dolgov</a>
-       
+
        <br/>
 
        <a href="tt-rss.php">
diff --git a/logout.php b/logout.php
deleted file mode 100644 (file)
index 855deec..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-       require_once "functions.php"; 
-       require_once "sessions.php";
-       require_once "sanity_check.php";
-       require_once "version.php"; 
-       require_once "config.php";
-       require_once "db-prefs.php";
-
-       logout_user();
-       header("Location: tt-rss.php");
-?>
index fb6261bafc28c3378e0e59a819540406cf803fac..2b464dc8fdaea03732c249a7f894edc787332cb5 100644 (file)
                if (!ENABLE_REGISTRATION) {
                        print_error(__("New user registrations are administratively disabled."));
 
-                       print "<p><form method=\"GET\" action=\"logout.php\">
+                       print "<p><form method=\"GET\" action=\"backend.php?op=logout\">
                                <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
                                </form>";
                        return;
index c294ee589134bb5c507e29db49e2d2b1f8d66cb6..16b15e84af9efa0f3de39e158c28de4d9149ba96 100644 (file)
@@ -79,7 +79,7 @@
        <?php } ?>
 
        <?php if (!SINGLE_USER_MODE) { ?>
-                       | <a href="logout.php"><?php echo __('Logout') ?></a>
+                       | <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
        <?php } ?>
 
        <img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"