Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly unban users that are banned on "site" #9818

Merged
merged 6 commits into from
Feb 10, 2025
Merged

Conversation

Pinkeltje
Copy link
Contributor

Pull Request for Issue #9812 .

Summary of Changes

  • Check for expired bans every hour (3600 seconds)
  • Automatically unblock users in both Joomla and Kunena when their ban expires
  • Add a comment to the ban record indicating it was automatically removed
  • Track the last check time to avoid unnecessary database queries

Testing Instructions

Ban user on "site" for a short time. Check after an hour if user is unbanned.
If you want to check quicker, change value on line 126
if ($timestamp - $lastCheck >= 3600) {

@@ -6,7 +6,7 @@
* @package Kunena.Plugins
* @subpackage System
*
* @copyright Copyright (C) 2008 - @currentyear@ Kunena Team. All rights reserved.
* @copyright Copyright (C) 2008 - 2025 Kunena Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useless to replace @currentyear@ because it's a variable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Have to check this every time as Dreamweaver does this. Will try to remember for next time.

@@ -2,16 +2,16 @@
<!DOCTYPE extension>
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>plg_system_kunena</name>
<version>@kunenaversion@</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, It's useless to replace it

@@ -2,16 +2,16 @@
<!DOCTYPE extension>
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>plg_system_kunena</name>
<version>@kunenaversion@</version>
<creationDate>@kunenaversiondate@</creationDate>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, It's useless to replace it

@xillibit xillibit added the 6.4 label Feb 8, 2025
@xillibit xillibit added this to the 6.4 milestone Feb 8, 2025
@Gindi50
Copy link

Gindi50 commented Feb 9, 2025

I added the codes 2f4e768 and a601f3e to my test version last night and it seems to be working.
When I started the test version this morning, the users who were banned yesterday were activated as new users.
I will continue to test it intensively.

@Gindi50
Copy link

Gindi50 commented Feb 9, 2025

This morning, I set an expiration date for this afternoon for the same banned user on the live site, on a version on localhost, and on the modified version on localhost.
On the live site and on localhost, the user remained banned. On the modified version on localhost, the user was activated as a new user.

@xillibit xillibit merged commit c135704 into Kunena:K6.4 Feb 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants