formatting changes
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// do not support refresh command, this could take ages.
|
// do not support refresh command, this could take ages.
|
||||||
if (isset($_REQUEST["refresh"]))
|
if (isset($_REQUEST["refresh"]))
|
||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
error_reporting(E_ERROR | E_PARSE);
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@
|
|||||||
get_include_path());
|
get_include_path());
|
||||||
|
|
||||||
chdir("../..");
|
chdir("../..");
|
||||||
|
|
||||||
define('NO_SESSION_AUTOSTART', true);
|
define('NO_SESSION_AUTOSTART', true);
|
||||||
|
|
||||||
require_once "autoload.php";
|
require_once "autoload.php";
|
||||||
@@ -34,17 +35,18 @@
|
|||||||
} else {
|
} else {
|
||||||
ob_start();
|
ob_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!init_plugins()) return;
|
if (!init_plugins()) return;
|
||||||
|
|
||||||
$handler = new FeverAPI(Db::get(), $_REQUEST);
|
$handler = new FeverAPI(Db::get(), $_REQUEST);
|
||||||
|
|
||||||
if ($handler->before($method)) {
|
if ($handler->before($method)) {
|
||||||
if (method_exists($handler, 'index')) {
|
if (method_exists($handler, 'index')) {
|
||||||
$handler->index($method);
|
$handler->index($method);
|
||||||
}
|
}
|
||||||
$handler->after();
|
$handler->after();
|
||||||
}
|
}
|
||||||
|
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
?>
|
|
||||||
|
?>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Fever extends Plugin {
|
class Fever extends Plugin {
|
||||||
private $host;
|
private $host;
|
||||||
|
|
||||||
function about() {
|
function about() {
|
||||||
return array(1.2,
|
return array(1.2,
|
||||||
"Emulates the Fever API for Tiny Tiny RSS",
|
"Emulates the Fever API for Tiny Tiny RSS",
|
||||||
"digitaldj");
|
"digitaldj & murphy");
|
||||||
}
|
}
|
||||||
|
|
||||||
function init($host) {
|
function init($host) {
|
||||||
@@ -16,7 +17,7 @@ class Fever extends Plugin {
|
|||||||
function before($method) {
|
function before($method) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function csrf_ignore($method) {
|
function csrf_ignore($method) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -29,7 +30,7 @@ class Fever extends Plugin {
|
|||||||
print "<h3>" . __("Fever Emulation") . "</h3>";
|
print "<h3>" . __("Fever Emulation") . "</h3>";
|
||||||
|
|
||||||
print "<p>" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "</p>";
|
print "<p>" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "</p>";
|
||||||
|
|
||||||
print "<p>" . __("Set a password to login with Fever:") . "</p>";
|
print "<p>" . __("Set a password to login with Fever:") . "</p>";
|
||||||
|
|
||||||
print "<form dojoType=\"dijit.form.Form\">";
|
print "<form dojoType=\"dijit.form.Form\">";
|
||||||
@@ -52,27 +53,27 @@ class Fever extends Plugin {
|
|||||||
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" type=\"password\" name=\"password\" />";
|
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" type=\"password\" name=\"password\" />";
|
||||||
print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Set Password") . "</button>";
|
print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Set Password") . "</button>";
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
print "<p>" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . ($_SERVER["HTTPS"] == "on" ? "https://" : "http://") . dirname($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . "/plugins/fever/" . "</p>";
|
print "<p>" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . ($_SERVER["HTTPS"] == "on" ? "https://" : "http://") . dirname($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . "/plugins/fever/" . "</p>";
|
||||||
print "<p>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">http://www.feedafever.com/api</a></p>";
|
print "<p>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">http://www.feedafever.com/api</a></p>";
|
||||||
|
|
||||||
print "<p>" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "</p>";
|
print "<p>" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "</p>";
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function save()
|
function save()
|
||||||
{
|
{
|
||||||
if (isset($_POST["password"]) && isset($_SESSION["uid"]))
|
if (isset($_POST["password"]) && isset($_SESSION["uid"]))
|
||||||
{
|
{
|
||||||
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
|
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
|
||||||
if ($line = db_fetch_assoc($result))
|
if ($line = db_fetch_assoc($result))
|
||||||
{
|
{
|
||||||
$password = md5($line["login"] . ":" . db_escape_string($_POST["password"]));
|
$password = md5($line["login"] . ":" . db_escape_string($_POST["password"]));
|
||||||
$this->host->set($this, "password", $password);
|
$this->host->set($this, "password", $password);
|
||||||
echo __("Password saved.");
|
echo __("Password saved.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function after() {
|
function after() {
|
||||||
@@ -83,4 +84,5 @@ class Fever extends Plugin {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user