Fix bug token

The token should appear in RSS feed url when anonymous are not allowed
This commit is contained in:
Marien Fressinaud
2014-02-15 10:44:37 +01:00
parent 595bf40c70
commit fb7bc50673

View File

@@ -5,18 +5,15 @@ class FreshRSS_index_Controller extends Minz_ActionController {
public function indexAction () {
$output = Minz_Request::param ('output');
$token = '';
$token = $this->view->conf->token;
// check if user is logged in
if (!$this->view->loginOk && !Minz_Configuration::allowAnonymous())
{
$token = $this->view->conf->token;
if (!$this->view->loginOk && !Minz_Configuration::allowAnonymous()) {
$token_param = Minz_Request::param ('token', '');
$token_is_ok = ($token != '' && $token === $token_param);
if (!($output === 'rss' && $token_is_ok)) {
return;
}
$params['token'] = $token;
}
// construction of RSS url of this feed
@@ -25,6 +22,9 @@ class FreshRSS_index_Controller extends Minz_ActionController {
if (isset ($params['search'])) {
$params['search'] = urlencode ($params['search']);
}
if (!Minz_Configuration::allowAnonymous()) {
$params['token'] = $token;
}
$this->view->rss_url = array (
'c' => 'index',
'a' => 'index',