added DEBUG_FILE to debug configuration
changed authentication call from Mr.Reader so that the reply is also uppercase, since the API-KEY comes in uppercase from clients fixed debug output while authentication in Mr.Reader with displaying the email adress
This commit is contained in:
@@ -77,3 +77,9 @@ v1.4.1 - 2013/6/28
|
|||||||
v1.4.2 - 2013/6/28
|
v1.4.2 - 2013/6/28
|
||||||
|
|
||||||
* changed the DEBUG_USER evaluation a little bit for disabling authentication without DEBUG = true
|
* changed the DEBUG_USER evaluation a little bit for disabling authentication without DEBUG = true
|
||||||
|
|
||||||
|
v1.4.3 - 2013/6/28
|
||||||
|
|
||||||
|
* added ```DEBUG_FILE``` to debug configuration
|
||||||
|
* changed authentication call from Mr.Reader so that the reply is also uppercase, since the API-KEY comes in uppercase from clients
|
||||||
|
* fixed debug output while authentication in Mr.Reader with displaying the email adress
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// v1.4.2
|
// v1.4.3
|
||||||
|
|
||||||
class FeverAPI extends Handler {
|
class FeverAPI extends Handler {
|
||||||
|
|
||||||
@@ -12,6 +12,7 @@ class FeverAPI extends Handler {
|
|||||||
// debugging only functions with JSON
|
// debugging only functions with JSON
|
||||||
const DEBUG = false; // enable if you need some debug output in your tinytinyrss root
|
const DEBUG = false; // enable if you need some debug output in your tinytinyrss root
|
||||||
const DEBUG_USER = 0; // your user id you need to debug - look it up in your mysql database and set it to a value bigger than 0
|
const DEBUG_USER = 0; // your user id you need to debug - look it up in your mysql database and set it to a value bigger than 0
|
||||||
|
const DEBUG_FILE = './debug_fever.txt'; // the file for debugging output
|
||||||
|
|
||||||
private $xml;
|
private $xml;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ class FeverAPI extends Handler {
|
|||||||
print json_encode($arr);
|
print json_encode($arr);
|
||||||
if (self::DEBUG) {
|
if (self::DEBUG) {
|
||||||
// debug output
|
// debug output
|
||||||
file_put_contents('./debug_fever.txt','answer : '.json_encode($arr)."\n",FILE_APPEND);
|
file_put_contents(self::DEBUG_FILE,'answer : '.json_encode($arr)."\n",FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,15 +128,14 @@ class FeverAPI extends Handler {
|
|||||||
(isset($_REQUEST["password"]))) {
|
(isset($_REQUEST["password"]))) {
|
||||||
$email = $_REQUEST["email"];
|
$email = $_REQUEST["email"];
|
||||||
$password = $_REQUEST["password"];
|
$password = $_REQUEST["password"];
|
||||||
$apikey = md5($email.":".db_escape_string($password));
|
$apikey = strtoupper(md5($email.":".db_escape_string($password)));
|
||||||
setcookie('fever_auth',$apikey,time()+60*60*24*30);
|
setcookie('fever_auth',$apikey,time()+60*60*24*30);
|
||||||
if (self::DEBUG) {
|
if (self::DEBUG) {
|
||||||
// debug output
|
// debug output
|
||||||
$output = array();
|
$output = array();
|
||||||
$output['email'] = $username;
|
$output['email'] = $email;
|
||||||
$output['password'] = '***not displayed***';
|
|
||||||
$output['apikey'] = $apikey;
|
$output['apikey'] = $apikey;
|
||||||
file_put_contents('./debug_fever.txt','auth POST: '.json_encode($output)."\n",FILE_APPEND);
|
file_put_contents(self::DEBUG_FILE,'auth POST: '.json_encode($output)."\n",FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((strlen($apikey)==0)&&isset($_REQUEST['fever_auth'])) { // override for Mr.Reader when doing some stuff
|
if ((strlen($apikey)==0)&&isset($_REQUEST['fever_auth'])) { // override for Mr.Reader when doing some stuff
|
||||||
@@ -278,6 +278,7 @@ class FeverAPI extends Handler {
|
|||||||
function getLinks()
|
function getLinks()
|
||||||
{
|
{
|
||||||
// TODO: is there a 'hot links' alternative in ttrss?
|
// TODO: is there a 'hot links' alternative in ttrss?
|
||||||
|
// use ttrss_user_entries / score>0
|
||||||
$links = array();
|
$links = array();
|
||||||
|
|
||||||
return $links;
|
return $links;
|
||||||
@@ -717,7 +718,7 @@ class FeverAPI extends Handler {
|
|||||||
if (parent::before($method)) {
|
if (parent::before($method)) {
|
||||||
if (self::DEBUG) {
|
if (self::DEBUG) {
|
||||||
// add request to debug log
|
// add request to debug log
|
||||||
file_put_contents('./debug_fever.txt','parameter: '.json_encode($_REQUEST)."\n",FILE_APPEND);
|
file_put_contents(self::DEBUG_FILE,'parameter: '.json_encode($_REQUEST)."\n",FILE_APPEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the user from the db
|
// set the user from the db
|
||||||
|
|||||||
Reference in New Issue
Block a user