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
|
||||
@@ -106,7 +106,7 @@ void PostMultiParser::ReadHeaderName()
|
||||
|
||||
if( last != ':' && last != '=' )
|
||||
{
|
||||
err = Error::broken_input;
|
||||
err = WINIX_ERR_BROKEN_INPUT;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ bool was_apost = false;
|
||||
{
|
||||
if( last != '"' )
|
||||
{
|
||||
err = Error::broken_input;
|
||||
err = WINIX_ERR_BROKEN_INPUT;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ bool was_apost = false;
|
||||
|
||||
if( last != ';' && last != 10 )
|
||||
{
|
||||
err = Error::broken_input;
|
||||
err = WINIX_ERR_BROKEN_INPUT;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,12 +163,12 @@ void PostMultiParser::ReadPartHeader()
|
||||
|
||||
ReadHeaderName();
|
||||
|
||||
if( err != Error::ok )
|
||||
if( err != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
ReadHeaderValue();
|
||||
|
||||
if( err != Error::ok )
|
||||
if( err != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
log << "PMP: " << header_name << ": " << header_value << logend;
|
||||
@@ -265,7 +265,7 @@ bool has_boundary = false;
|
||||
|
||||
if( data.post_file_max != 0 && content_len > (size_t)data.post_file_max )
|
||||
{
|
||||
err = Error::input_too_large;
|
||||
err = WINIX_ERR_INPUT_TOO_LARGE;
|
||||
log << log1 << "PMP: content greater than " << data.post_file_max << " (skipping)" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ bool has_boundary = false;
|
||||
|
||||
if( data.post_file_max != 0 && content_len > (size_t)data.post_file_max )
|
||||
{
|
||||
err = Error::input_too_large;
|
||||
err = WINIX_ERR_INPUT_TOO_LARGE;
|
||||
log << log1 << "PMP: content greater than " << data.post_file_max << " (skipping)" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -345,7 +345,7 @@ void PostMultiParser::AddNormalPostVar()
|
||||
{
|
||||
if( post_table->size() >= WINIX_POSTTABLE_MAXSIZE )
|
||||
{
|
||||
err = Error::input_too_large;
|
||||
err = WINIX_ERR_INPUT_TOO_LARGE;
|
||||
log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post variables (skipping)" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ void PostMultiParser::AddFilePostVar()
|
||||
{
|
||||
if( post_file_table->size() >= WINIX_POSTTABLE_MAXSIZE )
|
||||
{
|
||||
err = Error::input_too_large;
|
||||
err = WINIX_ERR_INPUT_TOO_LARGE;
|
||||
log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post file variables (skipping)" << logend;
|
||||
return;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ void PostMultiParser::CheckBoundaryEnd()
|
||||
|
||||
if( last != '-' )
|
||||
{
|
||||
err = Error::broken_input;
|
||||
err = WINIX_ERR_BROKEN_INPUT;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ char buf[100];
|
||||
if( data.auth_tmp_dir.empty() )
|
||||
{
|
||||
log << log1 << "PMP: auth_tmp_dir is not set in the config" << logend;
|
||||
err = Error::cant_create_file;
|
||||
err = WINIX_ERR_CANT_CREATE_FILE;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ char buf[100];
|
||||
if( !tmp_file )
|
||||
{
|
||||
log << log1 << "PMP: can't create a temporary file: " << tmp_filename << logend;
|
||||
err = Error::cant_create_file;
|
||||
err = WINIX_ERR_CANT_CREATE_FILE;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -465,13 +465,13 @@ void PostMultiParser::ReadPart()
|
||||
while( IsHeader() )
|
||||
ReadPartHeader();
|
||||
|
||||
if( err != Error::ok )
|
||||
if( err != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
if( !filename.empty() )
|
||||
CreateTmpFile();
|
||||
|
||||
if( err != Error::ok )
|
||||
if( err != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
if( !filename.empty() )
|
||||
@@ -479,13 +479,13 @@ void PostMultiParser::ReadPart()
|
||||
else
|
||||
ReadContent();
|
||||
|
||||
if( err == Error::ok )
|
||||
if( err == WINIX_ERR_OK )
|
||||
{
|
||||
AddPostVar();
|
||||
CheckBoundaryEnd();
|
||||
}
|
||||
|
||||
if( err != Error::ok && !filename.empty() )
|
||||
if( err != WINIX_ERR_OK && !filename.empty() )
|
||||
{
|
||||
log << log1 << "PMP: deleting the tmp file: " << tmp_filename << logend;
|
||||
unlink(tmp_filename.c_str());
|
||||
@@ -527,7 +527,7 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFil
|
||||
{
|
||||
in = in_;
|
||||
last = 0;
|
||||
err = Error::ok;
|
||||
err = WINIX_ERR_OK;
|
||||
line_end_dos = false;
|
||||
in_buffer_ind = WINIX_POSTMULTI_INPUT_BUFFER;
|
||||
in_buffer_len = WINIX_POSTMULTI_INPUT_BUFFER;
|
||||
@@ -539,17 +539,17 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFil
|
||||
ReadBoundary();
|
||||
|
||||
if( boundary.empty() )
|
||||
return Error::no_boundary;
|
||||
return WINIX_ERR_NO_BOUNDARY;
|
||||
|
||||
while( last!=-1 && err == Error::ok )
|
||||
while( last!=-1 && err == WINIX_ERR_OK )
|
||||
ReadPart();
|
||||
|
||||
if( err != Error::ok )
|
||||
if( err != WINIX_ERR_OK )
|
||||
{
|
||||
post_table->clear();
|
||||
post_file_table->clear();
|
||||
|
||||
if( err != Error::input_too_large && err != Error::cant_create_file )
|
||||
if( err != WINIX_ERR_INPUT_TOO_LARGE && err != WINIX_ERR_CANT_CREATE_FILE )
|
||||
log << log1 << "PMP: syntax error" << logend;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user