From 7dfb4fbd7a7c3b77c8332c453e7fb03c7215043a Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 2 Dec 2016 08:40:42 +0000 Subject: [PATCH] remove a buggy line from AccessHandler.pm. change the user home view to accept a userid. wip --- codepot/etc/perl/Codepot/AccessHandler.pm | 1 - codepot/src/codepot/controllers/user.php | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/codepot/etc/perl/Codepot/AccessHandler.pm b/codepot/etc/perl/Codepot/AccessHandler.pm index bfbc38a5..05eecb00 100644 --- a/codepot/etc/perl/Codepot/AccessHandler.pm +++ b/codepot/etc/perl/Codepot/AccessHandler.pm @@ -187,7 +187,6 @@ sub authenticate_ldap last search_loop; } } - if ($authenticated >= 2) last; } } $res->abandon(); diff --git a/codepot/src/codepot/controllers/user.php b/codepot/src/codepot/controllers/user.php index 74d74992..ff3e2255 100644 --- a/codepot/src/codepot/controllers/user.php +++ b/codepot/src/codepot/controllers/user.php @@ -27,13 +27,17 @@ class User extends Controller return $this->home (); } - function home () + function home ($userid = '') { $login = $this->login->getUser (); - if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') + if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') + { redirect ('main/signin'); + return; + } - if ($login['id'] == '') + if ($userid == '') $userid = $login['id']; + if ($userid == '') { redirect ('site/home'); return; @@ -45,10 +49,10 @@ class User extends Controller $this->load->model ('ProjectModel', 'projects'); $this->load->model ('IssueModel', 'issues'); - $projects = $this->projects->getMyProjects ($login['id']); + $projects = $this->projects->getMyProjects ($userid); $issues = $this->issues->getMyIssues ( - $login['id'], $this->issuehelper->_get_open_status_array($this->lang)); + $userid, $this->issuehelper->_get_open_status_array($this->lang)); if ($projects === FALSE || $issues === FALSE) { $data['login'] = $login;