remove Request::post_tab and add Request::http_status

Instead of Reqest::post_tab we use now Request::post_in (pt::Space).

Request::http_status will be used instead Request::status,
but at the moment is not changed in all places.
Request::status has been marked as depracated.

While here:
- Check for root dir in App and not in FunctionParser,
let FunctionParser only log the root dir.
- Read post variables after parsing url parameters,
this allows winix functions to set limits
for post input.
- Set limits when parsing input json format, new
options added to config: post_max_object_items, post_max_table_items,
post_max_all_items, post_max_nested_objects.
There are similar options in each winix function (they are in
FunctionBase).
- Some refactoring in App.
- Add config option: log_whole_http_post if true
then the whole parsed post input is logged.
- Add config option: post_json_max - max length of input stream
for parsing json.
- Add config option: templates_request_status, default request_status.html
this is an ezc template used as [content] when the request status
is not 200_ok.
- Fix: Sort winix function didn't show items to sort (fix and do some
refactoring as well)
- Properly sort items in: ImgCrop, Ls, Sort, Upload
- Remove ezc templates: err_404.html, err_per_denied.html - now
request_status.html is used.
This commit is contained in:
2022-05-30 01:29:18 +02:00
parent 9e222f5b80
commit 7d1fb3c04e
46 changed files with 1224 additions and 835 deletions

View File

@@ -60,6 +60,7 @@ gallery.o: ../../../../morm/src/postgresqlexpression.h
gallery.o: ../../../../morm/src/jsonconnector.h
gallery.o: ../../../../morm/src/postgresqlconnector.h
gallery.o: ../../../../morm/src/postgresqlqueryresult.h
gallery.o: ../../../../morm/src/transaction.h
gallery.o: ../../../../winix/winixd/core/log.h
gallery.o: ../../../../winix/winixd/core/synchro.h
gallery.o: ../../../../winix/winixd/core/filelog.h
@@ -200,6 +201,7 @@ galleryinfo.o: ../../../../morm/src/postgresqlexpression.h
galleryinfo.o: ../../../../morm/src/jsonconnector.h
galleryinfo.o: ../../../../morm/src/postgresqlconnector.h
galleryinfo.o: ../../../../morm/src/postgresqlqueryresult.h
galleryinfo.o: ../../../../morm/src/transaction.h
galleryinfo.o: ../../../../winix/winixd/core/synchro.h
galleryinfo.o: ../../../../winix/winixd/core/filelog.h
galleryinfo.o: ../../../../winix/winixd/core/lock.h
@@ -270,6 +272,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/log.h
init.o: ../../../../winix/winixd/core/synchro.h
init.o: ../../../../winix/winixd/core/filelog.h
@@ -462,6 +465,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/log.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h

View File

@@ -55,6 +55,7 @@ groupinfo.o: ../../../../morm/src/postgresqlexpression.h
groupinfo.o: ../../../../morm/src/jsonconnector.h
groupinfo.o: ../../../../morm/src/postgresqlconnector.h
groupinfo.o: ../../../../morm/src/postgresqlqueryresult.h
groupinfo.o: ../../../../morm/src/transaction.h
groupinfo.o: ../../../../winix/winixd/core/log.h
groupinfo.o: ../../../../winix/winixd/core/synchro.h
groupinfo.o: ../../../../winix/winixd/core/filelog.h
@@ -188,6 +189,7 @@ groups.o: ../../../../morm/src/postgresqlexpression.h
groups.o: ../../../../morm/src/jsonconnector.h
groups.o: ../../../../morm/src/postgresqlconnector.h
groups.o: ../../../../morm/src/postgresqlqueryresult.h
groups.o: ../../../../morm/src/transaction.h
groups.o: ../../../../winix/winixd/core/log.h
groups.o: ../../../../winix/winixd/core/synchro.h
groups.o: ../../../../winix/winixd/core/filelog.h
@@ -324,6 +326,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/synchro.h
init.o: ../../../../winix/winixd/core/filelog.h
init.o: ../../../../winix/winixd/core/lock.h
@@ -507,6 +510,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/log.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h

View File

@@ -45,6 +45,7 @@ cache.o: ../../../../morm/src/postgresqlexpression.h
cache.o: ../../../../morm/src/jsonconnector.h
cache.o: ../../../../morm/src/postgresqlconnector.h
cache.o: ../../../../morm/src/postgresqlqueryresult.h
cache.o: ../../../../morm/src/transaction.h
cache.o: ../../../../winix/winixd/core/log.h
cache.o: ../../../../winix/winixd/core/synchro.h
cache.o: ../../../../winix/winixd/core/filelog.h
@@ -143,6 +144,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/synchro.h
init.o: ../../../../winix/winixd/core/filelog.h
init.o: ../../../../winix/winixd/core/lock.h
@@ -334,6 +336,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/log.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h

View File

@@ -38,6 +38,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/request.h
init.o: ../../../../winix/winixd/core/requesttypes.h
init.o: ../../../../winix/winixd/models/item.h
@@ -142,6 +143,7 @@ stats.o: ../../../../morm/src/postgresqlexpression.h
stats.o: ../../../../morm/src/jsonconnector.h
stats.o: ../../../../morm/src/postgresqlconnector.h
stats.o: ../../../../morm/src/postgresqlqueryresult.h
stats.o: ../../../../morm/src/transaction.h
stats.o: ../../../../winix/winixd/core/synchro.h
stats.o: ../../../../winix/winixd/core/filelog.h
stats.o: ../../../../winix/winixd/core/lock.h
@@ -217,6 +219,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h
templates.o: ../../../../winix/winixd/core/lock.h

View File

@@ -64,6 +64,7 @@ createthread.o: ../../../../morm/src/postgresqlexpression.h
createthread.o: ../../../../morm/src/jsonconnector.h
createthread.o: ../../../../morm/src/postgresqlconnector.h
createthread.o: ../../../../morm/src/postgresqlqueryresult.h
createthread.o: ../../../../morm/src/transaction.h
createthread.o: ../../../../winix/winixd/core/log.h
createthread.o: ../../../../winix/winixd/core/synchro.h
createthread.o: ../../../../winix/winixd/core/filelog.h
@@ -258,6 +259,7 @@ funthread.o: ../../../../morm/src/postgresqlexpression.h
funthread.o: ../../../../morm/src/jsonconnector.h
funthread.o: ../../../../morm/src/postgresqlconnector.h
funthread.o: ../../../../morm/src/postgresqlqueryresult.h
funthread.o: ../../../../morm/src/transaction.h
funthread.o: ../../../../winix/winixd/core/log.h
funthread.o: ../../../../winix/winixd/core/synchro.h
funthread.o: ../../../../winix/winixd/core/filelog.h
@@ -393,6 +395,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/synchro.h
init.o: ../../../../winix/winixd/core/filelog.h
init.o: ../../../../winix/winixd/core/lock.h
@@ -587,6 +590,7 @@ reply.o: ../../../../morm/src/postgresqlexpression.h
reply.o: ../../../../morm/src/jsonconnector.h
reply.o: ../../../../morm/src/postgresqlconnector.h
reply.o: ../../../../morm/src/postgresqlqueryresult.h
reply.o: ../../../../morm/src/transaction.h
reply.o: ../../../../winix/winixd/core/log.h
reply.o: ../../../../winix/winixd/core/synchro.h
reply.o: ../../../../winix/winixd/core/filelog.h
@@ -781,6 +785,7 @@ showthreads.o: ../../../../morm/src/postgresqlexpression.h
showthreads.o: ../../../../morm/src/jsonconnector.h
showthreads.o: ../../../../morm/src/postgresqlconnector.h
showthreads.o: ../../../../morm/src/postgresqlqueryresult.h
showthreads.o: ../../../../morm/src/transaction.h
showthreads.o: ../../../../winix/winixd/core/log.h
showthreads.o: ../../../../winix/winixd/core/synchro.h
showthreads.o: ../../../../winix/winixd/core/filelog.h
@@ -917,6 +922,7 @@ tdb.o: ../../../../morm/src/postgresqlexpression.h
tdb.o: ../../../../morm/src/jsonconnector.h
tdb.o: ../../../../morm/src/postgresqlconnector.h
tdb.o: ../../../../morm/src/postgresqlqueryresult.h
tdb.o: ../../../../morm/src/transaction.h
tdb.o: ../../../../winix/winixd/core/synchro.h
tdb.o: ../../../../winix/winixd/core/filelog.h
tdb.o: ../../../../winix/winixd/core/lock.h
@@ -984,6 +990,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/log.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h
@@ -1186,6 +1193,7 @@ thread.o: ../../../../morm/src/postgresqlexpression.h
thread.o: ../../../../morm/src/jsonconnector.h
thread.o: ../../../../morm/src/postgresqlconnector.h
thread.o: ../../../../morm/src/postgresqlqueryresult.h
thread.o: ../../../../morm/src/transaction.h
thread.o: ../../../../winix/winixd/core/synchro.h
thread.o: ../../../../winix/winixd/core/filelog.h
thread.o: ../../../../winix/winixd/core/lock.h
@@ -1287,6 +1295,7 @@ threadinfo.o: ../../../../morm/src/postgresqlexpression.h
threadinfo.o: ../../../../morm/src/jsonconnector.h
threadinfo.o: ../../../../morm/src/postgresqlconnector.h
threadinfo.o: ../../../../morm/src/postgresqlqueryresult.h
threadinfo.o: ../../../../morm/src/transaction.h
threadinfo.o: ../../../../winix/winixd/core/log.h
threadinfo.o: ../../../../winix/winixd/core/synchro.h
threadinfo.o: ../../../../winix/winixd/core/filelog.h

View File

@@ -62,6 +62,7 @@ createticket.o: ../../../../morm/src/postgresqlexpression.h
createticket.o: ../../../../morm/src/jsonconnector.h
createticket.o: ../../../../morm/src/postgresqlconnector.h
createticket.o: ../../../../morm/src/postgresqlqueryresult.h
createticket.o: ../../../../morm/src/transaction.h
createticket.o: ../../../../winix/winixd/core/log.h
createticket.o: ../../../../winix/winixd/core/synchro.h
createticket.o: ../../../../winix/winixd/core/filelog.h
@@ -259,6 +260,7 @@ editticket.o: ../../../../morm/src/postgresqlexpression.h
editticket.o: ../../../../morm/src/jsonconnector.h
editticket.o: ../../../../morm/src/postgresqlconnector.h
editticket.o: ../../../../morm/src/postgresqlqueryresult.h
editticket.o: ../../../../morm/src/transaction.h
editticket.o: ../../../../winix/winixd/core/log.h
editticket.o: ../../../../winix/winixd/core/synchro.h
editticket.o: ../../../../winix/winixd/core/filelog.h
@@ -453,6 +455,7 @@ funticket.o: ../../../../morm/src/postgresqlexpression.h
funticket.o: ../../../../morm/src/jsonconnector.h
funticket.o: ../../../../morm/src/postgresqlconnector.h
funticket.o: ../../../../morm/src/postgresqlqueryresult.h
funticket.o: ../../../../morm/src/transaction.h
funticket.o: ../../../../winix/winixd/core/log.h
funticket.o: ../../../../winix/winixd/core/synchro.h
funticket.o: ../../../../winix/winixd/core/filelog.h
@@ -640,6 +643,7 @@ init.o: ../../../../morm/src/postgresqlexpression.h
init.o: ../../../../morm/src/jsonconnector.h
init.o: ../../../../morm/src/postgresqlconnector.h
init.o: ../../../../morm/src/postgresqlqueryresult.h
init.o: ../../../../morm/src/transaction.h
init.o: ../../../../winix/winixd/core/log.h
init.o: ../../../../winix/winixd/core/synchro.h
init.o: ../../../../winix/winixd/core/filelog.h
@@ -848,6 +852,7 @@ showtickets.o: ../../../../morm/src/postgresqlexpression.h
showtickets.o: ../../../../morm/src/jsonconnector.h
showtickets.o: ../../../../morm/src/postgresqlconnector.h
showtickets.o: ../../../../morm/src/postgresqlqueryresult.h
showtickets.o: ../../../../morm/src/transaction.h
showtickets.o: ../../../../winix/winixd/core/log.h
showtickets.o: ../../../../winix/winixd/core/synchro.h
showtickets.o: ../../../../winix/winixd/core/filelog.h
@@ -1036,7 +1041,7 @@ tdb.o: ../../../../morm/src/postgresqlexpression.h
tdb.o: ../../../../morm/src/jsonconnector.h
tdb.o: ../../../../morm/src/postgresqlconnector.h
tdb.o: ../../../../morm/src/postgresqlqueryresult.h
tdb.o: ../../../../winix/winixd/core/log.h
tdb.o: ../../../../morm/src/transaction.h ../../../../winix/winixd/core/log.h
tdb.o: ../../../../winix/winixd/core/synchro.h
tdb.o: ../../../../winix/winixd/core/filelog.h
tdb.o: ../../../../winix/winixd/core/lock.h
@@ -1101,6 +1106,7 @@ templates.o: ../../../../morm/src/postgresqlexpression.h
templates.o: ../../../../morm/src/jsonconnector.h
templates.o: ../../../../morm/src/postgresqlconnector.h
templates.o: ../../../../morm/src/postgresqlqueryresult.h
templates.o: ../../../../morm/src/transaction.h
templates.o: ../../../../winix/winixd/core/log.h
templates.o: ../../../../winix/winixd/core/synchro.h
templates.o: ../../../../winix/winixd/core/filelog.h
@@ -1296,6 +1302,7 @@ ticketinfo.o: ../../../../morm/src/postgresqlexpression.h
ticketinfo.o: ../../../../morm/src/jsonconnector.h
ticketinfo.o: ../../../../morm/src/postgresqlconnector.h
ticketinfo.o: ../../../../morm/src/postgresqlqueryresult.h
ticketinfo.o: ../../../../morm/src/transaction.h
ticketinfo.o: ../../../../winix/winixd/core/log.h
ticketinfo.o: ../../../../winix/winixd/core/synchro.h
ticketinfo.o: ../../../../winix/winixd/core/filelog.h

View File

@@ -576,7 +576,6 @@ bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & met
void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted)
{
PostTab::iterator i;
PostFileTab::iterator i2;
file_was_deleted = false;
@@ -587,23 +586,34 @@ PostFileTab::iterator i2;
// !! IMPROVE ME move me somewhere
std::wstring ticket_delete_prefix = L"ticketdeletefile_";
for(i=cur->request->post_tab.begin() ; i!=cur->request->post_tab.end() ; ++i)
if( cur->request->post_in.is_object() )
{
// !! CHECKME why ticket_form_prefix is in the global config?
// (this is a plugin variable)
if( pt::is_substr(config->ticket_form_prefix, i->first) )
{
long param_id = Tol(i->first.c_str() + config->ticket_form_prefix.size());
ReadTicketParam(ticket, param_id, i->second, meta);
}
// WARNING
// code not tested when changed to using post_in
if( pt::is_substr(ticket_delete_prefix, i->first) )
{
long file_id = Tol(i->first.c_str() + ticket_delete_prefix.size());
pt::Space::ObjectType::iterator i = cur->request->post_in.value.value_object.begin();
if( DeleteTicketFile(ticket, file_id, meta) )
for( ; i != cur->request->post_in.value.value_object.end() ; ++i)
{
if( i->second->is_wstr() )
{
file_was_deleted = true;
// !! CHECKME why ticket_form_prefix is in the global config?
// (this is a plugin variable)
if( pt::is_substr(config->ticket_form_prefix, i->first) )
{
long param_id = Tol(i->first.c_str() + config->ticket_form_prefix.size());
ReadTicketParam(ticket, param_id, *i->second->get_wstr(), meta);
}
}
if( pt::is_substr(ticket_delete_prefix, i->first) )
{
long file_id = Tol(i->first.c_str() + ticket_delete_prefix.size());
if( DeleteTicketFile(ticket, file_id, meta) )
{
file_was_deleted = true;
}
}
}
}