Removed Github configuration from ProjectController / ProjectForm and added it to a new settings area.

This commit is contained in:
Dan Cryer 2013-10-11 21:51:23 +01:00
commit 2a47b08fec
10 changed files with 332 additions and 88 deletions

View file

@ -47,6 +47,10 @@ class PluginController extends \PHPCI\Controller
public function index()
{
if (!$_SESSION['user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$this->view->canWrite = is_writable(APPLICATION_PATH . 'composer.json');
$this->view->canInstall = $this->canInstall;
$this->view->required = $this->required;
@ -60,6 +64,10 @@ class PluginController extends \PHPCI\Controller
public function remove()
{
if (!$_SESSION['user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$package = $this->getParam('package', null);
$json = $this->getComposerJson();
@ -81,6 +89,10 @@ class PluginController extends \PHPCI\Controller
public function install()
{
if (!$_SESSION['user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$package = $this->getParam('package', null);
$version = $this->getParam('version', '*');