Adding a warning that PHPCI can't save your settings if the config.yml file is not writeable, fixes #369

This commit is contained in:
Dan Cryer 2014-05-12 18:37:48 +01:00
commit 3ce85ab54a
2 changed files with 12 additions and 0 deletions

View file

@ -48,6 +48,7 @@ class SettingsController extends Controller
$this->view->github = $this->getGithubForm();
$this->view->emailSettings = $this->getEmailForm($emailSettings);
$this->view->isWriteable = $this->canWriteConfig();
if (!empty($this->settings['phpci']['github']['token'])) {
$this->view->githubUser = $this->getGithubUser($this->settings['phpci']['github']['token']);
@ -242,4 +243,9 @@ class SettingsController extends Controller
return $user['body'];
}
protected function canWriteConfig()
{
return is_writeable(APPLICATION_PATH . 'PHPCI/config.yml');
}
}