From cd032f6b60f138f313a8d3120e0d64bc022d123b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 19 May 2010 14:31:13 +0000 Subject: [PATCH] * fixed a minor bug in the login model. * set the default values for parameters of the controller functions --- codepot/src/codepot/controllers/code.php | 10 +++++----- codepot/src/codepot/controllers/file.php | 12 ++++++------ codepot/src/codepot/controllers/site.php | 8 ++++---- codepot/src/codepot/models/loginmodel.php | 6 +++++- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index 471ad176..e7e9d1e3 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -28,7 +28,7 @@ class Code extends Controller return $this->file ($projectid, $subdir, $rev); } - function file ($projectid, $path = '', $rev = SVN_REVISION_HEAD) + function file ($projectid = '', $path = '', $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -105,7 +105,7 @@ class Code extends Controller } } - function blame ($projectid, $path, $rev = SVN_REVISION_HEAD) + function blame ($projectid = '', $path = '', $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -169,7 +169,7 @@ class Code extends Controller } } - function history ($projectid, $path = '', $rev = SVN_REVISION_HEAD) + function history ($projectid = '', $path = '', $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -222,7 +222,7 @@ class Code extends Controller } } - function revision ($projectid, $path, $rev = SVN_REVISION_HEAD) + function revision ($projectid = '', $path = '', $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -275,7 +275,7 @@ class Code extends Controller } } - function diff ($projectid, $path, $rev1 = SVN_REVISION_HEAD, $rev2 = SVN_REVISION_HEAD) + function diff ($projectid = '', $path = '', $rev1 = SVN_REVISION_HEAD, $rev2 = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); diff --git a/codepot/src/codepot/controllers/file.php b/codepot/src/codepot/controllers/file.php index 55a63dcc..d1f468a2 100644 --- a/codepot/src/codepot/controllers/file.php +++ b/codepot/src/codepot/controllers/file.php @@ -21,7 +21,7 @@ class File extends Controller $this->lang->load ('file', CODEPOT_LANG); } - function home ($projectid = "") + function home ($projectid = '') { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('FileModel', 'files'); @@ -62,7 +62,7 @@ class File extends Controller } } - function show ($projectid, $name) + function show ($projectid = '', $name = '') { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('FileModel', 'files'); @@ -112,7 +112,7 @@ class File extends Controller } } - function get ($projectid, $name) + function get ($projectid = '', $name = '') { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('FileModel', 'files'); @@ -384,17 +384,17 @@ class File extends Controller } } - function create ($projectid, $name = "") + function create ($projectid = '', $name = '') { return $this->_edit_file ($projectid, $name, "create"); } - function update ($projectid, $name) + function update ($projectid = '', $name = '') { return $this->_edit_file ($projectid, $name, "update"); } - function delete ($projectid, $name) + function delete ($projectid = '', $name = '') { $this->load->helper ('form'); $this->load->library ('form_validation'); diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index 49a400de..5cc4f52d 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -112,7 +112,7 @@ class Site extends Controller } } - function show ($siteid) + function show ($siteid = '') { $login = $this->login->getUser (); if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') @@ -213,7 +213,7 @@ class Site extends Controller } } - function create ($siteid = "") + function create ($siteid = '') { $this->load->model ('SiteModel', 'sites'); @@ -237,7 +237,7 @@ class Site extends Controller } } - function update ($siteid) + function update ($siteid = '') { $this->load->model ('SiteModel', 'sites'); @@ -329,7 +329,7 @@ class Site extends Controller } } - function delete ($siteid) + function delete ($siteid = '') { $this->load->model ('SiteModel', 'sites'); diff --git a/codepot/src/codepot/models/loginmodel.php b/codepot/src/codepot/models/loginmodel.php index 61617963..6cdfc4ba 100644 --- a/codepot/src/codepot/models/loginmodel.php +++ b/codepot/src/codepot/models/loginmodel.php @@ -38,7 +38,11 @@ class LoginModel extends Model if ($issysadmin === NULL) $issysadmin = FALSE; $settings = $this->session->userdata('user_settings'); - if ($settings !== NULL) $settings = unserialize ($settings); + if ($settings !== NULL) + { + $settings = @unserialize ($settings); + if ($settings === FALSE) $settings = NULL; + } } return array (