aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/updateController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-05-26 09:46:12 +0200
committerGravatar GitHub <noreply@github.com> 2017-05-26 09:46:12 +0200
commitb3addb49dca4fc06d13d9c57617273fbcd4460da (patch)
tree8f9c22c6414d362ce9d7fbc8a2677192a6f1bfb1 /app/Controllers/updateController.php
parent431683eb3d118a1072999e899ab2faf3cf58a5e4 (diff)
parent99c7450343115ad9082cc0e1d12887633d99d935 (diff)
Merge pull request #1544 from Alkarex/update-status
Update status
Diffstat (limited to 'app/Controllers/updateController.php')
-rw-r--r--app/Controllers/updateController.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 35c7d1124..7a8a3d6c0 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -59,24 +59,26 @@ class FreshRSS_update_Controller extends Minz_ActionController {
public function indexAction() {
Minz_View::prependTitle(_t('admin.update.title') . ' ยท ');
- if (!is_writable(FRESHRSS_PATH)) {
- $this->view->message = array(
- 'status' => 'bad',
- 'title' => _t('gen.short.damn'),
- 'body' => _t('feedback.update.file_is_nok', FRESHRSS_PATH)
- );
- } elseif (file_exists(UPDATE_FILENAME)) {
+ if (file_exists(UPDATE_FILENAME)) {
// There is an update file to apply!
$version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt'));
- if (empty($version)) {
+ if ($version == '') {
$version = 'unknown';
}
- $this->view->update_to_apply = true;
- $this->view->message = array(
- 'status' => 'good',
- 'title' => _t('gen.short.ok'),
- 'body' => _t('feedback.update.can_apply', $version)
- );
+ if (is_writable(FRESHRSS_PATH)) {
+ $this->view->update_to_apply = true;
+ $this->view->message = array(
+ 'status' => 'good',
+ 'title' => _t('gen.short.ok'),
+ 'body' => _t('feedback.update.can_apply', $version),
+ );
+ } else {
+ $this->view->message = array(
+ 'status' => 'bad',
+ 'title' => _t('gen.short.damn'),
+ 'body' => _t('feedback.update.file_is_nok', $version, FRESHRSS_PATH),
+ );
+ }
}
}