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:
@@ -55,7 +55,7 @@ account.o: ../../../morm/src/postgresqlexpression.h
|
||||
account.o: ../../../morm/src/jsonconnector.h
|
||||
account.o: ../../../morm/src/postgresqlconnector.h
|
||||
account.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
account.o: ../../../winix/winixd/core/log.h
|
||||
account.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
account.o: ../../../winix/winixd/core/synchro.h
|
||||
account.o: ../../../winix/winixd/core/filelog.h
|
||||
account.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -196,7 +196,7 @@ adduser.o: ../../../morm/src/postgresqlexpression.h
|
||||
adduser.o: ../../../morm/src/jsonconnector.h
|
||||
adduser.o: ../../../morm/src/postgresqlconnector.h
|
||||
adduser.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
adduser.o: ../../../winix/winixd/core/log.h
|
||||
adduser.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
adduser.o: ../../../winix/winixd/core/synchro.h
|
||||
adduser.o: ../../../winix/winixd/core/filelog.h
|
||||
adduser.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -334,7 +334,8 @@ cat.o: ../../../morm/src/postgresqlexpression.h
|
||||
cat.o: ../../../morm/src/jsonconnector.h
|
||||
cat.o: ../../../morm/src/postgresqlconnector.h
|
||||
cat.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
cat.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
cat.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
cat.o: ../../../winix/winixd/core/synchro.h
|
||||
cat.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
cat.o: ../../../winix/winixd/core/synchro.h
|
||||
cat.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
@@ -463,7 +464,7 @@ chmod.o: ../../../morm/src/postgresqlexpression.h
|
||||
chmod.o: ../../../morm/src/jsonconnector.h
|
||||
chmod.o: ../../../morm/src/postgresqlconnector.h
|
||||
chmod.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
chmod.o: ../../../winix/winixd/core/log.h
|
||||
chmod.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
chmod.o: ../../../winix/winixd/core/synchro.h
|
||||
chmod.o: ../../../winix/winixd/core/filelog.h
|
||||
chmod.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -597,7 +598,7 @@ chown.o: ../../../morm/src/postgresqlexpression.h
|
||||
chown.o: ../../../morm/src/jsonconnector.h
|
||||
chown.o: ../../../morm/src/postgresqlconnector.h
|
||||
chown.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
chown.o: ../../../winix/winixd/core/log.h
|
||||
chown.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
chown.o: ../../../winix/winixd/core/synchro.h
|
||||
chown.o: ../../../winix/winixd/core/filelog.h
|
||||
chown.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -733,7 +734,7 @@ ckeditor.o: ../../../morm/src/postgresqlexpression.h
|
||||
ckeditor.o: ../../../morm/src/jsonconnector.h
|
||||
ckeditor.o: ../../../morm/src/postgresqlconnector.h
|
||||
ckeditor.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
ckeditor.o: ../../../winix/winixd/core/log.h
|
||||
ckeditor.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
ckeditor.o: ../../../winix/winixd/core/synchro.h
|
||||
ckeditor.o: ../../../winix/winixd/core/filelog.h
|
||||
ckeditor.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -870,7 +871,8 @@ cp.o: ../../../morm/src/postgresqlexpression.h
|
||||
cp.o: ../../../morm/src/jsonconnector.h
|
||||
cp.o: ../../../morm/src/postgresqlconnector.h
|
||||
cp.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
cp.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
cp.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
cp.o: ../../../winix/winixd/core/synchro.h
|
||||
cp.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
cp.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
cp.o: ../../../winix/winixd/models/user.h
|
||||
@@ -1001,7 +1003,7 @@ default.o: ../../../morm/src/postgresqlexpression.h
|
||||
default.o: ../../../morm/src/jsonconnector.h
|
||||
default.o: ../../../morm/src/postgresqlconnector.h
|
||||
default.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
default.o: ../../../winix/winixd/core/log.h
|
||||
default.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
default.o: ../../../winix/winixd/core/synchro.h
|
||||
default.o: ../../../winix/winixd/core/filelog.h
|
||||
default.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -1141,7 +1143,7 @@ download.o: ../../../morm/src/postgresqlexpression.h
|
||||
download.o: ../../../morm/src/jsonconnector.h
|
||||
download.o: ../../../morm/src/postgresqlconnector.h
|
||||
download.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
download.o: ../../../winix/winixd/core/log.h
|
||||
download.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
download.o: ../../../winix/winixd/core/synchro.h
|
||||
download.o: ../../../winix/winixd/core/filelog.h
|
||||
download.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -1279,7 +1281,7 @@ emacs.o: ../../../morm/src/postgresqlexpression.h
|
||||
emacs.o: ../../../morm/src/jsonconnector.h
|
||||
emacs.o: ../../../morm/src/postgresqlconnector.h
|
||||
emacs.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
emacs.o: ../../../winix/winixd/core/log.h
|
||||
emacs.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
emacs.o: ../../../winix/winixd/core/synchro.h
|
||||
emacs.o: ../../../winix/winixd/core/filelog.h
|
||||
emacs.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -1420,7 +1422,8 @@ env.o: ../../../morm/src/postgresqlexpression.h
|
||||
env.o: ../../../morm/src/jsonconnector.h
|
||||
env.o: ../../../morm/src/postgresqlconnector.h
|
||||
env.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
env.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
env.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
env.o: ../../../winix/winixd/core/synchro.h
|
||||
env.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
env.o: ../../../winix/winixd/core/synchro.h
|
||||
env.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
@@ -1552,6 +1555,7 @@ functionbase.o: ../../../morm/src/postgresqlexpression.h
|
||||
functionbase.o: ../../../morm/src/jsonconnector.h
|
||||
functionbase.o: ../../../morm/src/postgresqlconnector.h
|
||||
functionbase.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
functionbase.o: ../../../morm/src/transaction.h
|
||||
functionbase.o: ../../../winix/winixd/core/log.h
|
||||
functionbase.o: ../../../winix/winixd/core/synchro.h
|
||||
functionbase.o: ../../../winix/winixd/core/filelog.h
|
||||
@@ -1692,6 +1696,7 @@ functionparser.o: ../../../morm/src/postgresqlexpression.h
|
||||
functionparser.o: ../../../morm/src/jsonconnector.h
|
||||
functionparser.o: ../../../morm/src/postgresqlconnector.h
|
||||
functionparser.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
functionparser.o: ../../../morm/src/transaction.h
|
||||
functionparser.o: ../../../winix/winixd/core/log.h
|
||||
functionparser.o: ../../../winix/winixd/core/synchro.h
|
||||
functionparser.o: ../../../winix/winixd/core/filelog.h
|
||||
@@ -1847,7 +1852,7 @@ functions.o: ../../../morm/src/postgresqlexpression.h
|
||||
functions.o: ../../../morm/src/jsonconnector.h
|
||||
functions.o: ../../../morm/src/postgresqlconnector.h
|
||||
functions.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
functions.o: ../../../winix/winixd/core/log.h
|
||||
functions.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
functions.o: ../../../winix/winixd/core/synchro.h
|
||||
functions.o: ../../../winix/winixd/core/filelog.h
|
||||
functions.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -1993,7 +1998,7 @@ imgcrop.o: ../../../morm/src/postgresqlexpression.h
|
||||
imgcrop.o: ../../../morm/src/jsonconnector.h
|
||||
imgcrop.o: ../../../morm/src/postgresqlconnector.h
|
||||
imgcrop.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
imgcrop.o: ../../../winix/winixd/core/log.h
|
||||
imgcrop.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
imgcrop.o: ../../../winix/winixd/core/synchro.h
|
||||
imgcrop.o: ../../../winix/winixd/core/filelog.h
|
||||
imgcrop.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -2130,7 +2135,7 @@ ipban.o: ../../../morm/src/postgresqlexpression.h
|
||||
ipban.o: ../../../morm/src/jsonconnector.h
|
||||
ipban.o: ../../../morm/src/postgresqlconnector.h
|
||||
ipban.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
ipban.o: ../../../winix/winixd/core/log.h
|
||||
ipban.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
ipban.o: ../../../winix/winixd/core/synchro.h
|
||||
ipban.o: ../../../winix/winixd/core/filelog.h
|
||||
ipban.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -2264,7 +2269,8 @@ last.o: ../../../morm/src/postgresqlexpression.h
|
||||
last.o: ../../../morm/src/jsonconnector.h
|
||||
last.o: ../../../morm/src/postgresqlconnector.h
|
||||
last.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
last.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
last.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
last.o: ../../../winix/winixd/core/synchro.h
|
||||
last.o: ../../../winix/winixd/core/filelog.h
|
||||
last.o: ../../../winix/winixd/core/lock.h
|
||||
last.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -2394,7 +2400,8 @@ ln.o: ../../../morm/src/postgresqlexpression.h
|
||||
ln.o: ../../../morm/src/jsonconnector.h
|
||||
ln.o: ../../../morm/src/postgresqlconnector.h
|
||||
ln.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
ln.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
ln.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
ln.o: ../../../winix/winixd/core/synchro.h
|
||||
ln.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
ln.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
ln.o: ../../../winix/winixd/models/user.h
|
||||
@@ -2524,7 +2531,7 @@ locale.o: ../../../morm/src/postgresqlexpression.h
|
||||
locale.o: ../../../morm/src/jsonconnector.h
|
||||
locale.o: ../../../morm/src/postgresqlconnector.h
|
||||
locale.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
locale.o: ../../../winix/winixd/core/log.h
|
||||
locale.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
locale.o: ../../../winix/winixd/core/synchro.h
|
||||
locale.o: ../../../winix/winixd/core/filelog.h
|
||||
locale.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -2673,7 +2680,7 @@ login.o: ../../../morm/src/postgresqlexpression.h
|
||||
login.o: ../../../morm/src/jsonconnector.h
|
||||
login.o: ../../../morm/src/postgresqlconnector.h
|
||||
login.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
login.o: ../../../winix/winixd/core/log.h
|
||||
login.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
login.o: ../../../winix/winixd/core/synchro.h
|
||||
login.o: ../../../winix/winixd/core/filelog.h
|
||||
login.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -2801,7 +2808,7 @@ logout.o: ../../../morm/src/postgresqlexpression.h
|
||||
logout.o: ../../../morm/src/jsonconnector.h
|
||||
logout.o: ../../../morm/src/postgresqlconnector.h
|
||||
logout.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
logout.o: ../../../winix/winixd/core/log.h
|
||||
logout.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
logout.o: ../../../winix/winixd/core/synchro.h
|
||||
logout.o: ../../../winix/winixd/core/filelog.h
|
||||
logout.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -2937,7 +2944,8 @@ ls.o: ../../../morm/src/postgresqlexpression.h
|
||||
ls.o: ../../../morm/src/jsonconnector.h
|
||||
ls.o: ../../../morm/src/postgresqlconnector.h
|
||||
ls.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
ls.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
ls.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
ls.o: ../../../winix/winixd/core/synchro.h
|
||||
ls.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
ls.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
ls.o: ../../../winix/winixd/models/user.h
|
||||
@@ -3064,7 +3072,8 @@ man.o: ../../../morm/src/postgresqlexpression.h
|
||||
man.o: ../../../morm/src/jsonconnector.h
|
||||
man.o: ../../../morm/src/postgresqlconnector.h
|
||||
man.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
man.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
man.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
man.o: ../../../winix/winixd/core/synchro.h
|
||||
man.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
man.o: ../../../winix/winixd/core/synchro.h
|
||||
man.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
@@ -3192,7 +3201,8 @@ meta.o: ../../../morm/src/postgresqlexpression.h
|
||||
meta.o: ../../../morm/src/jsonconnector.h
|
||||
meta.o: ../../../morm/src/postgresqlconnector.h
|
||||
meta.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
meta.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
meta.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
meta.o: ../../../winix/winixd/core/synchro.h
|
||||
meta.o: ../../../winix/winixd/core/filelog.h
|
||||
meta.o: ../../../winix/winixd/core/lock.h
|
||||
meta.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -3323,7 +3333,7 @@ mkdir.o: ../../../morm/src/postgresqlexpression.h
|
||||
mkdir.o: ../../../morm/src/jsonconnector.h
|
||||
mkdir.o: ../../../morm/src/postgresqlconnector.h
|
||||
mkdir.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
mkdir.o: ../../../winix/winixd/core/log.h
|
||||
mkdir.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
mkdir.o: ../../../winix/winixd/core/synchro.h
|
||||
mkdir.o: ../../../winix/winixd/core/filelog.h
|
||||
mkdir.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -3458,7 +3468,7 @@ mount.o: ../../../morm/src/postgresqlexpression.h
|
||||
mount.o: ../../../morm/src/jsonconnector.h
|
||||
mount.o: ../../../morm/src/postgresqlconnector.h
|
||||
mount.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
mount.o: ../../../winix/winixd/core/log.h
|
||||
mount.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
mount.o: ../../../winix/winixd/core/synchro.h
|
||||
mount.o: ../../../winix/winixd/core/filelog.h
|
||||
mount.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -3592,7 +3602,8 @@ mv.o: ../../../morm/src/postgresqlexpression.h
|
||||
mv.o: ../../../morm/src/jsonconnector.h
|
||||
mv.o: ../../../morm/src/postgresqlconnector.h
|
||||
mv.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
mv.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
mv.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
mv.o: ../../../winix/winixd/core/synchro.h
|
||||
mv.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
mv.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
mv.o: ../../../winix/winixd/models/user.h
|
||||
@@ -3722,7 +3733,7 @@ nicedit.o: ../../../morm/src/postgresqlexpression.h
|
||||
nicedit.o: ../../../morm/src/jsonconnector.h
|
||||
nicedit.o: ../../../morm/src/postgresqlconnector.h
|
||||
nicedit.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
nicedit.o: ../../../winix/winixd/core/log.h
|
||||
nicedit.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
nicedit.o: ../../../winix/winixd/core/synchro.h
|
||||
nicedit.o: ../../../winix/winixd/core/filelog.h
|
||||
nicedit.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -3858,7 +3869,8 @@ node.o: ../../../morm/src/postgresqlexpression.h
|
||||
node.o: ../../../morm/src/jsonconnector.h
|
||||
node.o: ../../../morm/src/postgresqlconnector.h
|
||||
node.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
node.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
node.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
node.o: ../../../winix/winixd/core/synchro.h
|
||||
node.o: ../../../winix/winixd/core/filelog.h
|
||||
node.o: ../../../winix/winixd/core/lock.h
|
||||
node.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -3989,7 +4001,7 @@ passwd.o: ../../../morm/src/postgresqlexpression.h
|
||||
passwd.o: ../../../morm/src/jsonconnector.h
|
||||
passwd.o: ../../../morm/src/postgresqlconnector.h
|
||||
passwd.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
passwd.o: ../../../winix/winixd/core/log.h
|
||||
passwd.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
passwd.o: ../../../winix/winixd/core/synchro.h
|
||||
passwd.o: ../../../winix/winixd/core/filelog.h
|
||||
passwd.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -4126,7 +4138,8 @@ priv.o: ../../../morm/src/postgresqlexpression.h
|
||||
priv.o: ../../../morm/src/jsonconnector.h
|
||||
priv.o: ../../../morm/src/postgresqlconnector.h
|
||||
priv.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
priv.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
priv.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
priv.o: ../../../winix/winixd/core/synchro.h
|
||||
priv.o: ../../../winix/winixd/core/filelog.h
|
||||
priv.o: ../../../winix/winixd/core/lock.h
|
||||
priv.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -4249,6 +4262,7 @@ privchanger.o: ../../../morm/src/postgresqlexpression.h
|
||||
privchanger.o: ../../../morm/src/jsonconnector.h
|
||||
privchanger.o: ../../../morm/src/postgresqlconnector.h
|
||||
privchanger.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
privchanger.o: ../../../morm/src/transaction.h
|
||||
privchanger.o: ../../../winix/winixd/core/log.h
|
||||
privchanger.o: ../../../winix/winixd/core/synchro.h
|
||||
privchanger.o: ../../../winix/winixd/core/filelog.h
|
||||
@@ -4399,7 +4413,8 @@ pw.o: ../../../morm/src/postgresqlexpression.h
|
||||
pw.o: ../../../morm/src/jsonconnector.h
|
||||
pw.o: ../../../morm/src/postgresqlconnector.h
|
||||
pw.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
pw.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
pw.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
pw.o: ../../../winix/winixd/core/synchro.h
|
||||
pw.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
pw.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
pw.o: ../../../winix/winixd/models/user.h
|
||||
@@ -4528,7 +4543,7 @@ reload.o: ../../../morm/src/postgresqlexpression.h
|
||||
reload.o: ../../../morm/src/jsonconnector.h
|
||||
reload.o: ../../../morm/src/postgresqlconnector.h
|
||||
reload.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
reload.o: ../../../winix/winixd/core/log.h
|
||||
reload.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
reload.o: ../../../winix/winixd/core/synchro.h
|
||||
reload.o: ../../../winix/winixd/core/filelog.h
|
||||
reload.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -4669,7 +4684,8 @@ rm.o: ../../../morm/src/postgresqlexpression.h
|
||||
rm.o: ../../../morm/src/jsonconnector.h
|
||||
rm.o: ../../../morm/src/postgresqlconnector.h
|
||||
rm.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
rm.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
rm.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
rm.o: ../../../winix/winixd/core/synchro.h
|
||||
rm.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
rm.o: ../../../winix/winixd/core/synchro.h ../../../winix/winixd/core/error.h
|
||||
rm.o: ../../../winix/winixd/models/user.h
|
||||
@@ -4803,7 +4819,7 @@ rmuser.o: ../../../morm/src/postgresqlexpression.h
|
||||
rmuser.o: ../../../morm/src/jsonconnector.h
|
||||
rmuser.o: ../../../morm/src/postgresqlconnector.h
|
||||
rmuser.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
rmuser.o: ../../../winix/winixd/core/log.h
|
||||
rmuser.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
rmuser.o: ../../../winix/winixd/core/synchro.h
|
||||
rmuser.o: ../../../winix/winixd/core/filelog.h
|
||||
rmuser.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -4942,7 +4958,8 @@ run.o: ../../../morm/src/postgresqlexpression.h
|
||||
run.o: ../../../morm/src/jsonconnector.h
|
||||
run.o: ../../../morm/src/postgresqlconnector.h
|
||||
run.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
run.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
run.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
run.o: ../../../winix/winixd/core/synchro.h
|
||||
run.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
run.o: ../../../winix/winixd/core/synchro.h
|
||||
run.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
@@ -5069,7 +5086,8 @@ sort.o: ../../../morm/src/postgresqlexpression.h
|
||||
sort.o: ../../../morm/src/jsonconnector.h
|
||||
sort.o: ../../../morm/src/postgresqlconnector.h
|
||||
sort.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
sort.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
sort.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
sort.o: ../../../winix/winixd/core/synchro.h
|
||||
sort.o: ../../../winix/winixd/core/filelog.h
|
||||
sort.o: ../../../winix/winixd/core/lock.h
|
||||
sort.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -5210,6 +5228,7 @@ specialdefault.o: ../../../morm/src/postgresqlexpression.h
|
||||
specialdefault.o: ../../../morm/src/jsonconnector.h
|
||||
specialdefault.o: ../../../morm/src/postgresqlconnector.h
|
||||
specialdefault.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
specialdefault.o: ../../../morm/src/transaction.h
|
||||
specialdefault.o: ../../../winix/winixd/core/log.h
|
||||
specialdefault.o: ../../../winix/winixd/core/synchro.h
|
||||
specialdefault.o: ../../../winix/winixd/core/filelog.h
|
||||
@@ -5349,7 +5368,8 @@ stat.o: ../../../morm/src/postgresqlexpression.h
|
||||
stat.o: ../../../morm/src/jsonconnector.h
|
||||
stat.o: ../../../morm/src/postgresqlconnector.h
|
||||
stat.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
stat.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
stat.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
stat.o: ../../../winix/winixd/core/synchro.h
|
||||
stat.o: ../../../winix/winixd/core/filelog.h
|
||||
stat.o: ../../../winix/winixd/core/lock.h
|
||||
stat.o: ../../../winix/winixd/core/synchro.h
|
||||
@@ -5482,7 +5502,7 @@ subject.o: ../../../morm/src/postgresqlexpression.h
|
||||
subject.o: ../../../morm/src/jsonconnector.h
|
||||
subject.o: ../../../morm/src/postgresqlconnector.h
|
||||
subject.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
subject.o: ../../../winix/winixd/core/log.h
|
||||
subject.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
subject.o: ../../../winix/winixd/core/synchro.h
|
||||
subject.o: ../../../winix/winixd/core/filelog.h
|
||||
subject.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -5621,7 +5641,7 @@ template.o: ../../../morm/src/postgresqlexpression.h
|
||||
template.o: ../../../morm/src/jsonconnector.h
|
||||
template.o: ../../../morm/src/postgresqlconnector.h
|
||||
template.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
template.o: ../../../winix/winixd/core/log.h
|
||||
template.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
template.o: ../../../winix/winixd/core/synchro.h
|
||||
template.o: ../../../winix/winixd/core/filelog.h
|
||||
template.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -5761,7 +5781,7 @@ timezone.o: ../../../morm/src/postgresqlexpression.h
|
||||
timezone.o: ../../../morm/src/jsonconnector.h
|
||||
timezone.o: ../../../morm/src/postgresqlconnector.h
|
||||
timezone.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
timezone.o: ../../../winix/winixd/core/log.h
|
||||
timezone.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
timezone.o: ../../../winix/winixd/core/synchro.h
|
||||
timezone.o: ../../../winix/winixd/core/filelog.h
|
||||
timezone.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -5900,7 +5920,7 @@ tinymce.o: ../../../morm/src/postgresqlexpression.h
|
||||
tinymce.o: ../../../morm/src/jsonconnector.h
|
||||
tinymce.o: ../../../morm/src/postgresqlconnector.h
|
||||
tinymce.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
tinymce.o: ../../../winix/winixd/core/log.h
|
||||
tinymce.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
tinymce.o: ../../../winix/winixd/core/synchro.h
|
||||
tinymce.o: ../../../winix/winixd/core/filelog.h
|
||||
tinymce.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -6037,7 +6057,7 @@ uname.o: ../../../morm/src/postgresqlexpression.h
|
||||
uname.o: ../../../morm/src/jsonconnector.h
|
||||
uname.o: ../../../morm/src/postgresqlconnector.h
|
||||
uname.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
uname.o: ../../../winix/winixd/core/log.h
|
||||
uname.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
uname.o: ../../../winix/winixd/core/synchro.h
|
||||
uname.o: ../../../winix/winixd/core/filelog.h
|
||||
uname.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -6172,7 +6192,7 @@ upload.o: ../../../morm/src/postgresqlexpression.h
|
||||
upload.o: ../../../morm/src/jsonconnector.h
|
||||
upload.o: ../../../morm/src/postgresqlconnector.h
|
||||
upload.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
upload.o: ../../../winix/winixd/core/log.h
|
||||
upload.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
upload.o: ../../../winix/winixd/core/synchro.h
|
||||
upload.o: ../../../winix/winixd/core/filelog.h
|
||||
upload.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -6316,7 +6336,7 @@ uptime.o: ../../../morm/src/postgresqlexpression.h
|
||||
uptime.o: ../../../morm/src/jsonconnector.h
|
||||
uptime.o: ../../../morm/src/postgresqlconnector.h
|
||||
uptime.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
uptime.o: ../../../winix/winixd/core/log.h
|
||||
uptime.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
uptime.o: ../../../winix/winixd/core/synchro.h
|
||||
uptime.o: ../../../winix/winixd/core/filelog.h
|
||||
uptime.o: ../../../winix/winixd/core/lock.h
|
||||
@@ -6452,7 +6472,8 @@ vim.o: ../../../morm/src/postgresqlexpression.h
|
||||
vim.o: ../../../morm/src/jsonconnector.h
|
||||
vim.o: ../../../morm/src/postgresqlconnector.h
|
||||
vim.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
vim.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
vim.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
vim.o: ../../../winix/winixd/core/synchro.h
|
||||
vim.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
vim.o: ../../../winix/winixd/core/synchro.h
|
||||
vim.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
@@ -6580,7 +6601,8 @@ who.o: ../../../morm/src/postgresqlexpression.h
|
||||
who.o: ../../../morm/src/jsonconnector.h
|
||||
who.o: ../../../morm/src/postgresqlconnector.h
|
||||
who.o: ../../../morm/src/postgresqlqueryresult.h
|
||||
who.o: ../../../winix/winixd/core/log.h ../../../winix/winixd/core/synchro.h
|
||||
who.o: ../../../morm/src/transaction.h ../../../winix/winixd/core/log.h
|
||||
who.o: ../../../winix/winixd/core/synchro.h
|
||||
who.o: ../../../winix/winixd/core/filelog.h ../../../winix/winixd/core/lock.h
|
||||
who.o: ../../../winix/winixd/core/synchro.h
|
||||
who.o: ../../../winix/winixd/core/error.h ../../../winix/winixd/models/user.h
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||
* Copyright (c) 2010-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -48,6 +48,10 @@ FunctionBase::FunctionBase()
|
||||
need_ssl = false;
|
||||
need_session = true;
|
||||
register_default_models = true;
|
||||
post_max_object_items = 0;
|
||||
post_max_table_items = 0;
|
||||
post_max_all_items = 0;
|
||||
post_max_nested_objects = 0;
|
||||
|
||||
fun.item_content.user_id = -1;
|
||||
fun.item_content.group_id = -1;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||
* Copyright (c) 2010-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -90,6 +90,22 @@ public:
|
||||
// default: true
|
||||
bool register_default_models;
|
||||
|
||||
// maximum key/value pairs in one object when parsing post json structure
|
||||
// default: 0 - means get the value from the config
|
||||
size_t post_max_object_items;
|
||||
|
||||
// maximum items in one table when parsing post json structure
|
||||
// default: 0 - means get the value from the config
|
||||
size_t post_max_table_items;
|
||||
|
||||
// maximum items (key/values pairs of objects or table items) througout the whole post input json structure
|
||||
// default: 0 - means get the value from the config
|
||||
size_t post_max_all_items;
|
||||
|
||||
// maximum nested objects/tables when parsing post json structure
|
||||
// default: 0 - means get the value from the config
|
||||
size_t post_max_nested_objects;
|
||||
|
||||
|
||||
virtual void Init();
|
||||
virtual void Finish();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2021, Tomasz Sowa
|
||||
* Copyright (c) 2008-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "functionparser.h"
|
||||
#include "core/log.h"
|
||||
#include "core/error.h"
|
||||
#include "functions.h"
|
||||
#include "utf8/utf8.h"
|
||||
#include "models/item.h"
|
||||
@@ -51,30 +50,64 @@ FunctionParser::FunctionParser()
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool FunctionParser::Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem)
|
||||
{
|
||||
db = pdb;
|
||||
cur = pcur;
|
||||
system = psystem;
|
||||
functions = pfunctions;
|
||||
last_dir = 0;
|
||||
last_dir = nullptr;
|
||||
path = cur->request->env_request_uri.c_str();
|
||||
status = true;
|
||||
|
||||
ParseDirsItemFunction();
|
||||
ParseParams();
|
||||
ParseAnchor();
|
||||
// IMPROVEME put WINIX_URL_MAX_SIZE to the config
|
||||
if( cur->request->env_request_uri.size() <= WINIX_URL_MAX_SIZE )
|
||||
{
|
||||
if( !cur->request->dir_tab.empty() )
|
||||
{
|
||||
last_dir = cur->request->dir_tab.back();
|
||||
PrintCurrentDirs();
|
||||
|
||||
return cur->request->status == WINIX_ERR_OK;
|
||||
if( ParseDirsItemFunction() )
|
||||
{
|
||||
ParseParams();
|
||||
ParseAnchor();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = false;
|
||||
cur->request->http_status = Header::status_500_internal_server_error;
|
||||
log << log1 << "FP: no root directory provided in the request dir_tab" << logend;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = false;
|
||||
cur->request->http_status = Header::status_414_uri_too_long;
|
||||
log << log1 << "FP: the URL is too long: " << cur->request->env_request_uri.size() << logend;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionParser::ParseDirsItemFunction()
|
||||
/*
|
||||
* there should be at least the root directory
|
||||
*/
|
||||
void FunctionParser::PrintCurrentDirs()
|
||||
{
|
||||
if( !AddRootDir() )
|
||||
return;
|
||||
std::vector<Item*>::iterator i = cur->request->dir_tab.begin();
|
||||
|
||||
for( ; i != cur->request->dir_tab.end() ; ++i)
|
||||
{
|
||||
LogDir(*i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool FunctionParser::ParseDirsItemFunction()
|
||||
{
|
||||
ReadName();
|
||||
|
||||
while( IsDir() )
|
||||
@@ -84,43 +117,46 @@ void FunctionParser::ParseDirsItemFunction()
|
||||
}
|
||||
|
||||
if( name.empty() )
|
||||
return;
|
||||
{
|
||||
/*
|
||||
* no more names to analyze, return now
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
if( CheckAddFunction() )
|
||||
return;
|
||||
|
||||
if( CheckAddItem() )
|
||||
{
|
||||
ReadName();
|
||||
/*
|
||||
* the name is a function so return now, we do not parse item
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !name.empty() )
|
||||
if( !CheckAddItem() )
|
||||
{
|
||||
/*
|
||||
* the name is not an item so a 404 error was set, return now
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* read next name and try if it is a function
|
||||
*/
|
||||
ReadName();
|
||||
|
||||
if( !name.empty() )
|
||||
{
|
||||
if( !CheckAddFunction() )
|
||||
{
|
||||
CheckAddFunction();
|
||||
|
||||
if( !cur->request->function )
|
||||
{
|
||||
log << log3 << "FP: unknown function: " << name << logend;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
}
|
||||
log << log3 << "FP: unknown function: " << name << logend;
|
||||
cur->request->http_status = Header::status_404_not_found;
|
||||
status = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool FunctionParser::AddRootDir()
|
||||
{
|
||||
last_dir = system->dirs.GetRootDir();
|
||||
|
||||
if( !last_dir )
|
||||
{
|
||||
log << log3 << "FP: there is not a root directory" << logend;
|
||||
cur->request->status = WINIX_ERR_INTERNAL_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
AddDir();
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +169,7 @@ bool FunctionParser::IsDir()
|
||||
|
||||
last_dir = system->dirs.GetDir(name, last_dir->id);
|
||||
|
||||
return last_dir != 0;
|
||||
return last_dir != nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +177,6 @@ bool FunctionParser::CheckAddItem()
|
||||
{
|
||||
// cur->request->dir_tab has at least one element
|
||||
long parent_id = cur->request->dir_tab.back()->id;
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
finder.
|
||||
@@ -151,26 +186,20 @@ bool FunctionParser::CheckAddItem()
|
||||
eq(L"url", name).
|
||||
get(cur->request->item);
|
||||
|
||||
//Error status = db->GetItem(parent_id, name, cur->request->item);
|
||||
//if( status == WINIX_ERR_OK )
|
||||
if( cur->request->item.found() )
|
||||
{
|
||||
log << log3 << "FP: Item: id: " << cur->request->item.id << ", url: " << cur->request->item.url << logend;
|
||||
cur->request->last_item = &cur->request->item;
|
||||
cur->request->is_item = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log3 << "FP: No Item: url: " << name << logend;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
return false;
|
||||
cur->request->http_status = Header::status_404_not_found;
|
||||
status = false;
|
||||
}
|
||||
|
||||
log << log1 << "FP: db error" << logend;
|
||||
cur->request->status = WINIX_ERR_INTERNAL_ERROR;
|
||||
|
||||
return false;
|
||||
return cur->request->item.found();
|
||||
}
|
||||
|
||||
|
||||
@@ -185,20 +214,25 @@ bool FunctionParser::CheckAddFunction()
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void FunctionParser::LogDir(Item * dir)
|
||||
{
|
||||
log << log3 << "FP: Directory: ";
|
||||
|
||||
if( dir->parent_id == -1 )
|
||||
log << "(root)" << logend;
|
||||
else
|
||||
log << dir->url << logend;
|
||||
}
|
||||
|
||||
|
||||
void FunctionParser::AddDir()
|
||||
{
|
||||
cur->request->dir_tab.push_back( last_dir );
|
||||
log << log3 << "FP: Directory: ";
|
||||
|
||||
if( last_dir->parent_id == -1 )
|
||||
log << "(root)" << logend;
|
||||
else
|
||||
log << last_dir->url << logend;
|
||||
|
||||
cur->request->dir_tab.push_back(last_dir);
|
||||
LogDir(last_dir);
|
||||
cur->request->last_item = cur->request->dir_tab.back();
|
||||
}
|
||||
|
||||
@@ -281,25 +315,25 @@ void FunctionParser::AddParam()
|
||||
|
||||
void FunctionParser::ParseAnchor()
|
||||
{
|
||||
if( *path == 0 )
|
||||
return;
|
||||
|
||||
if( *path != '#' )
|
||||
if( *path == '#' )
|
||||
{
|
||||
cur->request->status = WINIX_ERR_INCORRECT_URI;
|
||||
return;
|
||||
}
|
||||
path += 1;
|
||||
name_ascii.clear();
|
||||
|
||||
path += 1;
|
||||
name_ascii.clear();
|
||||
|
||||
while( *path )
|
||||
name_ascii += GetChar();
|
||||
|
||||
pt::utf8_to_wide(name_ascii, cur->request->anchor);
|
||||
while( *path )
|
||||
name_ascii += GetChar();
|
||||
|
||||
if( !cur->request->anchor.empty() )
|
||||
log << log3 << "FP: anchor: " << cur->request->anchor << logend;
|
||||
pt::utf8_to_wide(name_ascii, cur->request->anchor);
|
||||
|
||||
if( !cur->request->anchor.empty() )
|
||||
log << log3 << "FP: anchor: " << cur->request->anchor << logend;
|
||||
}
|
||||
else
|
||||
if( *path != 0 )
|
||||
{
|
||||
cur->request->http_status = Header::status_400_bad_request;
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -313,17 +347,26 @@ void FunctionParser::SkipSlashes()
|
||||
int FunctionParser::FromHex(int c)
|
||||
{
|
||||
if( c>='0' && c<='9' )
|
||||
{
|
||||
return c - '0';
|
||||
}
|
||||
else
|
||||
if( c>='a' && c<='f' )
|
||||
{
|
||||
return c - 'a' + 10;
|
||||
}
|
||||
else
|
||||
if( c>='A' && c<='F' )
|
||||
{
|
||||
return c - 'A' + 10;
|
||||
}
|
||||
else
|
||||
cur->request->status = WINIX_ERR_INCORRECT_URI;
|
||||
{
|
||||
cur->request->http_status = Header::status_400_bad_request;
|
||||
status = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -338,8 +381,11 @@ int c;
|
||||
{
|
||||
c = (FromHex(*(path+1)) << 4) + FromHex(*(path+2));
|
||||
|
||||
if( c == 0 )
|
||||
cur->request->status = WINIX_ERR_INCORRECT_URI;
|
||||
if( c == 0 && status )
|
||||
{
|
||||
cur->request->http_status = Header::status_400_bad_request;
|
||||
status = false;
|
||||
}
|
||||
|
||||
path += 3;
|
||||
}
|
||||
@@ -355,7 +401,7 @@ int c;
|
||||
path += 1;
|
||||
}
|
||||
|
||||
return c;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -55,6 +55,11 @@ class FunctionParser : public WinixModelDeprecated
|
||||
public:
|
||||
|
||||
FunctionParser();
|
||||
|
||||
|
||||
/*
|
||||
* if the method returns false then cur->request->http_status will be already set to a specific error
|
||||
*/
|
||||
bool Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
||||
|
||||
private:
|
||||
@@ -69,17 +74,19 @@ private:
|
||||
std::string name_ascii, value_ascii;
|
||||
Item * last_dir;
|
||||
Param param;
|
||||
bool status;
|
||||
|
||||
void SkipSlashes();
|
||||
|
||||
void ParseDirsItemFunction();
|
||||
void PrintCurrentDirs();
|
||||
bool ParseDirsItemFunction();
|
||||
void ParseParams();
|
||||
void ParseAnchor();
|
||||
|
||||
bool IsDir();
|
||||
bool CheckAddItem();
|
||||
bool CheckAddFunction();
|
||||
bool AddRootDir();
|
||||
void LogDir(Item * dir);
|
||||
void AddDir();
|
||||
void AddParam();
|
||||
void ParseOrdinaryParams();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||
* Copyright (c) 2010-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -310,9 +310,9 @@ void Functions::Finish()
|
||||
}
|
||||
|
||||
|
||||
void Functions::Parse()
|
||||
bool Functions::Parse()
|
||||
{
|
||||
function_parser.Parse(cur, db, this, system);
|
||||
return function_parser.Parse(cur, db, this, system);
|
||||
}
|
||||
|
||||
|
||||
@@ -510,9 +510,6 @@ void Functions::CheckGetPostTimes(time_t difference)
|
||||
if( now - cur->session->last_time_get >= (time_t)difference )
|
||||
return;
|
||||
|
||||
if( cur->request->AllPostVarEmpty() )
|
||||
return;
|
||||
|
||||
cur->session->spam_score += 1;
|
||||
log << log1 << "Functions: spam +1: POST after GET sent too fast" << logend;
|
||||
}
|
||||
|
@@ -150,7 +150,7 @@ public:
|
||||
|
||||
void Init();
|
||||
void Finish();
|
||||
void Parse();
|
||||
bool Parse();
|
||||
size_t FunctionsSize();
|
||||
|
||||
Iterator Begin();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013-2021, Tomasz Sowa
|
||||
* Copyright (c) 2013-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -78,6 +78,7 @@ void ImgCrop::GetDirContent()
|
||||
eq(L"type", static_cast<int>(Item::file)).
|
||||
eq(L"parent_id", cur->request->dir_tab.back()->id).
|
||||
eq(L"content", L"file_type", WINIX_ITEM_FILETYPE_IMAGE).
|
||||
raw("order by item.sort_index asc, item.url asc, item.id asc").
|
||||
get_vector();
|
||||
|
||||
//db->GetItems(cur->request->item_tab, iq);
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2021, Tomasz Sowa
|
||||
* Copyright (c) 2008-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -65,6 +65,7 @@ void Ls::prepare_files()
|
||||
finder.eq(L"content", L"file_type", WINIX_ITEM_FILETYPE_IMAGE);
|
||||
}
|
||||
|
||||
finder.raw("order by item.sort_index asc, item.url asc, item.id asc");
|
||||
finder.get_vector(item_tab);
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2021, Tomasz Sowa
|
||||
* Copyright (c) 2011-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -65,70 +65,29 @@ bool Sort::HasAccess()
|
||||
|
||||
void Sort::GetDirContent()
|
||||
{
|
||||
// iq.sel_content = false;
|
||||
// iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
// db->GetItems(cur->request->item_tab, iq);
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"parent_id", cur->request->dir_tab.back()->id).
|
||||
get_vector(cur->request->item_tab);
|
||||
raw("order by item.sort_index asc, item.url asc, item.id asc").
|
||||
get_vector(items);
|
||||
|
||||
system->CheckWriteAccessToItems(cur->request->item_tab);
|
||||
system->CheckWriteAccessToItems(items);
|
||||
cur->request->models.Add(L"item_tab", items);
|
||||
}
|
||||
|
||||
|
||||
bool Sort::SortHelper::operator()(size_t t1, size_t t2)
|
||||
Item * Sort::FindItem(long id)
|
||||
{
|
||||
return psort->cur->request->item_tab[t1].id < psort->cur->request->item_tab[t2].id;
|
||||
}
|
||||
|
||||
|
||||
bool Sort::SortFun2(const SortPair & s1, const SortPair & s2)
|
||||
{
|
||||
return s1.id < s2.id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Sort::CreateItemTab()
|
||||
{
|
||||
size_t len = cur->request->item_tab.size();
|
||||
item_tab.resize(len);
|
||||
|
||||
for(size_t i=0 ; i<len ; ++i)
|
||||
item_tab[i] = i;
|
||||
|
||||
std::sort(item_tab.begin() , item_tab.end(), SortHelper(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Sort::CreateItemTab2()
|
||||
{
|
||||
PostTab::iterator i2 = cur->request->post_tab.begin();
|
||||
SortPair sp;
|
||||
|
||||
item_tab2.clear();
|
||||
item_tab2.reserve(cur->request->post_tab.size());
|
||||
|
||||
// post_tab is sorted in lexicographical order but we should sort it by numbers
|
||||
|
||||
for( ; i2 != cur->request->post_tab.end() ; ++i2 )
|
||||
for(Item & item : items)
|
||||
{
|
||||
if( pt::is_substr_nc(L"sort", i2->first.c_str()) )
|
||||
{
|
||||
sp.id = Tol(i2->first.c_str() + 4);
|
||||
sp.sort_index = Toi(i2->second);
|
||||
|
||||
item_tab2.push_back(sp);
|
||||
}
|
||||
if( item.id == id )
|
||||
return &item;
|
||||
}
|
||||
|
||||
std::sort(item_tab2.begin(), item_tab2.end(), SortFun2);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +98,6 @@ void Sort::UpdateSortIndex(Item & item, int sort_index)
|
||||
ItemModelData item_model_data;
|
||||
item_model_data.prepare_unique_url = false;
|
||||
|
||||
//if( db->EditSortIndexItemById(item.id, sort_index) == WINIX_ERR_OK )
|
||||
if( item.update(item_model_data, false) )
|
||||
{
|
||||
log << log2
|
||||
@@ -150,42 +108,36 @@ void Sort::UpdateSortIndex(Item & item, int sort_index)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Sort::UpdateSortIndexes()
|
||||
void Sort::UpdateItems()
|
||||
{
|
||||
size_t i1 = 0;
|
||||
size_t i2 = 0;
|
||||
|
||||
while( i1 < item_tab.size() && i2 < item_tab2.size() )
|
||||
if( cur->request->post_in.is_object() )
|
||||
{
|
||||
long id1 = cur->request->item_tab[item_tab[i1]].id;
|
||||
long id2 = item_tab2[i2].id;
|
||||
pt::Space::ObjectType::iterator i2 = cur->request->post_in.value.value_object.begin();
|
||||
|
||||
if( id1 == id2 )
|
||||
for( ; i2 != cur->request->post_in.value.value_object.end() ; ++i2 )
|
||||
{
|
||||
int sort_index = item_tab2[i2].sort_index;
|
||||
Item & item = cur->request->item_tab[item_tab[i1]];
|
||||
if( i2->second->is_wstr() && pt::is_substr_nc(L"sort", i2->first.c_str()) )
|
||||
{
|
||||
long id = Tol(i2->first.c_str() + 4);
|
||||
int sort_index = Toi(*i2->second->get_wstr());
|
||||
|
||||
if( system->HasWriteAccess(item) )
|
||||
UpdateSortIndex(item, sort_index);
|
||||
Item * pitem = FindItem(id);
|
||||
|
||||
++i1;
|
||||
++i2;
|
||||
}
|
||||
else
|
||||
if( id1 < id2 )
|
||||
{
|
||||
++i1;
|
||||
}
|
||||
else
|
||||
{
|
||||
++i2;
|
||||
if( pitem )
|
||||
{
|
||||
if( system->HasWriteAccess(*pitem) )
|
||||
{
|
||||
UpdateSortIndex(*pitem, sort_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Sort::MakePost()
|
||||
{
|
||||
if( cur->request->is_item )
|
||||
@@ -196,13 +148,10 @@ void Sort::MakePost()
|
||||
else
|
||||
{
|
||||
GetDirContent();
|
||||
CreateItemTab();
|
||||
CreateItemTab2();
|
||||
UpdateSortIndexes();
|
||||
UpdateItems();
|
||||
}
|
||||
|
||||
plugin->Call(WINIX_DIR_CONTENT_SORTED, cur->request->dir_tab.back());
|
||||
|
||||
system->RedirectToLastItem();
|
||||
}
|
||||
|
||||
|
@@ -57,34 +57,12 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
//DbItemQuery iq;
|
||||
std::vector<size_t> item_tab; // indexes to cur->request->item_tab
|
||||
|
||||
struct SortPair
|
||||
{
|
||||
long id;
|
||||
int sort_index;
|
||||
};
|
||||
|
||||
std::vector<SortPair> item_tab2; // from post table
|
||||
|
||||
// for sorting item_tab
|
||||
struct SortHelper
|
||||
{
|
||||
Sort * psort;
|
||||
|
||||
SortHelper(Sort * s) : psort(s) {}
|
||||
bool operator()(size_t t1, size_t t2);
|
||||
};
|
||||
|
||||
// for sorting item_tab2
|
||||
static bool SortFun2(const SortPair & s1, const SortPair & s2);
|
||||
std::vector<Item> items;
|
||||
|
||||
void GetDirContent();
|
||||
void CreateItemTab();
|
||||
void CreateItemTab2();
|
||||
Item * FindItem(long id);
|
||||
void UpdateSortIndex(Item & item, int sort_index);
|
||||
void UpdateSortIndexes();
|
||||
void UpdateItems();
|
||||
};
|
||||
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2021, Tomasz Sowa
|
||||
* Copyright (c) 2008-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -436,11 +436,6 @@ void Upload::MakeGet()
|
||||
{
|
||||
if( cur->request->IsParam(L"jquery_upload") )
|
||||
{
|
||||
// query.Clear();
|
||||
// query.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
// query.WhereType(Item::file);
|
||||
// query.WhereFileType(WINIX_ITEM_FILETYPE_NONE, false);
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
finder.
|
||||
@@ -449,10 +444,9 @@ void Upload::MakeGet()
|
||||
eq(L"parent_id", cur->request->dir_tab.back()->id).
|
||||
eq(L"type", static_cast<int>(Item::file)).
|
||||
neq(L"content", L"file_type", WINIX_ITEM_FILETYPE_NONE).
|
||||
raw("order by item.sort_index asc, item.url asc, item.id asc").
|
||||
get_vector(cur->request->item_tab);
|
||||
|
||||
//db->GetItems(cur->request->item_tab, query);
|
||||
|
||||
CreateAnswer();
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||
* Copyright (c) 2010-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -60,7 +60,6 @@ public:
|
||||
private:
|
||||
|
||||
std::wstring path;
|
||||
//DbItemQuery query;
|
||||
bool is_jquery_upload;
|
||||
magic_t magic_cookie;
|
||||
pt::Space files;
|
||||
|
Reference in New Issue
Block a user