From fde42c4d1216e456f41a8c3a149455e5b7540091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20Can=20Elmac=C4=B1?= Date: Sat, 24 May 2025 05:41:16 +0300 Subject: [PATCH] SMF Fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed registeration redirect on SMF 2.1 * Fixed banned users Signed-off-by: Mustafa Can Elmacı --- ForumProvider/smf2.0.php | 2 +- ForumProvider/smf2.1.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ForumProvider/smf2.0.php b/ForumProvider/smf2.0.php index b30e931..e94ad40 100644 --- a/ForumProvider/smf2.0.php +++ b/ForumProvider/smf2.0.php @@ -313,7 +313,7 @@ public function legacyUpdateWikiUser(array $member, object $wikiUser): bool */ public function checkBans(array $member): bool { - $banned = isset($profile['is_activated']) ? $profile['is_activated'] >= 10 : 0; + $banned = isset($member['is_activated']) ? $member['is_activated'] >= 10 : 0; if (empty($banned)) $banned = $this->__check_basic_ban((int) $member['id_member']); diff --git a/ForumProvider/smf2.1.php b/ForumProvider/smf2.1.php index 8e0ca3d..b9df341 100644 --- a/ForumProvider/smf2.1.php +++ b/ForumProvider/smf2.1.php @@ -21,6 +21,12 @@ */ class ForumSoftwareProvidersmf21 extends ForumSoftwareProvidersmf20 { + protected $validRedirectActions = [ + 'createaccount' => 'signup', + 'userlogin' => 'login', + 'userlogout' => 'logout' + ]; + /** * Decodes the forum software cookie returning the id and password. * @@ -82,7 +88,7 @@ public function cookiePasswordIsValid(array $user, array $cookie): bool */ public function checkBans(array $member): bool { - $banned = isset($profile['is_activated']) ? $profile['is_activated'] >= 10 : 0; + $banned = isset($member['is_activated']) ? $member['is_activated'] >= 10 : 0; if (empty($banned)) $banned = $this->__check_basic_ban((int) $member['id_member']);