diff --git a/PHPCI/Controller/SettingsController.php b/PHPCI/Controller/SettingsController.php index d0582f6a..9fce197d 100644 --- a/PHPCI/Controller/SettingsController.php +++ b/PHPCI/Controller/SettingsController.php @@ -53,9 +53,16 @@ class SettingsController extends Controller $this->settings['phpci']['github']['id'] = $this->getParam('githubid', ''); $this->settings['phpci']['github']['secret'] = $this->getParam('githubsecret', ''); - $this->storeSettings(); + $error = $this->storeSettings(); - header('Location: ' . PHPCI_URL . 'settings?saved=1'); + if($error) + { + header('Location: ' . PHPCI_URL . 'settings?saved=2'); + } + else + { + header('Location: ' . PHPCI_URL . 'settings?saved=1'); + } die; } @@ -94,6 +101,7 @@ class SettingsController extends Controller $dumper = new Dumper(); $yaml = $dumper->dump($this->settings); file_put_contents(APPLICATION_PATH . 'PHPCI/config.yml', $yaml); + if(error_get_last()) return error_get_last()['message']; } protected function getGithubForm() diff --git a/PHPCI/View/Settings/index.phtml b/PHPCI/View/Settings/index.phtml index c8206811..a88b214e 100644 --- a/PHPCI/View/Settings/index.phtml +++ b/PHPCI/View/Settings/index.phtml @@ -1,9 +1,15 @@ - +

Your settings have been saved.

+ +

+ Your settings could not be saved, maybe check the permissions of config.yml? +

+ +

Your Github account has been linked.