summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-04-20 00:14:37 +0400
committerAndrew Dolgov <[email protected]>2011-04-20 00:14:37 +0400
commit1ca77e0acd1d283112559cbfb3b3aac1802ffc32 (patch)
treeaa0046fa6fda2e6efdbec41f238729a6ba374b08
parente31ed61af333d231ca6b437c93be89259cb3706a (diff)
merge logout.php inside backend.php
-rw-r--r--backend.php12
-rw-r--r--db-updater.php2
-rw-r--r--digest.php22
-rw-r--r--logout.php11
-rw-r--r--register.php2
-rw-r--r--tt-rss.php2
6 files changed, 25 insertions, 26 deletions
diff --git a/backend.php b/backend.php
index 72535113b..c78284c6a 100644
--- a/backend.php
+++ b/backend.php
@@ -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)));
@@ -571,6 +571,16 @@
}
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.
diff --git a/db-updater.php b/db-updater.php
index 6df74a864..dca3a374d 100644
--- a/db-updater.php
+++ b/db-updater.php
@@ -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>";
diff --git a/digest.php b/digest.php
index 366be994e..63da77620 100644
--- a/digest.php
+++ b/digest.php
@@ -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>
@@ -103,7 +103,7 @@
</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>
@@ -117,11 +117,11 @@
<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
index 855deec71..000000000
--- a/logout.php
+++ /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");
-?>
diff --git a/register.php b/register.php
index fb6261baf..2b464dc8f 100644
--- a/register.php
+++ b/register.php
@@ -148,7 +148,7 @@
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;
diff --git a/tt-rss.php b/tt-rss.php
index c294ee589..16b15e84a 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -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()"