Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: Cola-Coca on March 27, 2025, 08:25:06 PM

Title: [FREE] Redirect on Login and/or Logout mod
Post by: Cola-Coca on March 27, 2025, 08:25:06 PM
Can someone update this mod?
https://custom.simplemachines.org/index.php?mod=1443
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: Kindred on March 27, 2025, 11:32:24 PM
In short -- no. There was no license included with the mod (this was before we required a defined license) which means the it defaults to the most restrictive license which does not allow anyone else to republish
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: GL700Wing on March 28, 2025, 02:01:35 AM
Quote from: Cola-Coca on March 27, 2025, 08:25:06 PMCan someone update this mod?
https://custom.simplemachines.org/index.php?mod=1443
@Cola-Coca If you download the Redirect on Login and/or Logout mod v0.4 (https://custom.simplemachines.org/index.php?mod=1443) mod and edit the install2.xml file as follows the mod will install and work on SMF 2.1 (this doesn't change how the mod works - it just changes the check for where one block of code gets inserted).

In the install2.xml file replace line 10 with the following line:
if ((empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) || (isset($_GET['quicklogin']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false))
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: Illori on March 28, 2025, 05:13:50 AM
Quote from: GL700Wing on March 28, 2025, 02:01:35 AM
Quote from: Cola-Coca on March 27, 2025, 08:25:06 PMCan someone update this mod?
https://custom.simplemachines.org/index.php?mod=1443
@Cola-Coca If you download the Redirect on Login and/or Logout mod v0.4 (https://custom.simplemachines.org/index.php?mod=1443) mod and edit the install2.xml file as follows the mod will install and work on SMF 2.1 (this doesn't change how the mod works - it just changes the check for where one block of code gets inserted).

In the install2.xml file replace line 10 with the following line:
    if ((empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) || (isset($_GET['quicklogin']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false))

SMF 2.0 and SMF 2.1 has an emulation feature for the package manager that should allow this without editing the files, is this not working?
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: GL700Wing on March 28, 2025, 05:21:49 AM
Quote from: Illori on March 28, 2025, 05:13:50 AM
Quote from: GL700Wing on March 28, 2025, 02:01:35 AM
Quote from: Cola-Coca on March 27, 2025, 08:25:06 PMCan someone update this mod?
https://custom.simplemachines.org/index.php?mod=1443
@Cola-Coca If you download the Redirect on Login and/or Logout mod v0.4 (https://custom.simplemachines.org/index.php?mod=1443) mod and edit the install2.xml file as follows the mod will install and work on SMF 2.1 (this doesn't change how the mod works - it just changes the check for where one block of code gets inserted).

In the install2.xml file replace line 10 with the following line:
    if ((empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) || (isset($_GET['quicklogin']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false))

SMF 2.0 and SMF 2.1 has an emulation feature for the package manager that should allow this without editing the files, is this not working?
Emulation mode didn't need to be used (the mod installs for "2.0 - 2.99.99") but an install error occurred because one block of code that is being searched for in ./Sources/LogInOut.php is not exactly the same in SMF 2.1 as it was in SMF 2.0.
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: Cola-Coca on March 28, 2025, 10:43:30 PM
@GL700Wing I installed the mod without any errors. Unfortunately it doesn't work. When I login, nothing happens, just the home page opens.
Title: Re: [FREE] Redirect on Login and/or Logout mod
Post by: GL700Wing on March 29, 2025, 12:29:29 AM
Quote from: Cola-Coca on March 28, 2025, 10:43:30 PM@GL700Wing I installed the mod without any errors. Unfortunately it doesn't work. When I login, nothing happens, just the home page opens.
The login and logout URLs I configured on the forum on which I tested this mod definitely worked - suggest you logout, clear your browser cache and then login/logout again.