From 198f8d6a8e39fe7bb21faafe53b12e351feca8b7 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 31 Dec 2014 12:56:29 -0500 Subject: Add debug option --- app/Controller/Base.php | 8 +++++--- app/Controller/Project.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'app/Controller') diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 4afcba37..cd807d56 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -100,9 +100,11 @@ abstract class Base */ public function __destruct() { - // foreach ($this->container['db']->getLogMessages() as $message) { - // $this->container['logger']->addDebug($message); - // } + if (DEBUG) { + foreach ($this->container['db']->getLogMessages() as $message) { + $this->container['logger']->addDebug($message); + } + } } /** diff --git a/app/Controller/Project.php b/app/Controller/Project.php index 6079971a..95779154 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -574,7 +574,7 @@ class Project extends Base */ public function create(array $values = array(), array $errors = array()) { - $is_private = $this->request->getIntegerParam('private', ! $this->userSession->isAdmin()); + $is_private = $this->request->getIntegerParam('private', $this->userSession->isAdmin() ? 0 : 1); $this->response->html($this->template->layout('project/new', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), -- cgit v1.2.3