mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-21 16:13:00 +00:00
Add new anoncomments setting
This commit is contained in:
parent
ad8d05a3eb
commit
0e0ccd9e00
3 changed files with 4 additions and 1 deletions
|
@ -20,6 +20,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
|||
- Get in touch if you experience performance issues with fetching tag lists from your wiki
|
||||
- A command-line interface!
|
||||
- Wiki administrators with terminal/console access can now make use of a brand-new CLI by executing `php ./index.php` (warning: strange things will happen if the current working directory is not the directory that contains index.php and peppermint.json)
|
||||
- Added new `anoncomments` setting to control whether anonymous users are allowed to make comments (disabled by default) - thanks to @SeanFromIT for suggesting it in #181
|
||||
|
||||
### Fixed
|
||||
- Fixed weighted word support on search query analysis debug page
|
||||
|
|
|
@ -35,7 +35,7 @@ register_module([
|
|||
$reply_to = $_POST["replyto"] ?? null;
|
||||
$message = $_POST["message"] ?? "";
|
||||
|
||||
if(!$env->is_logged_in) {
|
||||
if(!$env->is_logged_in && !$settings->anoncomments) {
|
||||
http_response_code(401);
|
||||
exit(page_renderer::render_main("Error posting comment - $settings->sitename", "<p>Your comment couldn't be posted because you're not logged in. You can login <a href='?action=index'>here</a>. Here's the comment you tried to post:</p>
|
||||
<textarea readonly>".htmlentities($message)."</textarea>"));
|
||||
|
@ -102,6 +102,7 @@ register_module([
|
|||
"$thread_comment->message\n" .
|
||||
"\n";
|
||||
|
||||
// If the user is anonymous, this will fail and return false (it accounts for non-existent users automatically)
|
||||
email_user($thread_comment->username, $email_subject, $email_body);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
"index.php?action=help"
|
||||
]
|
||||
]},
|
||||
"anoncomments": { "type": "checkbox", "description": "Whether to allow anonymous user to make comments. Note that anonymous users are not able to delete their own comments (since they are not logged in, there's no way to know if they were the original poster or not)", "default": false },
|
||||
"comment_max_length": { "type": "number", "description": "The maximum allowed length, in characters, for comments", "default": 5000 },
|
||||
"comment_min_length": { "type": "number", "description": "The minimum allowed length, in characters, for comments", "default": 10 },
|
||||
"comment_time_icon": { "type": "text", "description": "The icon to show next to the time that a comment was posted.", "default": "🕗" },
|
||||
|
|
Loading…
Reference in a new issue