aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-15 11:36:31 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-15 11:36:31 +0200
commit4a9cc67d90ac167d745c50f98aa1738f6d1131e9 (patch)
tree49630eda97e8fa6300accff2ed53c36e62cf6144 /p/api/greader.php
parentac80d5a1d9c5c3b0b91a774365580bf45348e19e (diff)
API: add iconUrl
https://github.com/jangernert/FeedReader/issues/59#issuecomment-247182291 https://github.com/FreshRSS/FreshRSS/issues/1252
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index 894c2e960..98ae60475 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -158,7 +158,7 @@ function authorizationToUser() {
Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.');
unauthorized();
}
- $system_conf = Minz_Configuration::get('system');
+ global $system_conf;
if ($headerAuthX[1] === sha1($system_conf->salt . $user . $conf->apiPasswordHash)) {
return $user;
} else {
@@ -189,7 +189,7 @@ function clientLogin($email, $pass) { //http://web.archive.org/web/2013060409104
if ($conf->apiPasswordHash != '' && password_verify($pass, $conf->apiPasswordHash)) {
header('Content-Type: text/plain; charset=UTF-8');
- $system_conf = Minz_Configuration::get('system');
+ global $system_conf;
$auth = $email . '/' . sha1($system_conf->salt . $email . $conf->apiPasswordHash);
echo 'SID=', $auth, "\n",
'Auth=', $auth, "\n";
@@ -209,7 +209,7 @@ function token($conf) {
//https://github.com/ericmann/gReader-Library/blob/master/greader.class.php
$user = Minz_Session::param('currentUser', '_');
//logMe('token('. $user . ")"); //TODO: Implement real token that expires
- $system_conf = Minz_Configuration::get('system');
+ global $system_conf;
$token = str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters
echo $token, "\n";
exit();
@@ -219,7 +219,7 @@ function checkToken($conf, $token) {
//http://code.google.com/p/google-reader-api/wiki/ActionToken
$user = Minz_Session::param('currentUser', '_');
//logMe('checkToken(' . $token . ")");
- $system_conf = Minz_Configuration::get('system');
+ global $system_conf;
if ($token === str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) {
return true;
}
@@ -261,6 +261,8 @@ function subscriptionList() {
$stm->execute();
$res = $stm->fetchAll(PDO::FETCH_ASSOC);
+ global $system_conf;
+ $salt = $system_conf->salt;
$subscriptions = array();
foreach ($res as $line) {
@@ -277,7 +279,7 @@ function subscriptionList() {
//'firstitemmsec' => 0,
'url' => $line['url'],
'htmlUrl' => $line['website'],
- //'iconUrl' => '',
+ 'iconUrl' => Minz_Url::display('/f.php?' . hash('crc32b', $salt . $line['url']), '', true),
);
}