[if mount_page_arg_is "subject"]
[dir_last_subject]
[end]
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
@@ -16,7 +16,7 @@
{thread_tab_title} | {thread_tab_author} | {thread_tab_replies} | {thread_tab_last_post} |
---|
[for thread_sort_tab]
- [thread_sort_tab_subject] | [# dodac sprawdzanie subject empty]
+ [thread_sort_tab_subject] | [# dodac sprawdzanie subject empty]
[thread_sort_tab_user] | [thread_sort_tab_replies] |
[thread_sort_tab_last_item_date_modification_nice] ([thread_sort_tab_last_item_user]) |
@@ -27,11 +27,3 @@
-[if false]
-[if any winix_has_htmx winix_is_htmx_request winix_has_uikit]
-
-[end]
-[end]
diff --git a/winixd/html/fun_thread.html b/winixd/html/fun_thread.html
index badebfb..c327edd 100644
--- a/winixd/html/fun_thread.html
+++ b/winixd/html/fun_thread.html
@@ -1,4 +1,4 @@
-
+
[if mount_page_arg_is "subject"]
[item_subject]
[end]
[if false]
@@ -55,4 +55,24 @@
+[if winix_function_param_is "scrolltop"]
+
+ [if winix_has_uikit]
+
+ [end]
+[end]
+
+[if winix_function_param_is "scrolldown"]
+
+
+ [if winix_has_uikit]
+
+ [end]
+[end]
diff --git a/winixd/locale/en b/winixd/locale/en
index 1403f6a..331bf2a 100644
--- a/winixd/locale/en
+++ b/winixd/locale/en
@@ -108,6 +108,7 @@ add_page = Add page
edit_page = Edit page
rebus_how_is_it = Rebus: How is it
+rebus_need_to_solve = Solve the rebus please!
edit_ticket_header = Edit ticket
create_ticket_header = Create a new ticket
@@ -542,7 +543,7 @@ notify_footer4 = in your user control panel.
# IMPROVE ME now they are not used, and should be moved to slog
winix_err_3 = Incorrect directory.
winix_err_18 = You are suspected to be a spammer, you cannot send anything without logging first.
-winix_err_19 = Solve the rebus please!
+
winix_err_25 = Passwords are different!
winix_err_26 = A password should consist of at least five characters.
diff --git a/winixd/locale/pl b/winixd/locale/pl
index 9f6f100..10f80c9 100644
--- a/winixd/locale/pl
+++ b/winixd/locale/pl
@@ -113,6 +113,8 @@ add_page = Dodaj stronę
edit_page = Edytuj stronę
rebus_how_is_it = Rebus: Ile to jest
+rebus_need_to_solve = Proszę rozwiązać rebus!
+
edit_ticket_header = Edytuj zgłoszenie
create_ticket_header = Nowe zgłoszenie
@@ -558,7 +560,7 @@ notify_footer4 = w swoim panelu użytkownika.
# those errors are taken automatically by [winix_err_msg_from_locales]
winix_err_3 = Nieprawidłowy katalog.
winix_err_18 = Jesteś podejrzany jako spamer, nie możesz nic wysłać do czasu zalogowania się!
-winix_err_19 = Proszę rozwiązać rebus!
+
winix_err_25 = Podane hasła różnią się od siebie!
winix_err_26 = Hasło powinno składać się z co najmniej pięciu znaków.
diff --git a/winixd/plugins/thread/createthread.cpp b/winixd/plugins/thread/createthread.cpp
index c393223..9f4043b 100644
--- a/winixd/plugins/thread/createthread.cpp
+++ b/winixd/plugins/thread/createthread.cpp
@@ -95,6 +95,10 @@ void CreateThread::SendNotify(const Item & item)
void CreateThread::MakePost()
{
+ // is it a correct bahavior to set spam_score in session?
+ // after the first mistake the person will not be allowed to post anything
+ cur->session->spam_score = 0;
+
cur->request->item.Clear();
functions->ReadItem(cur->request->item, Item::file);
functions->SetUser(cur->request->item);
diff --git a/winixd/plugins/thread/reply.cpp b/winixd/plugins/thread/reply.cpp
index b9dadec..9532da2 100644
--- a/winixd/plugins/thread/reply.cpp
+++ b/winixd/plugins/thread/reply.cpp
@@ -112,6 +112,10 @@ void Reply::MakePost()
// !! jak bedzie dostepne assert
// ASSERT(files_dir)
+ // is it a correct bahavior to set spam_score in session?
+ // after the first mistake the person will not be allowed to post anything
+ cur->session->spam_score = 0;
+
thread = Thread::get_thread(model_connector, cur->request->item.id);
if( !thread.found() )
@@ -143,8 +147,18 @@ void Reply::MakePost()
cur->request->last_item = &cur->request->item;
cur->request->item.item_content.guest_name.clear();
- if( functions->CheckAbuse() )
+ if( functions->CheckAbuse(&slog) )
+ {
+ // temporary: to show values in the html form
+ // this will be changed when a new ezc objects will be implemented
+ // there'll be two objects: one registered as [item..] and the other registered as [answer..]
+ // (one for url and the other for content)
+ cur->request->item.item_content.content_raw = answer.item_content.content_raw;
+ cur->request->item.item_content.content_raw_type = answer.item_content.content_raw_type;
+ cur->request->item.item_content.guest_name = answer.item_content.guest_name;
+
return;
+ }
plugin->Call(WINIX_PL_THREAD_PREPARE_TO_REPLY_IN_THREAD, &answer);
@@ -157,7 +171,17 @@ void Reply::MakePost()
if( cur->request->status == WINIX_ERR_OK )
{
log << log2 << "Reply: added an answer in a thread" << logend;
- thread_info->MakeRedirectIfPossible(cur->request->item);
+
+ const wchar_t * postfix = nullptr;
+
+ if( cur->request->IsParam(L"scrollup") )
+ postfix = L"/-/scrollup";
+
+ if( cur->request->IsParam(L"scrolldown") )
+ postfix = L"/-/scrolldown";
+
+ thread_info->MakeRedirectIfPossible(cur->request->item, postfix);
+
SendNotify(cur->request->item);
}
else
@@ -172,12 +196,14 @@ void Reply::MakeGet()
{
/*
* workaround:
- * html form showed the nick name from item
+ * html form showed the nick name from item (and content)
* this will be removed when new ezc object templates will be implemented
* we can provide two item templates: one for [item_url] and the rest for the html form
* [item_url] is used in
*/
cur->request->item.item_content.guest_name.clear();
+ cur->request->item.item_content.content_raw.clear();
+
}
diff --git a/winixd/plugins/thread/threadinfo.cpp b/winixd/plugins/thread/threadinfo.cpp
index 48ffa97..6a75ac9 100644
--- a/winixd/plugins/thread/threadinfo.cpp
+++ b/winixd/plugins/thread/threadinfo.cpp
@@ -194,7 +194,7 @@ void ThreadInfo::Repair()
-void ThreadInfo::MakeRedirectIfPossible(const Item & item)
+void ThreadInfo::MakeRedirectIfPossible(const Item & item, const wchar_t * postfix)
{
PluginRes res = plugin->Call(WINIX_PL_THREAD_CAN_MAKE_REDIRECT);
@@ -204,7 +204,7 @@ void ThreadInfo::MakeRedirectIfPossible(const Item & item)
return;
}
- system->RedirectTo(item);
+ system->RedirectTo(item, postfix);
}
diff --git a/winixd/plugins/thread/threadinfo.h b/winixd/plugins/thread/threadinfo.h
index 3904e74..edbd404 100644
--- a/winixd/plugins/thread/threadinfo.h
+++ b/winixd/plugins/thread/threadinfo.h
@@ -99,7 +99,7 @@ public:
// repairing the database
void Repair();
- void MakeRedirectIfPossible(const Item & item);
+ void MakeRedirectIfPossible(const Item & item, const wchar_t * postfix = nullptr);
private:
diff --git a/winixd/templates/winix.cpp b/winixd/templates/winix.cpp
index 7654291..823e365 100644
--- a/winixd/templates/winix.cpp
+++ b/winixd/templates/winix.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2008-2018, Tomasz Sowa
+ * Copyright (c) 2008-2021, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -377,11 +377,7 @@ void winix_locale_tab_name(Info & i)
void winix_is_htmx_request(Info & i)
{
- if( cur->request->headers_in.has_key(L"HX-Request") || cur->request->headers_in.has_key(L"hx_request") )
- {
- // fastcgi will change the header to hx_request
- i.res = true;
- }
+ i.res = cur->request->is_htmx_request;
}