* enhanced sign-in handling

* fixed attachment cache control.
This commit is contained in:
hyung-hwan 2010-04-28 14:33:25 +00:00
parent 7596d92c9e
commit f9208d86a5
39 changed files with 299 additions and 202 deletions

View File

@ -5,6 +5,7 @@
[ -d "@LOGDIR@" ] || { mkdir -p "@LOGDIR@" && logdir=1; } [ -d "@LOGDIR@" ] || { mkdir -p "@LOGDIR@" && logdir=1; }
[ -d "@DEPOTDIR@/svnrepo" ] || { mkdir -p "@DEPOTDIR@/svnrepo" && svnrepodir=1; } [ -d "@DEPOTDIR@/svnrepo" ] || { mkdir -p "@DEPOTDIR@/svnrepo" && svnrepodir=1; }
[ -d "@DEPOTDIR@/files" ] || { mkdir -p "@DEPOTDIR@/files" && filesdir=1; } [ -d "@DEPOTDIR@/files" ] || { mkdir -p "@DEPOTDIR@/files" && filesdir=1; }
[ -d "@DEPOTDIR@/attachments" ] || { mkdir -p "@DEPOTDIR@/attachments" && attachmentsdir=1; }
[ -f "@SYSCONFDIR@/apache2/envvars" ] && { [ -f "@SYSCONFDIR@/apache2/envvars" ] && {
GROUP=$(. "@SYSCONFDIR@/apache2/envvars" && echo "${APACHE_RUN_GROUP}") GROUP=$(. "@SYSCONFDIR@/apache2/envvars" && echo "${APACHE_RUN_GROUP}")
@ -21,9 +22,9 @@
chgrp -R "${GROUP}" "@DEPOTDIR@/svnrepo" chgrp -R "${GROUP}" "@DEPOTDIR@/svnrepo"
chmod 0775 "@DEPOTDIR@/svnrepo" chmod 0775 "@DEPOTDIR@/svnrepo"
} }
[ "${filesdir}" = "1" ] && { [ "${attachmentsdir}" = "1" ] && {
chgrp -R "${GROUP}" "@DEPOTDIR@/files" chgrp -R "${GROUP}" "@DEPOTDIR@/attachments"
chmod 0775 "@DEPOTDIR@/files" chmod 0775 "@DEPOTDIR@/attachments"
} }
} }
} }

View File

@ -4,6 +4,7 @@
[ -d "@LOGDIR@" ] && rmdir "@LOGDIR@" 2>/dev/null [ -d "@LOGDIR@" ] && rmdir "@LOGDIR@" 2>/dev/null
[ -d "@DEPOTDIR@/svnrepo" ] && rmdir "@DEPOTDIR@/svnrepo" 2>/dev/null [ -d "@DEPOTDIR@/svnrepo" ] && rmdir "@DEPOTDIR@/svnrepo" 2>/dev/null
[ -d "@DEPOTDIR@/files" ] && rmdir "@DEPOTDIR@/files" 2>/dev/null [ -d "@DEPOTDIR@/files" ] && rmdir "@DEPOTDIR@/files" 2>/dev/null
[ -d "@DEPOTDIR@/attachments" ] && rmdir "@DEPOTDIR@/attachments" 2>/dev/null
[ -d "@DEPOTDIR@" ] && rmdir "@DEPOTDIR@" 2>/dev/null [ -d "@DEPOTDIR@" ] && rmdir "@DEPOTDIR@" 2>/dev/null
exit 0 exit 0

View File

@ -699,9 +699,9 @@ install-data-hook:
$(INSTALL) -d "$(DESTDIR)@CACHEDIR@" $(INSTALL) -d "$(DESTDIR)@CACHEDIR@"
uninstall-hook: uninstall-hook:
$(RMDIR) "$(DESTDIR)@DEPOTDIR@/svnrepo"
$(RMDIR) "$(DESTDIR)@DEPOTDIR@/files"
$(RMDIR) "$(DESTDIR)@DEPOTDIR@/attachments" $(RMDIR) "$(DESTDIR)@DEPOTDIR@/attachments"
$(RMDIR) "$(DESTDIR)@DEPOTDIR@/files"
$(RMDIR) "$(DESTDIR)@DEPOTDIR@/svnrepo"
$(RMDIR) "$(DESTDIR)@DEPOTDIR@" $(RMDIR) "$(DESTDIR)@DEPOTDIR@"
$(RMDIR) "$(DESTDIR)@LOGDIR@" $(RMDIR) "$(DESTDIR)@LOGDIR@"
$(RMDIR) "$(DESTDIR)@CACHEDIR@" $(RMDIR) "$(DESTDIR)@CACHEDIR@"

View File

@ -53,10 +53,12 @@ rm -rf $RPM_BUILD_ROOT
%attr(-,apache,apache) /var/lib/codepot/svnrepo %attr(-,apache,apache) /var/lib/codepot/svnrepo
%attr(-,apache,apache) /var/lib/codepot/files %attr(-,apache,apache) /var/lib/codepot/files
%attr(-,apache,apache) /var/lib/codepot/attachments
%attr(-,apache,apache) /var/log/codepot %attr(-,apache,apache) /var/log/codepot
%attr(-,apache,apache) /var/cache/codepot %attr(-,apache,apache) /var/cache/codepot
%dir /var/lib/codepot/svnrepo %dir /var/lib/codepot/svnrepo
%dir /var/lib/codepot/files %dir /var/lib/codepot/files
%dir /var/lib/codepot/attachments
%dir /var/log/codepot %dir /var/log/codepot
%dir /var/cache/codepot %dir /var/cache/codepot

View File

@ -1,7 +1,7 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; default site language ; default site language
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
default_site_language = "english"; default_site_language = "english"
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; default site name ; default site name
@ -153,5 +153,5 @@ force_project_delete = "no"
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Leave this empty for the default footer message ; Leave this empty for the default footer message
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
footer = ""; footer = ""

View File

@ -35,7 +35,7 @@ class Code extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$path = $this->converter->HexToAscii ($path); $path = $this->converter->HexToAscii ($path);
@ -112,7 +112,7 @@ class Code extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$path = $this->converter->HexToAscii ($path); $path = $this->converter->HexToAscii ($path);
@ -176,7 +176,7 @@ class Code extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$path = $this->converter->HexToAscii ($path); $path = $this->converter->HexToAscii ($path);
@ -229,7 +229,7 @@ class Code extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$path = $this->converter->HexToAscii ($path); $path = $this->converter->HexToAscii ($path);
@ -282,7 +282,7 @@ class Code extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$path = $this->converter->HexToAscii ($path); $path = $this->converter->HexToAscii ($path);

View File

@ -18,6 +18,7 @@ class File extends Controller
$this->load->library ('Language', 'lang'); $this->load->library ('Language', 'lang');
$this->lang->load ('common', CODEPOT_LANG); $this->lang->load ('common', CODEPOT_LANG);
$this->lang->load ('file', CODEPOT_LANG);
} }
function home ($projectid = "") function home ($projectid = "")
@ -27,7 +28,7 @@ class File extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$project = $this->projects->get ($projectid); $project = $this->projects->get ($projectid);
@ -68,7 +69,7 @@ class File extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -98,9 +99,8 @@ class File extends Controller
else if ($file === NULL) else if ($file === NULL)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = $data['message'] = sprintf (
$this->lang->line('MSG_NO_SUCH_FILE'). $this->lang->line('FILE_MSG_NO_SUCH_FILE'), $name);
" - {$name}";
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -119,7 +119,7 @@ class File extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -148,7 +148,7 @@ class File extends Controller
} }
else if ($file === NULL) else if ($file === NULL)
{ {
redirect ('file/create/'. $projectid . '/' . redirect ("file/create/{$projectid}/" .
$this->converter->AsciiToHex($name)); $this->converter->AsciiToHex($name));
} }
else else
@ -197,7 +197,8 @@ class File extends Controller
$this->load->model ('FileModel', 'files'); $this->load->model ('FileModel', 'files');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -219,7 +220,8 @@ class File extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -262,13 +264,22 @@ class File extends Controller
} }
else else
{ {
redirect ('file/show/' . $project->id . '/' . redirect ("file/show/{$project->id}/" .
$this->converter->AsciiToHex($file->name)); $this->converter->AsciiToHex($file->name));
} }
} }
else else
{ {
$fname = $_FILES['file_name']['name']; $fname = $_FILES['file_name']['name'];
if (strpos ($fname, ':') !== FALSE)
{
$data['message'] = $this->lang->line ('FILE_MSG_NAME_NO_COLON');
$data['file'] = $file;
$this->load->view ($this->VIEW_EDIT, $data);
return;
}
$ext = substr ($fname, strrpos ($fname, '.') + 1); $ext = substr ($fname, strrpos ($fname, '.') + 1);
// delete all \" instances ... // delete all \" instances ...
@ -320,7 +331,7 @@ class File extends Controller
} }
else else
{ {
redirect ('file/show/' . $project->id . '/' . redirect ("file/show/{$project->id}/" .
$this->converter->AsciiToHex($file->name)); $this->converter->AsciiToHex($file->name));
} }
} }
@ -346,7 +357,8 @@ class File extends Controller
} }
else if ($file == NULL) else if ($file == NULL)
{ {
$data['message'] = "NO SUCH FILE - $name"; $data['message'] = sprintf
($this->lang->line('FILE_MSG_NO_SUCH_FILE'), $name);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -390,7 +402,8 @@ class File extends Controller
$this->load->model ('FileModel', 'files'); $this->load->model ('FileModel', 'files');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -412,7 +425,8 @@ class File extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -468,7 +482,8 @@ class File extends Controller
} }
else if ($file === NULL) else if ($file === NULL)
{ {
$data['message'] = "NO SUCH FILE - $name"; $data['message'] = sprintf
($this->lang->line('FILE_MSG_NO_SUCH_FILE'), $name);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else

View File

@ -30,7 +30,7 @@ class Issue extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$project = $this->projects->get ($projectid); $project = $this->projects->get ($projectid);
@ -145,7 +145,7 @@ class Issue extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
if ($hexid == '') if ($hexid == '')
@ -185,7 +185,8 @@ class Issue extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else if ($this->issues->change ($login['id'], $project, $id, $change) === FALSE) else if ($this->issues->change ($login['id'], $project, $id, $change) === FALSE)
@ -206,7 +207,8 @@ class Issue extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else if ($this->issues->undo_last_change ($login['id'], $project, $id) === FALSE) else if ($this->issues->undo_last_change ($login['id'], $project, $id) === FALSE)
@ -232,9 +234,8 @@ class Issue extends Controller
else if ($issue === NULL) else if ($issue === NULL)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = $data['message'] = sprintf (
$this->lang->line('MSG_NO_SUCH_ISSUE'). $this->lang->line('ISSUE_MSG_NO_SUCH_ISSUE'), $id);
" - {$id}";
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -257,7 +258,8 @@ class Issue extends Controller
$this->load->model ('IssueModel', 'issues'); $this->load->model ('IssueModel', 'issues');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$id = $this->converter->HexToAscii ($hexid); $id = $this->converter->HexToAscii ($hexid);
@ -279,7 +281,8 @@ class Issue extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -353,9 +356,8 @@ class Issue extends Controller
} }
else if ($issue == NULL) else if ($issue == NULL)
{ {
$data['message'] = $data['message'] = sprintf (
$this->lang->line('MSG_NO_SUCH_ISSUE') . $this->lang->line('ISSUE_MSG_NO_SUCH_ISSUE'), $id);
" - {$id}";
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -402,7 +404,8 @@ class Issue extends Controller
$this->load->model ('IssueModel', 'issues'); $this->load->model ('IssueModel', 'issues');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$id = $this->converter->HexToAscii ($hexid); $id = $this->converter->HexToAscii ($hexid);
@ -424,7 +427,8 @@ class Issue extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -479,9 +483,8 @@ class Issue extends Controller
} }
else if ($issue === NULL) else if ($issue === NULL)
{ {
$data['message'] = $data['message'] = sprintf (
$this->lang->line('MSG_NO_SUCH_ISSUE') . $this->lang->line('ISSUE_MSG_NO_SUCH_ISSUE'), $id);
" - {$id}";
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else

View File

@ -15,7 +15,12 @@ class Main extends Controller
$this->lang->load ('common', CODEPOT_LANG); $this->lang->load ('common', CODEPOT_LANG);
} }
function index() function index ($xurl = '')
{
redirect ("main/signin/$xurl");
}
function signin ($xurl = '')
{ {
$this->load->library(array('encrypt', 'form_validation', 'session')); $this->load->library(array('encrypt', 'form_validation', 'session'));
@ -43,7 +48,7 @@ class Main extends Controller
} }
else else
{ {
if ($user_url != "") redirect ($user_url); if ($user_url != '') redirect ($user_url);
else redirect ('site/home'); else redirect ('site/home');
} }
} }
@ -60,15 +65,11 @@ class Main extends Controller
$this->login->deauthenticate (); $this->login->deauthenticate ();
$data['user_name'] = ''; $data['user_name'] = '';
$data['user_pass'] = ''; $data['user_pass'] = '';
$data['user_url'] = ''; $data['user_url'] = $this->converter->HexToAscii($xurl);
$this->load->view ('login', $data); $this->load->view ('login', $data);
} }
} }
function signin ()
{
redirect ('main/index');
}
function signout ($xurl = "") function signout ($xurl = "")
{ {

View File

@ -29,7 +29,7 @@ class Project extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
if ($filter == '') if ($filter == '')
@ -117,7 +117,7 @@ class Project extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
@ -206,7 +206,7 @@ class Project extends Controller
} }
else else
{ {
redirect ('project/home/' . $project->id); redirect ("project/home/{$project->id}");
} }
} }
else else
@ -237,7 +237,8 @@ class Project extends Controller
$this->load->model ('ProjectModel', 'projects'); $this->load->model ('ProjectModel', 'projects');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$project->id = $projectid; $project->id = $projectid;
$project->name = ''; $project->name = '';
@ -253,7 +254,8 @@ class Project extends Controller
$this->load->model ('ProjectModel', 'projects'); $this->load->model ('ProjectModel', 'projects');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$project = $this->projects->get ($projectid); $project = $this->projects->get ($projectid);
if ($project === FALSE) if ($project === FALSE)
@ -275,7 +277,8 @@ class Project extends Controller
{ {
$data['project'] = $project; $data['project'] = $project;
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -350,7 +353,8 @@ class Project extends Controller
$this->load->model ('ProjectModel', 'projects'); $this->load->model ('ProjectModel', 'projects');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$project = $this->projects->get ($projectid); $project = $this->projects->get ($projectid);
if ($project === FALSE) if ($project === FALSE)
@ -372,7 +376,8 @@ class Project extends Controller
{ {
$data['login'] = $login; $data['login'] = $login;
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else

View File

@ -34,7 +34,7 @@ class Site extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
$this->load->model ('ProjectModel', 'projects'); $this->load->model ('ProjectModel', 'projects');
@ -92,7 +92,7 @@ class Site extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
@ -116,7 +116,7 @@ class Site extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
@ -128,18 +128,17 @@ class Site extends Controller
$data['login'] = $login; $data['login'] = $login;
$data['message'] = 'DATABASE ERROR'; $data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
return;
} }
else if ($site === NULL)
if ($site === NULL)
{ {
$data['message'] = "NO SUCH SITE - {$siteid}"; $data['message'] = sprintf ($this->lang->line('SITE_MSG_NO_SUCH_SITE'), $siteid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
return;
} }
else
$data['site'] = $site; {
$this->load->view ($this->VIEW_SHOW, $data); $data['site'] = $site;
$this->load->view ($this->VIEW_SHOW, $data);
}
} }
function _edit_site ($site, $mode, $login) function _edit_site ($site, $mode, $login)
@ -219,12 +218,13 @@ class Site extends Controller
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
if (!$login['sysadmin?']) if (!$login['sysadmin?'])
{ {
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO PERMISSION"; $data['message'] = $this->lang->line('SITE_MSG_ADMINISTRATORSHIP_REQUIRED');
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -242,7 +242,8 @@ class Site extends Controller
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$site = $this->sites->get ($siteid); $site = $this->sites->get ($siteid);
if ($site === FALSE) if ($site === FALSE)
@ -254,13 +255,13 @@ class Site extends Controller
else if ($site === NULL) else if ($site === NULL)
{ {
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO SUCH SITE - $siteid"; $data['message'] = sprintf ($this->lang->line('SITE_MSG_NO_SUCH_SITE'), $siteid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else if (!$login['sysadmin?']) else if (!$login['sysadmin?'])
{ {
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO PERMISSION - $siteid"; $data['message'] = $this->lang->line('SITE_MSG_ADMINISTRATORSHIP_REQUIRED');
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -333,7 +334,8 @@ class Site extends Controller
$this->load->model ('SiteModel', 'sites'); $this->load->model ('SiteModel', 'sites');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main/signin'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$site = $this->sites->get ($siteid); $site = $this->sites->get ($siteid);
if ($site === FALSE) if ($site === FALSE)
@ -345,13 +347,13 @@ class Site extends Controller
else if ($site === NULL) else if ($site === NULL)
{ {
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO SUCH SITE - $siteid"; $data['message'] = sprintf ($this->lang->line('SITE_MSG_NO_SUCH_SITE'), $siteid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else if (!$login['sysadmin?']) else if (!$login['sysadmin?'])
{ {
$data['login'] = $login; $data['login'] = $login;
$data['message'] = "NO PERMISSION - $siteid"; $data['message'] = $this->lang->line('SITE_MSG_ADMINISTRATORSHIP_REQUIRED');
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -433,7 +435,7 @@ class Site extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
@ -458,7 +460,7 @@ class Site extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;

View File

@ -30,7 +30,7 @@ class Wiki extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$project = $this->projects->get ($projectid); $project = $this->projects->get ($projectid);
@ -71,7 +71,7 @@ class Wiki extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
if ($name == '') if ($name == '')
@ -105,45 +105,54 @@ class Wiki extends Controller
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "INVALID LINK - {$name}"; $data['message'] = "INVALID LINK - {$name}";
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
return;
} }
else if ($link !== NULL) else if ($link !== NULL)
{ {
// redirect to a special link like __WIKI__:projectid:wikiname
if ($link->extra === NULL) if ($link->extra === NULL)
redirect ("{$link->type}/{$link->target}/{$link->projectid}"); redirect ("{$link->type}/{$link->target}/{$link->projectid}");
else else
redirect ("{$link->type}/{$link->target}/{$link->projectid}/{$link->extra}"); redirect ("{$link->type}/{$link->target}/{$link->projectid}/{$link->extra}");
return;
} }
else
$wiki = $this->wikis->get ($login['id'], $project, $name);
if ($wiki === FALSE)
{ {
$data['project'] = $project; $wiki = $this->wikis->get ($login['id'], $project, $name);
$data['message'] = 'DATABASE ERROR'; if ($wiki === FALSE)
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($wiki === NULL)
{
if ($create)
{ {
redirect ("wiki/create/{$projectid}/" . $data['project'] = $project;
$this->converter->AsciiToHex($name)); $data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($wiki === NULL)
{
if ($create)
{
// Redirecting to the 'new' page is determined by the project membership
// when the wiki page is not found.
$create = ($login['sysadmin?'] ||
$this->projects->projectHasMember($project->id, $login['id']));
}
if ($create)
{
redirect ("wiki/create/{$projectid}/" .
$this->converter->AsciiToHex($name));
}
else
{
$data['project'] = $project;
$data['message'] = sprintf (
$this->lang->line('WIKI_MSG_NO_SUCH_PAGE'), $name);
$this->load->view ($this->VIEW_ERROR, $data);
}
} }
else else
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = sprintf ( $data['wiki'] = $wiki;
$this->lang->line('WIKI_MSG_NO_SUCH_PAGE'), $name); $this->load->view ($this->VIEW_SHOW, $data);
$this->load->view ($this->VIEW_ERROR, $data);
} }
} }
else
{
$data['project'] = $project;
$data['wiki'] = $wiki;
$this->load->view ($this->VIEW_SHOW, $data);
}
} }
} }
@ -163,7 +172,7 @@ class Wiki extends Controller
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
if ($target == '') if ($target == '')
{ {
@ -186,7 +195,7 @@ class Wiki extends Controller
{ {
$login = $this->login->getUser (); $login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin'); redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
if ($wikiname == '' || $name == '') if ($wikiname == '' || $name == '')
{ {
@ -233,40 +242,42 @@ class Wiki extends Controller
else else
{ {
$att = $this->wikis->getAttachment ($login['id'], $project, $wikiname, $name); $att = $this->wikis->getAttachment ($login['id'], $project, $wikiname, $name);
if ($att == FALSE) if ($att === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = 'DATABASE ERROR'; $data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
return;
} }
else if ($att === NULL) else if ($att === NULL)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = sprintf ( $data['message'] = sprintf (
$this->lang->line('MSG_WIKI_NO_SUCH_ATTACHMENT'), $name); $this->lang->line('WIKI_MSG_NO_SUCH_ATTACHMENT'), $name);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else
$path = CODEPOT_ATTACHMENT_DIR . "/{$att->encname}";
$mtime = @filemtime ($path);
if ($mtime === FALSE) $mtime = time();
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $mtime) . ' GMT');
header ('Content-Type: ' . mime_content_type($path));
header("Content-Disposition: filename={$name}");
$len = @filesize($path);
if ($len !== FALSE) header("Content-Length: {$len}");
//header("Content-Transfer-Encoding: binary");
flush ();
$x = @readfile($path);
if ($x === FALSE)
{ {
$data['project'] = $project; $path = CODEPOT_ATTACHMENT_DIR . "/{$att->encname}";
$data['message'] = sprintf (
$this->lang->line('MSG_WIKI_FAILED_TO_READ_ATTACHMENT'), $name); $mtime = @filemtime ($path);
$this->load->view ($this->VIEW_ERROR, $data); if ($mtime === FALSE) $mtime = time();
header ('Content-Type: ' . mime_content_type($path));
header ('Expires: ' . gmdate("D, d M Y H:i:s", time() + 60*60*24*30) . ' GMT'); // 30days
header ('Last-Modified: ' . gmdate("D, d M Y H:i:s", $mtime) . ' GMT');
header ("Content-Disposition: filename={$name}");
$len = @filesize($path);
if ($len !== FALSE) header("Content-Length: {$len}");
//header("Content-Transfer-Encoding: binary");
flush ();
$x = @readfile($path);
if ($x === FALSE)
{
$data['project'] = $project;
$data['message'] = sprintf (
$this->lang->line('WIKI_MSG_FAILED_TO_READ_ATTACHMENT'), $name);
$this->load->view ($this->VIEW_ERROR, $data);
}
} }
} }
} }
@ -281,7 +292,8 @@ class Wiki extends Controller
$this->load->model ('WikiModel', 'wikis'); $this->load->model ('WikiModel', 'wikis');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -303,7 +315,8 @@ class Wiki extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else
@ -324,44 +337,58 @@ class Wiki extends Controller
if ($this->input->post('wiki')) if ($this->input->post('wiki'))
{ {
$wiki->projectid = $this->input->post('wiki_projectid'); $wiki->projectid = $this->input->post('wiki_projectid');
$wiki->name = $this->input->post('wiki_name'); $wiki->name = $this->input->post('wiki_name');
$wiki->text = $this->input->post('wiki_text'); $wiki->text = $this->input->post('wiki_text');
$wiki->attachments = array();
$wiki->delete_attachments = array(); $wiki->delete_attachments = array();
$delatts = $this->input->post('wiki_delete_attachment');
if (!empty($delatts))
{
foreach ($delatts as $att)
{
$atpos = strpos ($att, '@');
if ($atpos === FALSE) continue;
$attinfo['name'] = $this->converter->HexToAscii(substr ($att, 0, $atpos));
$attinfo['encname'] = $this->converter->HexToAscii(substr ($att, $atpos + 1));
array_push (
$wiki->delete_attachments,
(object)$attinfo
);
}
}
$wiki->attachments = $this->wikis->getAttachments (
$login['id'], $project, $wiki->name);
if ($wiki->attachments === FALSE)
{
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
if ($this->form_validation->run()) if ($this->form_validation->run())
{ {
$delatts = $this->input->post('wiki_delete_attachment');
if (!empty($delatts))
{
foreach ($delatts as $att)
{
$atpos = strpos ($att, '@');
if ($atpos === FALSE) continue;
$attinfo['name'] = $this->converter->HexToAscii(
substr ($att, 0, $atpos));
$attinfo['encname'] = $this->converter->HexToAscii(
substr ($att, $atpos + 1));
array_push (
$wiki->delete_attachments,
(object)$attinfo
);
}
}
$atts = $this->wikis->getAttachments (
$login['id'], $project, $wiki->name);
if ($atts === FALSE)
{
$data['wiki'] = $wiki;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_EDIT, $data);
return;
}
$wiki->attachments = $atts;
if (strpos ($wiki->name, ':') !== FALSE)
{
$data['message'] = $this->lang->line('WIKI_MSG_NAME_NO_COLON');
$data['wiki'] = $wiki;
$this->load->view ($this->VIEW_EDIT, $data);
return;
}
if ($this->wikihelper->_is_reserved ($wiki->name, FALSE)) if ($this->wikihelper->_is_reserved ($wiki->name, FALSE))
{ {
$data['message'] = "RESERVED WIKI NAME - {$wiki->name}"; $data['message'] = sprintf (
$this->lang->line('WIKI_MSG_RESERVED_WIKI_NAME'),
$wiki->name
);
$data['wiki'] = $wiki; $data['wiki'] = $wiki;
$this->load->view ($this->VIEW_EDIT, $data); $this->load->view ($this->VIEW_EDIT, $data);
} }
@ -466,7 +493,8 @@ class Wiki extends Controller
$this->load->model ('WikiModel', 'wikis'); $this->load->model ('WikiModel', 'wikis');
$login = $this->login->getUser (); $login = $this->login->getUser ();
if ($login['id'] == '') redirect ('main'); if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login; $data['login'] = $login;
$name = $this->converter->HexToAscii ($name); $name = $this->converter->HexToAscii ($name);
@ -488,13 +516,15 @@ class Wiki extends Controller
$this->projects->projectHasMember($project->id, $login['id']) === FALSE) $this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "NO PERMISSION - $projectid"; $data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else if ($this->wikihelper->_is_reserved ($name, FALSE)) else if ($this->wikihelper->_is_reserved ($name, FALSE))
{ {
$data['project'] = $project; $data['project'] = $project;
$data['message'] = "RESERVED WIKI PAGE - $name "; $data['message'] = sprintf (
$this->lang->line('WIKI_MSG_RESERVED_WIKI_NAME'), $name);
$this->load->view ($this->VIEW_ERROR, $data); $this->load->view ($this->VIEW_ERROR, $data);
} }
else else

View File

@ -2,6 +2,7 @@ wwwdir=$(WWWDIR)/codepot/language/english
www_DATA = \ www_DATA = \
code_lang.php \ code_lang.php \
common_lang.php \ common_lang.php \
file_lang.php \
issue_lang.php \ issue_lang.php \
index.html \ index.html \
project_lang.php \ project_lang.php \

View File

@ -168,6 +168,7 @@ wwwdir = $(WWWDIR)/codepot/language/english
www_DATA = \ www_DATA = \
code_lang.php \ code_lang.php \
common_lang.php \ common_lang.php \
file_lang.php \
issue_lang.php \ issue_lang.php \
index.html \ index.html \
project_lang.php \ project_lang.php \

View File

@ -1,9 +1,7 @@
<?php <?php
$lang['CODE_COMMIT'] = 'Commit'; $lang['CODE_COMMIT'] = 'Commit';
$lang['CODE_HIDE_DETAILS'] = 'Hide details';
$lang['CODE_PROPERTIES'] = 'Properties'; $lang['CODE_PROPERTIES'] = 'Properties';
$lang['CODE_PROPERTY'] = 'Property'; $lang['CODE_PROPERTY'] = 'Property';
$lang['CODE_SHOW_DETAILS'] = 'Show details';
$lang['CODE_MSG_COMMITTED_BY_ON'] = 'Committed by %s on %s'; $lang['CODE_MSG_COMMITTED_BY_ON'] = 'Committed by %s on %s';
?> ?>

View File

@ -28,6 +28,7 @@ $lang['Files'] = 'Files';
$lang['First'] = 'First'; $lang['First'] = 'First';
$lang['Folder'] = 'Folder'; $lang['Folder'] = 'Folder';
$lang['Head revision'] = 'Head revision'; $lang['Head revision'] = 'Head revision';
$lang['Hide details'] = 'Hide details';
$lang['History'] = 'History'; $lang['History'] = 'History';
$lang['Home'] = 'Home'; $lang['Home'] = 'Home';
$lang['ID'] = 'ID'; $lang['ID'] = 'ID';
@ -62,6 +63,7 @@ $lang['Purge'] = 'Purge';
$lang['Repository'] = 'Repository'; $lang['Repository'] = 'Repository';
$lang['Revision'] = 'Revision'; $lang['Revision'] = 'Revision';
$lang['Search'] = 'Search'; $lang['Search'] = 'Search';
$lang['Show details'] = 'Show details';
$lang['Sign in'] = 'Sign in'; $lang['Sign in'] = 'Sign in';
$lang['Sign out'] = 'Sign out'; $lang['Sign out'] = 'Sign out';
$lang['Site'] = 'Site'; $lang['Site'] = 'Site';
@ -91,10 +93,8 @@ $lang['MSG_LOG_REVPROP_CHANGE_BY'] = 'Revision property %s changed by %s';
$lang['MSG_NO_DIFF'] = 'No difference found'; $lang['MSG_NO_DIFF'] = 'No difference found';
$lang['MSG_NO_CODE_AVAIL'] = 'No source code available'; $lang['MSG_NO_CODE_AVAIL'] = 'No source code available';
$lang['MSG_NO_FILES_AVAIL'] = 'No files available';
$lang['MSG_NO_ISSUES_AVAIL'] = 'No outstanding issues';
$lang['MSG_NO_SUCH_FILE'] = 'No such file';
$lang['MSG_NO_SUCH_ISSUE'] = 'No such issue';
$lang['MSG_NO_SUCH_PROJECT'] = 'No such project'; $lang['MSG_NO_SUCH_PROJECT'] = 'No such project';
$lang['MSG_SURE_TO_DELETE_THIS'] = "I'm sure to delete this"; $lang['MSG_SURE_TO_DELETE_THIS'] = "I'm sure to delete this";
$lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = 'You have to be a member of the %s project to perform this task';
?> ?>

View File

@ -0,0 +1,5 @@
<?php
$lang['FILE_MSG_NAME_NO_COLON'] = 'File name containing a colon';
$lang['FILE_MSG_NO_SUCH_FILE'] = 'No such file - %s';
$lang['FILE_MSG_NO_FILES_AVAILABLE'] = 'No files available';
?>

View File

@ -21,5 +21,7 @@ $lang['ISSUE_MSG_CHANGED_X_TO_Z'] = "Changed <span class='quoted'>%s</span> to <
$lang['ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z'] = "Changed <span class='quoted'>%s</span> from <span class='quoted'>%s</span> to <span class='quoted'>%s</span>"; $lang['ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z'] = "Changed <span class='quoted'>%s</span> from <span class='quoted'>%s</span> to <span class='quoted'>%s</span>";
$lang['ISSUE_MSG_CONFIRM_UNDO'] = 'Are you sure to undo the last change?'; $lang['ISSUE_MSG_CONFIRM_UNDO'] = 'Are you sure to undo the last change?';
$lang['ISSUE_MSG_CREATED'] = 'Created'; $lang['ISSUE_MSG_CREATED'] = 'Created';
$lang['ISSUE_MSG_NO_ISSUES_AVAILABLE'] = 'No outstanding issues';
$lang['ISSUE_MSG_NO_SUCH_ISSUE'] = 'No such issue - %s';
$lang['ISSUE_MSG_TOTAL_NUM_ISSUES'] = 'Total %d issues'; $lang['ISSUE_MSG_TOTAL_NUM_ISSUES'] = 'Total %d issues';
?> ?>

View File

@ -1,2 +1,4 @@
<?php <?php
$lang['SITE_MSG_ADMINISTRATORSHIP_REQUIRED'] = 'You have to be a system administrator to perform this task';
$lang['SITE_MSG_NO_SUCH_SITE'] = 'No such site - %s';
?> ?>

View File

@ -5,7 +5,9 @@ $lang['WIKI_MORE_NEW_ATTACHMENTS'] = 'Add more';
$lang['WIKI_MSG_ATTACHMENT_NAME_NO_COLON'] = 'Attachment name containing a colon'; $lang['WIKI_MSG_ATTACHMENT_NAME_NO_COLON'] = 'Attachment name containing a colon';
$lang['WIKI_MSG_FAILED_TO_READ_ATTACHMENT'] = 'Failed to read wiki attachment - %s'; $lang['WIKI_MSG_FAILED_TO_READ_ATTACHMENT'] = 'Failed to read wiki attachment - %s';
$lang['WIKI_MSG_NAME_NO_COLON'] = 'Wiki name containing a colon';
$lang['WIKI_MSG_NO_PAGES_AVAILABLE'] = 'No wiki pages available'; $lang['WIKI_MSG_NO_PAGES_AVAILABLE'] = 'No wiki pages available';
$lang['WIKI_MSG_NO_SUCH_PAGE'] = 'No such wiki page - %s'; $lang['WIKI_MSG_NO_SUCH_PAGE'] = 'No such wiki page - %s';
$lang['WIKI_MSG_NO_SUCH_ATTACHMENT'] = 'No such wiki attachment - %s'; $lang['WIKI_MSG_NO_SUCH_ATTACHMENT'] = 'No such wiki attachment - %s';
$lang['WIKI_MSG_RESERVED_WIKI_NAME'] = 'Wiki name containing a reserved word - %s';
?> ?>

View File

@ -2,6 +2,7 @@ wwwdir=$(WWWDIR)/codepot/language/korean
www_DATA = \ www_DATA = \
code_lang.php \ code_lang.php \
common_lang.php \ common_lang.php \
file_lang.php \
issue_lang.php \ issue_lang.php \
index.html \ index.html \
project_lang.php \ project_lang.php \

View File

@ -168,6 +168,7 @@ wwwdir = $(WWWDIR)/codepot/language/korean
www_DATA = \ www_DATA = \
code_lang.php \ code_lang.php \
common_lang.php \ common_lang.php \
file_lang.php \
issue_lang.php \ issue_lang.php \
index.html \ index.html \
project_lang.php \ project_lang.php \

View File

@ -1,9 +1,7 @@
<?php <?php
$lang['CODE_COMMIT'] = '커밋'; $lang['CODE_COMMIT'] = '커밋';
$lang['CODE_HIDE_DETAILS'] = '상세내역숨김';
$lang['CODE_PROPERTIES'] = '속성'; $lang['CODE_PROPERTIES'] = '속성';
$lang['CODE_PROPERTY'] = '속성'; $lang['CODE_PROPERTY'] = '속성';
$lang['CODE_SHOW_DETAILS'] = '상세내역보기';
$lang['CODE_MSG_COMMITTED_BY_ON'] = '%s가 %s에 커밋함'; $lang['CODE_MSG_COMMITTED_BY_ON'] = '%s가 %s에 커밋함';
?> ?>

View File

@ -28,6 +28,7 @@ $lang['Files'] = '파일';
$lang['First'] = '처음'; $lang['First'] = '처음';
$lang['Folder'] = '폴더'; $lang['Folder'] = '폴더';
$lang['Head revision'] = '최신리비전'; $lang['Head revision'] = '최신리비전';
$lang['Hide details'] = '상세내역숨김';
$lang['History'] = '변경기록'; $lang['History'] = '변경기록';
$lang['Home'] = '홈'; $lang['Home'] = '홈';
$lang['ID'] = '아이디'; $lang['ID'] = '아이디';
@ -62,6 +63,7 @@ $lang['Purge'] = '정화하기';
$lang['Repository'] = '저장소'; $lang['Repository'] = '저장소';
$lang['Revision'] = '리비전'; $lang['Revision'] = '리비전';
$lang['Search'] = '찾기'; $lang['Search'] = '찾기';
$lang['Show details'] = '상세내역보기';
$lang['Sign in'] = '로그인'; $lang['Sign in'] = '로그인';
$lang['Sign out'] = '로그아웃'; $lang['Sign out'] = '로그아웃';
$lang['Site'] = '사이트'; $lang['Site'] = '사이트';
@ -91,10 +93,9 @@ $lang['MSG_LOG_REVPROP_CHANGE_BY'] = '리비전 속성 %s을(를) %s이(가) 변
$lang['MSG_NO_DIFF'] = '차이점이 없습니다'; $lang['MSG_NO_DIFF'] = '차이점이 없습니다';
$lang['MSG_NO_CODE_AVAIL'] = '소스코드가 없습니다'; $lang['MSG_NO_CODE_AVAIL'] = '소스코드가 없습니다';
$lang['MSG_NO_FILES_AVAIL'] = '파일이 없습니다';
$lang['MSG_NO_ISSUES_AVAIL'] = '이슈항목이 없습니다';
$lang['MSG_NO_SUCH_FILE'] = '파일이 없습니다';
$lang['MSG_NO_SUCH_ISSUE'] = '이슈항목이 없습니다';
$lang['MSG_NO_SUCH_PROJECT'] = '프로젝트가 없습니다'; $lang['MSG_NO_SUCH_PROJECT'] = '프로젝트가 없습니다';
$lang['MSG_SURE_TO_DELETE_THIS'] = '반드시 이것을 삭제하고 싶어요'; $lang['MSG_SURE_TO_DELETE_THIS'] = '반드시 이것을 삭제하고 싶어요';
$lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = '이 작업을 수행하려면 %s 프로젝트의 멤버가 되어야 합니다';
?> ?>

View File

@ -0,0 +1,5 @@
<?php
$lang['FILE_MSG_NAME_NO_COLON'] = '파일이름에 콜론기호를 포함할 수 없습니다';
$lang['FILE_MSG_NO_SUCH_FILE'] = '파일이 없습니다 - %s';
$lang['FILE_MSG_NO_FILES_AVAILABLE'] = '사용할 수 있는 파일이 없습니다';
?>

View File

@ -21,5 +21,7 @@ $lang['ISSUE_MSG_CHANGED_X_TO_Z'] = "<span class='quoted'>%s</span>을/를 <span
$lang['ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z'] = "<span class='quoted'>%s</span>을/를 <span class='quoted'>%s</span>에서 <span class='quoted'>%s</span>(으)로 변경"; $lang['ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z'] = "<span class='quoted'>%s</span>을/를 <span class='quoted'>%s</span>에서 <span class='quoted'>%s</span>(으)로 변경";
$lang['ISSUE_MSG_CONFIRM_UNDO'] = '마지막 변경내용을 취소할까요?'; $lang['ISSUE_MSG_CONFIRM_UNDO'] = '마지막 변경내용을 취소할까요?';
$lang['ISSUE_MSG_CREATED'] = '생성됨'; $lang['ISSUE_MSG_CREATED'] = '생성됨';
$lang['ISSUE_MSG_NO_ISSUES_AVAILABLE'] = '처리해야 할 이슈가 없습니다';
$lang['ISSUE_MSG_NO_SUCH_ISSUE'] = '해당 이슈가 없습니다 - %s';
$lang['ISSUE_MSG_TOTAL_NUM_ISSUES'] = '전체 이슈 %d개'; $lang['ISSUE_MSG_TOTAL_NUM_ISSUES'] = '전체 이슈 %d개';
?> ?>

View File

@ -1,2 +1,4 @@
<?php <?php
$lang['SITE_MSG_ADMINISTRATORSHIP_REQUIRED'] = '이 작업은 시스템 관리자만이 수행할 수 있습니다';
$lang['SITE_MSG_NO_SUCH_SITE'] = '사이트가 없습니다 - %s';
?> ?>

View File

@ -3,9 +3,11 @@ $lang['WIKI_ATTACHMENTS'] = '첨부파일';
$lang['WIKI_NEW_ATTACHMENTS'] = '새로운 첨부파일'; $lang['WIKI_NEW_ATTACHMENTS'] = '새로운 첨부파일';
$lang['WIKI_MORE_NEW_ATTACHMENTS'] = '첨부파일 추가'; $lang['WIKI_MORE_NEW_ATTACHMENTS'] = '첨부파일 추가';
$lang['WIKI_MSG_ATTACHMENT_NAME_NO_COLON'] = '첨부파일이름에 콜론기호가 포함될 수 없습니다'; $lang['WIKI_MSG_ATTACHMENT_NAME_NO_COLON'] = '첨부파일이름에 콜론기호를 포함할 수 없습니다';
$lang['WIKI_MSG_FAILED_TO_READ_ATTACHMENT'] = '위키 첨부파일을 읽을 수 없습니다 - %s'; $lang['WIKI_MSG_FAILED_TO_READ_ATTACHMENT'] = '위키 첨부파일을 읽을 수 없습니다 - %s';
$lang['WIKI_MSG_NO_PAGES_AVAILABLE'] = '위키 페이지가 없습니다'; $lang['WIKI_MSG_NAME_NO_COLON'] = '위키이름에 콜론기호를 포함할 수 없습니다';
$lang['WIKI_MSG_NO_PAGES_AVAILABLE'] = '사용할 수 있는 위키 페이지가 없습니다';
$lang['WIKI_MSG_NO_SUCH_PAGE'] = '위키 페이지를 찾을수 없습니다 - %s'; $lang['WIKI_MSG_NO_SUCH_PAGE'] = '위키 페이지를 찾을수 없습니다 - %s';
$lang['WIKI_MSG_NO_SUCH_ATTACHMENT'] = '위키 첨부파일을 찾을 수 없습니다 - %s'; $lang['WIKI_MSG_NO_SUCH_ATTACHMENT'] = '위키 첨부파일을 찾을 수 없습니다 - %s';
$lang['WIKI_MSG_RESERVED_WIKI_NAME'] = '%s은(는) 사용할 수 없는 위키이름입니다';
?> ?>

View File

@ -83,6 +83,17 @@ class WikiHelper
return FALSE; return FALSE;
} }
else if ($ex[0] == '__WIKI__')
{
// __WIKI__:projectid:wikiname:attachment
$link->type = $this->_trans_reserved ($ex[0]);
$link->target = 'attachment0';
$link->projectid = ($ex[1] == '')? $projectid: $ex[1];
$link->extra = $converter->AsciiToHex ("{$link->projectid}:{$ex[2]}:{$ex[3]}");
return $link;
}
} }
} }
@ -91,7 +102,10 @@ class WikiHelper
function _trans_reserved ($name) function _trans_reserved ($name)
{ {
return substr (strtolower ($name), 2, strlen($name) - 4); // trim off leading and trailing double underscores blindly.
// actually it trims off the first and the last two characters
// each.
return substr (strtolower($name), 2, strlen($name) - 4);
} }
function _is_reserved ($name, $exact) function _is_reserved ($name, $exact)

View File

@ -18,9 +18,9 @@
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
if ($("#code_blame_mainarea_result_info").is(":visible")) if ($("#code_blame_mainarea_result_info").is(":visible"))
btn_label = "<?=$this->lang->line('CODE_HIDE_DETAILS')?>"; btn_label = "<?=$this->lang->line('Hide details')?>";
else else
btn_label = "<?=$this->lang->line('CODE_SHOW_DETAILS')?>"; btn_label = "<?=$this->lang->line('Show details')?>";
btn = $("#code_blame_mainarea_details_button").button({"label": btn_label}).click (function () { btn = $("#code_blame_mainarea_details_button").button({"label": btn_label}).click (function () {
@ -28,13 +28,13 @@ $(function () {
{ {
$("#code_blame_mainarea_result_info").hide("blind",{},200); $("#code_blame_mainarea_result_info").hide("blind",{},200);
$("#code_blame_mainarea_details_button").button( $("#code_blame_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('CODE_SHOW_DETAILS')?>"); "option", "label", "<?=$this->lang->line('Show details')?>");
} }
else else
{ {
$("#code_blame_mainarea_result_info").show("blind",{},200); $("#code_blame_mainarea_result_info").show("blind",{},200);
$("#code_blame_mainarea_details_button").button( $("#code_blame_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('CODE_HIDE_DETAILS')?>"); "option", "label", "<?=$this->lang->line('Hide details')?>");
} }
}); });
}); });

View File

@ -18,9 +18,9 @@
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
if ($("#code_file_mainarea_result_info").is(":visible")) if ($("#code_file_mainarea_result_info").is(":visible"))
btn_label = "<?=$this->lang->line('CODE_HIDE_DETAILS')?>"; btn_label = "<?=$this->lang->line('Hide details')?>";
else else
btn_label = "<?=$this->lang->line('CODE_SHOW_DETAILS')?>"; btn_label = "<?=$this->lang->line('Show details')?>";
btn = $("#code_file_mainarea_details_button").button({"label": btn_label}).click (function () { btn = $("#code_file_mainarea_details_button").button({"label": btn_label}).click (function () {
@ -28,13 +28,13 @@ $(function () {
{ {
$("#code_file_mainarea_result_info").hide("blind",{},200); $("#code_file_mainarea_result_info").hide("blind",{},200);
$("#code_file_mainarea_details_button").button( $("#code_file_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('CODE_SHOW_DETAILS')?>"); "option", "label", "<?=$this->lang->line('Show details')?>");
} }
else else
{ {
$("#code_file_mainarea_result_info").show("blind",{},200); $("#code_file_mainarea_result_info").show("blind",{},200);
$("#code_file_mainarea_details_button").button( $("#code_file_mainarea_details_button").button(
"option", "label", "<?=$this->lang->line('CODE_HIDE_DETAILS')?>"); "option", "label", "<?=$this->lang->line('Hide details')?>");
} }
}); });
}); });

View File

@ -45,7 +45,7 @@ $this->load->view (
<?php <?php
if (empty($files)) if (empty($files))
{ {
print htmlspecialchars($this->lang->line('MSG_NO_FILES_AVAIL')); print htmlspecialchars($this->lang->line('FILE_MSG_NO_FILES_AVAILABLE'));
} }
else else
{ {

View File

@ -153,7 +153,7 @@ $this->load->view (
<?php <?php
if (empty($issues)) if (empty($issues))
{ {
print $this->lang->line('MSG_NO_ISSUES_AVAIL'); print $this->lang->line('ISSUE_MSG_NO_ISSUES_AVAILABLE');
} }
else else
{ {

View File

@ -45,7 +45,7 @@ $this->load->view (
<?php if ($message != "") print "<div id='project_create_message' class='form_message'>$message</div>"; ?> <?php if ($message != "") print "<div id='project_create_message' class='form_message'>$message</div>"; ?>
<?=form_open('main/index/')?> <?=form_open('main/signin/')?>
<?=form_fieldset('')?> <?=form_fieldset('')?>
<?=form_hidden('user_url', set_value ('user_url', $user_url))?> <?=form_hidden('user_url', set_value ('user_url', $user_url))?>

View File

@ -53,7 +53,6 @@ $this->load->view (
?> ?>
<!----------------------------------------------------------------------------> <!---------------------------------------------------------------------------->
<div class="sidebar" id="project_home_sidebar"> <div class="sidebar" id="project_home_sidebar">
<div class="box"> <div class="box">
@ -93,7 +92,7 @@ $this->load->view (
<div class="boxtitle"> <div class="boxtitle">
<?= anchor ("/project/log/{$project->id}", $this->lang->line('Change log')) ?> <?= anchor ("/project/log/{$project->id}", $this->lang->line('Change log')) ?>
</div> </div>
<table id="project_home_mainarea_sidebar_log_table"> <table id="project_home_sidebar_log_table">
<?php <?php
$xdot = $this->converter->AsciiToHex ('.'); $xdot = $this->converter->AsciiToHex ('.');
foreach ($log_entries as $log) foreach ($log_entries as $log)

View File

@ -17,7 +17,7 @@ function show_taskbar ($con, $login)
} }
else else
{ {
print form_open('main/index'); print form_open('main/signin');
$user_name = ""; $user_name = "";
$user_pass = ""; $user_pass = "";

View File

@ -9,8 +9,8 @@ define ('CODEPOT_CACHE_DIR', '@CACHEDIR@');
function load_ini ($file) function load_ini ($file)
{ {
$cfg = parse_ini_file ($file, FALSE); $cfg = @parse_ini_file ($file, FALSE);
if (/*$cfg === FALSE*/ $cfg == FALSE) die ("ERROR: cannot parse $file"); if (!is_array($cfg)) $cfg = array ();
$xcfgs = array ( $xcfgs = array (
array ('default_site_language', 'string', 'english'), array ('default_site_language', 'string', 'english'),

View File

@ -376,6 +376,7 @@ pre.prettyprint .nocode a:hover {
font-size: 0.9em; font-size: 0.9em;
float: right; float: right;
width: 22em; width: 22em;
margin-top: 0.3em;
} }
.content .sidebar .box { .content .sidebar .box {

View File

@ -5,32 +5,32 @@
/*----------------------------------------------- /*-----------------------------------------------
* project home view * project home view
*-----------------------------------------------*/ *-----------------------------------------------*/
#project_home_mainarea_sidebar_log_table { #project_home_sidebar_log_table {
border-collapse: collapse; border-collapse: collapse;
} }
#project_home_mainarea_sidebar_log_table tr.odd { #project_home_sidebar_log_table tr.odd {
background-color: #bbccef; background-color: #bbccef;
} }
#project_home_mainarea_sidebar_log_table tr.odd td.date { #project_home_sidebar_log_table tr.odd td.date {
width: 1%; width: 1%;
white-space: nowrap; white-space: nowrap;
} }
#project_home_mainarea_sidebar_log_table tr.odd td.object { #project_home_sidebar_log_table tr.odd td.object {
white-space: nowrap; white-space: nowrap;
} }
#project_home_mainarea_sidebar_log_table tr.even { #project_home_sidebar_log_table tr.even {
background-color: inherit; background-color: inherit;
} }
#project_home_mainarea_sidebar_log_table tr.even td.details .description { #project_home_sidebar_log_table tr.even td.details .description {
font-style: italic; font-style: italic;
} }
#project_home_mainarea_sidebar_log_table tr.even td.details pre.message { #project_home_sidebar_log_table tr.even td.details pre.message {
border: 0; border: 0;
margin: 1px; margin: 1px;
background-color: inherit; background-color: inherit;