From f8f55aa39b7bed50df5f64c587db039fcd090020 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 29 Aug 2017 04:47:24 +0000 Subject: [PATCH] fixed a wrong check in the user controller when listing logs --- codepot/src/codepot/controllers/user.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/controllers/user.php b/codepot/src/codepot/controllers/user.php index e13918b8..99191380 100644 --- a/codepot/src/codepot/controllers/user.php +++ b/codepot/src/codepot/controllers/user.php @@ -115,7 +115,7 @@ class User extends Controller $data['message'] = 'DATABASE ERROR'; $this->load->view ($this->VIEW_ERROR, $data); } - else if ($myprojs === NULL) + else if ($myprojs === NULL || count($myprojs) == 0) { $data['login'] = $login; $data['message'] = 'NO PROJECTS'; @@ -127,6 +127,7 @@ class User extends Controller $this->load->model ('LogModel', 'logs'); $numprojs = count($myprojs); + $projids = array(); for ($i = 0; $i < $numprojs; $i++) $projids[$i] = $myprojs[$i]->id; @@ -134,7 +135,6 @@ class User extends Controller if ($num_log_entries === FALSE) { $data['login'] = $login; - $data['project'] = $project; $data['message'] = 'DATABASE ERROR'; $this->load->view ($this->VIEW_ERROR, $data); return; @@ -151,7 +151,6 @@ class User extends Controller if ($log_entries === FALSE) { $data['login'] = $login; - $data['project'] = $project; $data['message'] = 'DATABASE ERROR'; $this->load->view ($this->VIEW_ERROR, $data); return;