added: function adduser
changed: errors (removed enum, there are macros now) added: error messages to locales (winix_err_NN) removed: templates: err_abuse.html err_others.html git-svn-id: svn://ttmath.org/publicrep/winix/trunk@593 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
@@ -125,7 +125,7 @@ void Content::MakeStandardFunction()
|
||||
|
||||
if( request.pfunction )
|
||||
{
|
||||
request.status = Error::no_item;
|
||||
request.status = WINIX_ERR_NO_ITEM;
|
||||
log << log1 << "Content: in authorizer mode only 'cat' funtion is available and must "
|
||||
"be default (not in the url)" << logend;
|
||||
return;
|
||||
@@ -142,7 +142,7 @@ void Content::MakeStandardFunction()
|
||||
|
||||
if( !request.pfunction )
|
||||
{
|
||||
request.status = Error::no_function;
|
||||
request.status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log1 << "Content: no function (neither cat nor ls)" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -230,7 +230,10 @@ void Content::MakeStandardFunction()
|
||||
if( request.pfunction->code == FUN_DOWNLOAD )
|
||||
FunDownload();
|
||||
else
|
||||
request.status = Error::permission_denied;
|
||||
if( request.pfunction->code == FUN_ADDUSER )
|
||||
FunAddUser();
|
||||
else
|
||||
request.status = WINIX_ERR_PERMISSION_DENIED;
|
||||
|
||||
|
||||
}
|
||||
@@ -242,7 +245,7 @@ void Content::MakePost()
|
||||
{
|
||||
if( request.role == Request::authorizer )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
request.status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -251,7 +254,7 @@ void Content::MakePost()
|
||||
|
||||
if( !request.pfunction )
|
||||
{
|
||||
request.status = Error::no_function;
|
||||
request.status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log1 << "Content: MakePost: no function" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -304,6 +307,10 @@ void Content::MakePost()
|
||||
PostFunEmacs();
|
||||
break;
|
||||
|
||||
case FUN_ADDUSER:
|
||||
PostFunAddUser();
|
||||
break;
|
||||
|
||||
default:
|
||||
log << log1 << "Content: unknown post function" << logend;
|
||||
break;
|
||||
@@ -321,7 +328,7 @@ bool sent = false;
|
||||
|
||||
|
||||
if( request.is_item && request.item.auth == Item::auth_none &&
|
||||
request.item.content_type == Item::ct_raw && request.status == Error::ok && request.pfunction )
|
||||
request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK && request.pfunction )
|
||||
{
|
||||
if( request.pfunction->code == FUN_CAT )
|
||||
{
|
||||
@@ -353,18 +360,18 @@ void Content::Make()
|
||||
}
|
||||
|
||||
// request.status can be changed by function_parser
|
||||
if( request.status == Error::ok )
|
||||
if( request.status == WINIX_ERR_OK )
|
||||
{
|
||||
if( DirsHaveReadExecPerm() )
|
||||
{
|
||||
if( request.method == Request::post )
|
||||
MakePost();
|
||||
|
||||
if( request.redirect_to.empty() && request.status == Error::ok )
|
||||
if( request.redirect_to.empty() && request.status == WINIX_ERR_OK )
|
||||
MakeStandardFunction();
|
||||
}
|
||||
else
|
||||
request.status = Error::permission_denied;
|
||||
request.status = WINIX_ERR_PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
if( request.session->spam_score > 0 )
|
||||
@@ -467,13 +474,13 @@ void Content::ReadAdditionalInfo()
|
||||
|
||||
if( data.mounts.pmount->type == Mount::thread )
|
||||
{
|
||||
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == Error::ok )
|
||||
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == WINIX_ERR_OK )
|
||||
request.is_thread = true;
|
||||
}
|
||||
else
|
||||
if( data.mounts.pmount->type == Mount::ticket )
|
||||
{
|
||||
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == Error::ok )
|
||||
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == WINIX_ERR_OK )
|
||||
{
|
||||
request.is_ticket = true;
|
||||
|
||||
|
Reference in New Issue
Block a user