From cd38bcce95ccdcebf4eb064f31488f803d7e9516 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 31 Mar 2015 04:15:37 +0000 Subject: [PATCH] fixed the wiki access problem for a non-public project --- codepot/src/codepot/controllers/wiki.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/codepot/src/codepot/controllers/wiki.php b/codepot/src/codepot/controllers/wiki.php index 6a72909a..e77f4e55 100644 --- a/codepot/src/codepot/controllers/wiki.php +++ b/codepot/src/codepot/controllers/wiki.php @@ -104,6 +104,12 @@ class Wiki extends Controller } else { + if ($project->public !== 'Y' && $login['id'] == '') + { + // non-public projects require sign-in. + redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); + } + $link = $this->wikihelper->parseLink ( $name, $projectid, $this->converter); if ($link === FALSE) @@ -200,6 +206,7 @@ class Wiki extends Controller if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); + if ($wikiname == '' || $name == '') { $data['login'] = $login; @@ -244,6 +251,12 @@ class Wiki extends Controller } else { + if ($project->public !== 'Y' && $login['id'] == '') + { + // non-public projects require sign-in. + redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); + } + $att = $this->wikis->getAttachment ($login['id'], $project, $wikiname, $name); if ($att === FALSE) { @@ -596,6 +609,12 @@ class Wiki extends Controller } else { + if ($project->public !== 'Y' && $login['id'] == '') + { + // non-public projects require sign-in. + redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); + } + $data['message'] = ''; $data['project'] = $project;