* fixed a minor bug in the login model.

* set the default values for parameters of the controller functions
This commit is contained in:
hyung-hwan 2010-05-19 14:31:13 +00:00
parent b3033def53
commit cd032f6b60
4 changed files with 20 additions and 16 deletions

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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 (