diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index ca7122a7c..bbcb990f5 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -100,6 +100,9 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$entryDAO = new FreshRSS_EntryDAO();
$entryDAO->optimizeTable();
+ $feedDAO = new FreshRSS_FeedDAO();
+ $feedDAO->updateCachedValues();
+
invalidateHttpCache();
$notif = array (
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index c718fcd5c..16516ad39 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -30,6 +30,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$url = Minz_Request::param ('url_rss');
$cat = Minz_Request::param ('category', false);
+ if ($cat === 'nc') {
+ $new_cat = Minz_Request::param ('new_category');
+ if (empty($new_cat['name'])) {
+ $cat = false;
+ } else {
+ $cat = $this->catDAO->addCategory($new_cat);
+ }
+ }
if ($cat === false) {
$def_cat = $this->catDAO->getDefault ();
$cat = $def_cat->id ();
@@ -128,7 +136,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('internal_problem_feed')
+ 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
);
Minz_Session::_param ('notification', $notif);
} catch (Minz_FileNotExistException $e) {
@@ -136,7 +144,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('internal_problem_feed')
+ 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
);
Minz_Session::_param ('notification', $notif);
}
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 73f454715..9da1e5022 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -25,16 +25,14 @@ class FreshRSS_index_Controller extends Minz_ActionController {
}
}
- // construction of RSS url of this feed
$params = Minz_Request::params ();
- $params['output'] = 'rss';
if (isset ($params['search'])) {
$params['search'] = urlencode ($params['search']);
}
if (!Minz_Configuration::allowAnonymous()) {
$params['token'] = $token;
}
- $this->view->rss_url = array (
+ $this->view->url = array (
'c' => 'index',
'a' => 'index',
'params' => $params
diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php
index b03989cd7..fa967cedc 100644
--- a/app/Controllers/usersController.php
+++ b/app/Controllers/usersController.php
@@ -69,13 +69,19 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$anon_refresh = Minz_Request::param('anon_refresh', false);
$anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no');
$auth_type = Minz_Request::param('auth_type', 'none');
+ $unsafe_autologin = Minz_Request::param('unsafe_autologin', false);
+ $api_enabled = Minz_Request::param('api_enabled', false);
if ($anon != Minz_Configuration::allowAnonymous() ||
$auth_type != Minz_Configuration::authType() ||
- $anon_refresh != Minz_Configuration::allowAnonymousRefresh()) {
+ $anon_refresh != Minz_Configuration::allowAnonymousRefresh() ||
+ $unsafe_autologin != Minz_Configuration::unsafeAutologinEnabled() ||
+ $api_enabled != Minz_Configuration::apiEnabled()) {
Minz_Configuration::_authType($auth_type);
Minz_Configuration::_allowAnonymous($anon);
Minz_Configuration::_allowAnonymousRefresh($anon_refresh);
+ Minz_Configuration::_enableAutologin($unsafe_autologin);
+ Minz_Configuration::_enableApi($api_enabled);
$ok &= Minz_Configuration::writeFile();
}
}
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index 827a1d166..80031369e 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -193,7 +193,9 @@ class FreshRSS_Configuration {
if (!is_array($value)) {
continue;
}
- if (array_key_exists('url', $value)) {
+
+ // Verify URL and add default value when needed
+ if (isset($value['url'])) {
$is_url = (
filter_var ($value['url'], FILTER_VALIDATE_URL) ||
(version_compare(PHP_VERSION, '5.3.3', '<') &&
@@ -203,10 +205,15 @@ class FreshRSS_Configuration {
if (!$is_url) {
continue;
}
- if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) {
- $value['name'] = $value['type'];
- }
+ } else {
+ $value['url'] = null;
}
+
+ // Add a default name
+ if (empty($value['name'])) {
+ $value['name'] = $value['type'];
+ }
+
$this->data['sharing'][] = $value;
}
}
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 73f9c32fb..bce3bd24f 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -254,11 +254,12 @@ class FreshRSS_Feed extends Minz_Model {
$elinks = array();
foreach ($item->get_enclosures() as $enclosure) {
$elink = $enclosure->get_link();
- if (array_key_exists($elink, $elinks)) continue;
- $elinks[$elink] = '1';
- $mime = strtolower($enclosure->get_type());
- if (strpos($mime, 'image/') === 0) {
- $content .= '';
+ if (empty($elinks[$elink])) {
+ $elinks[$elink] = '1';
+ $mime = strtolower($enclosure->get_type());
+ if (strpos($mime, 'image/') === 0) {
+ $content .= '
';
+ }
}
}
diff --git a/app/Models/Share.php b/app/Models/Share.php
index 887fcef05..b146db722 100644
--- a/app/Models/Share.php
+++ b/app/Models/Share.php
@@ -3,9 +3,6 @@
class FreshRSS_Share {
static public function generateUrl($options, $selected, $link, $title) {
- if (!array_key_exists('url', $selected)) {
- $selected['url'] = '';
- }
$share = $options[$selected['type']];
$matches = array(
'~URL~',
diff --git a/app/Models/Themes.php b/app/Models/Themes.php
index c7099a1df..ed746b7e9 100644
--- a/app/Models/Themes.php
+++ b/app/Models/Themes.php
@@ -77,6 +77,7 @@ class FreshRSS_Themes extends Minz_Model {
'down' => '▽',
'favorite' => '★',
'help' => 'ⓘ',
+ 'key' => '⚿',
'link' => '↗',
'login' => '🔒',
'logout' => '🔓',
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 7f812dce6..e9bed39a7 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -89,7 +89,7 @@ return array (
'already_subscribed' => 'You have already subscribed to %s',
'feed_added' => 'RSS feed %s has been added',
'feed_not_added' => '%s could not be added',
- 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.',
+ 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.',
'invalid_url' => 'URL %s is invalid',
'feed_actualized' => '%s has been updated',
'n_feeds_actualized' => '%d feeds have been updated',
@@ -180,6 +180,8 @@ return array (
'persona_connection_email' => 'Login mail address
(for Mozilla Persona)',
'allow_anonymous' => 'Allow anonymous reading of the articles of the default user (%s)',
'allow_anonymous_refresh' => 'Allow anonymous refresh of the articles',
+ 'unsafe_autologin' => 'Allow unsafe automatic login using the format: ',
+ 'api_enabled' => 'Allow API access (required for mobile apps)',
'auth_token' => 'Authentication token',
'explain_token' => 'Allows to access RSS output of the default user without authentication.
%s?output=rss&token=%s',
'login_configuration' => 'Login',
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index 6aa25f7db..24f3741c8 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -89,7 +89,7 @@ return array (
'already_subscribed' => 'Vous êtes déjà abonné à %s',
'feed_added' => 'Le flux %s a bien été ajouté',
'feed_not_added' => '%s n’a pas pu être ajouté',
- 'internal_problem_feed' => 'Le flux n’a pas pu être ajouté. Consulter les logs de FreshRSS pour plus de détails.',
+ 'internal_problem_feed' => 'Le flux n’a pas pu être ajouté. Consulter les logs de FreshRSS pour plus de détails.',
'invalid_url' => 'L’url %s est invalide',
'feed_actualized' => '%s a été mis à jour',
'n_feeds_actualized' => '%d flux ont été mis à jour',
@@ -180,6 +180,8 @@ return array (
'persona_connection_email' => 'Adresse courriel de connexion
(pour Mozilla Persona)',
'allow_anonymous' => 'Autoriser la lecture anonyme des articles de l’utilisateur par défaut (%s)',
'allow_anonymous_refresh' => 'Autoriser le rafraîchissement anonyme des flux',
+ 'unsafe_autologin' => 'Autoriser les connexion automatiques non-sûres au format : ',
+ 'api_enabled' => 'Autoriser l’accès par API (nécessaire pour les applis mobiles)',
'auth_token' => 'Jeton d’identification',
'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
%s?output=rss&token=%s',
'login_configuration' => 'Identification',
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index 63f171924..899cafe02 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -20,9 +20,14 @@
name (); ?>
+
+