aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/subscriptionController.php
diff options
context:
space:
mode:
authorGravatar Clément <clement@selfhost.fr> 2017-02-15 14:12:25 +0100
committerGravatar Clément <clement@selfhost.fr> 2017-02-15 14:12:25 +0100
commit2d097bc855dbd1ad06c7c306c05e78a198209084 (patch)
tree67028e45792c575c25c92616633f64cc7a4a13eb /app/Controllers/subscriptionController.php
parentfe293900061263a1917fc1cf18ca369c8e07cb99 (diff)
parent5f637bd816b7323885bfe1751a1724ee59a822f6 (diff)
Merge remote-tracking branch 'FreshRSS/master' into dev
Diffstat (limited to 'app/Controllers/subscriptionController.php')
-rw-r--r--app/Controllers/subscriptionController.php27
1 files changed, 11 insertions, 16 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index a89168eb3..03d3ee15e 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -11,10 +11,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
*/
public function firstAction() {
if (!FreshRSS_Auth::hasAccess()) {
- Minz_Error::error(
- 403,
- array('error' => array(_t('access_denied')))
- );
+ Minz_Error::error(403);
}
$catDAO = new FreshRSS_CategoryDAO();
@@ -32,7 +29,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
public function indexAction() {
Minz_View::appendScript(Minz_Url::display('/scripts/category.js?' .
@filemtime(PUBLIC_PATH . '/scripts/category.js')));
- Minz_View::prependTitle(_t('subscription_management') . ' · ');
+ Minz_View::prependTitle(_t('sub.title') . ' · ');
$id = Minz_Request::param('id');
if ($id !== false) {
@@ -71,23 +68,20 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
$id = Minz_Request::param('id');
if ($id === false || !isset($this->view->feeds[$id])) {
- Minz_Error::error(
- 404,
- array('error' => array(_t('page_not_found')))
- );
+ Minz_Error::error(404);
return;
}
$this->view->feed = $this->view->feeds[$id];
- Minz_View::prependTitle(_t('rss_feed_management') . ' · ' . $this->view->feed->name() . ' · ');
+ Minz_View::prependTitle(_t('sub.title.feed_management') . ' · ' . $this->view->feed->name() . ' · ');
if (Minz_Request::isPost()) {
- $user = Minz_Request::param('http_user', '');
- $pass = Minz_Request::param('http_pass', '');
+ $user = trim(Minz_Request::param('http_user_feed' . $id, ''));
+ $pass = Minz_Request::param('http_pass_feed' . $id, '');
$httpAuth = '';
- if ($user != '' || $pass != '') {
+ if ($user != '' && $pass != '') { //TODO: Sanitize
$httpAuth = $user . ':' . $pass;
}
@@ -108,13 +102,14 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
invalidateHttpCache();
- if ($feedDAO->updateFeed($id, $values)) {
+ $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id));
+ if ($feedDAO->updateFeed($id, $values) !== false) {
$this->view->feed->_category($cat);
$this->view->feed->faviconPrepare();
- Minz_Request::good(_t('feed_updated'), array('c' => 'subscription', 'params' => array('id' => $id)));
+ Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect);
} else {
- Minz_Request::bad(_t('error_occurred_update'), array('c' => 'subscription'));
+ Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect);
}
}
}