News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Redirect on Login and/or Logout mod.

Started by PJLawrence, October 05, 2008, 06:52:07 PM

Previous topic - Next topic

Ricky.

Sorry, I do not remember what problem I had but was minor and regarding modification instruction only, though not sure.


About the feature, you already provide a way to provide 1 link for logout and 1 link for login .

Basically I want that if possible, can we have a feature where we can provide multiple links ie. say 5 links. And whenever user log in then he is one of the random link. :)


drumsage

#21
I'm using SMF 1.1.7 ... downloaded and installed the RedirectLoginLogout0.2 package.

Installed correctly ... even checked the files manually by opening the up and finding the new code added by the package.

Set my redirects for login and logout in the Admin CP ... checked the boxes.

The mod isn't working!

I've tried various URLs ... but with all kinds of tests, using my admin account or a regular member account, nothing works as far as the mod is concerned. When I login or logout, I am NOT redirected; the forum acts formally as it did prior to the mod addition.

I've tested this with the last version of IE and Firefox (in case you are wondering).

Any suggestions? The code is simple and straight forward, but it doesn't work for me.

P.S. I'm using very few mods on my forum. None of which are in conflict with the installation process or the mod itself. I've manually checked all the codes, and everything is there. Cleared the cache ... still nothing.

EDIT: I went in and deleted cookies and cleared the cache again, just to be certain, and now the logout works correctly, but not the login.
SMF 1.1.10 |  Joomla 1.5.14

PJLawrence

drumsage, what mods have you installed? Since if any of them set either the $_SESSION['login_url'] or $_SESSION['logout_url'] variables then these will override this mod. Also note that if you have a custom theme installed this can also set the $_SESSION login/logout variables which will also override this mod.

ɔɔɔɔɔɔuɥoɾ

This is a sweet mod dude, i almost go to google everytime i log out, so now its one less click lol... :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ttuu

good job.
Maybe would be nice to add a little extra.
That each user can choose which address to go by himself?

ɔɔɔɔɔɔuɥoɾ

Quote from: ttuu on February 05, 2009, 04:10:32 AM
good job.
Maybe would be nice to add a little extra.
That each user can choose which address to go by himself?

thats actually a good idea, maybe for next revision he may do it

choose own redirect address or disable, nice!


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PJLawrence

Sounds a good idea. However, I think this should be a separate mod.
I may get around to it at some point, that's if someone else does not beat me to it.
I've no objections in someone else taking my mod and developing it further and then uploading there own version to this site.

TheMaker

Excuse me, I have a question.
If I want active a redirect to a page only for one group of users, instead another redirect to another page for the users, how I can modified the mod?


Sorry for my bad english  :)

PJLawrence

Modifying this simple mod to redirect per a group  would require some major code changes. How good is your PHP? Maybe it would be best to ask this question in the SMF Coding discussion board.

SgtMic

Redirect for log out works great. Login is another story. No matter what url I use, it does not redirect.
Using RC1.

Mods installed:
1.     Sitemap      2.0.0      
2.    Quote Clear Line    1.0    
3.    MCLegendII.2    3.0    
4.    Bugger    1.01    
5.    The Rules    1.2    
6.    New Topic Button    1.0    
7.    Notify Modification Last Post    1.1    
8.    Custom_Greeting_Depending_on_Time    0.9    
9.    Last Post On MemberList    1    
10.    Aeva ~ Auto-Embed Video & Audio    5.2.56    
11.    Spoiler Tag    0.6a    
12.    Active Members In Topic    1.7    
13.    Help Linktree & Breadcrumbs Fix    1.0    
14.    Last Active On MemberList    1.01    
15.    Order Stickied Topics    1.01    
16.    Prettier_Quotes    1.12    
17.    No Reply Emails    1.3    
18.    E-Arcade    Beta 3 SMF2rc1    
19.    BK-SMF Sub-Board    1.5    
20.    Images On Board    2.1    
21.    Stars And Badges    2.1    
22.    Custom Copyright    1.1    
23.    Users Online Today    1.5.4    
24.    SMF Media Gallery    1.5.4    
25.    Welcome Topic Mod    2.0.1    
26.    Order Custom Profile Fields    1.01    
27.    Topic Solved    1.1    
28.    EmailValidator    1.0    
29.    SMF Quiz    1.0.3    
30.    Redirect on Login and/or Logout mod    0.3    
31.    Attachment Icon File    1.0    
32.    More Spiders    1.2    
33.    Add IP2Location to Track IP    1.2    
34.    DonationsPro    1.02    
35.    Custom Fields On Memberlist    1.0    
36.    Search Focus Dropdown    1.1    
37.    Irritate lurkers with 0 posts    0.1    
38.    BK-SMF Website    1.0    
39.    Time Logged-In     3.3
There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

PJLawrence

SgtMic, This mod has been tested on a clean version of Beta2 RC1 and works without problem. However, this mod is passive and only redirect if the login session variables have not been set. Hence if any mod sets the login session variable this overrides what is set in the admin options.
If you feel brave you can comment out the test for a non empty login url. However, this is not recommended.

SgtMic

Sounds like what I'll need to do is uninstall thew mods until I find the culprit.
And go from there.
Thanks.
There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

PJLawrence

Quite a number of mods seem to try and control login but not many play with the logout option.

The code which checks if the login session login_url variable is set is found in ./Sources/LogInOut.php. Search for the following code in the Login2 function

if (!empty($modSettings['logon_redirect_enable']) && !empty($modSettings['logon_redirect_url']))
{
if (empty($_SESSION['login_url']))
$_SESSION['login_url'] = $modSettings['logon_redirect_url'];
}


If you find what the $_SESSION['login_url'] is set to you can then instruct smf to override the redirection when this variable is set to that value. However, this does not work with all mods which put code in the redirectexit function found in Subs.php, since this overrides whatever is set by the Login2 function.

abbyh

#33
Doesn't work for me :( Neither the two zip files can be installed. It said the package is corrupt or not compatible with my SMF version while my version is 1.1.8.

Update. Though I have figured out what causing error at my package manager, I have installed this mod said successful yet there is no redirect happening after I've set the URL at the Features & Options. It is the same redirecting me to the Forum Page(Board Index) everytime I log in or out.


PJLawrence

#34
As stated before this mod is passive and only redirects if the login session variables have not been set. Hence if any mod or custom theme sets the login session variable this overrides what is set in the admin options. Also try deleting cookies and clearing your browser's cache to make sure that's also not the problem.

PalmBeachPreps

I'm using TinyPortal.  Any way to have the user remain on the page that they log in at?

PJLawrence

Which version of TinyPortal are you using?
Does not the quick login (if you have this enabled) redirects you back to the page you're currently viewing.

PalmBeachPreps


PJLawrence

Normally the quick login keeps you on the page where you have just logged into. However, this could be overridden by a mod or a theme.
I think there is a problem with the newer version of Tinyportal but not the older version 0.9.8.
Maybe, take a look at the Tinyportal website since I know this question has been asked there many times.
Also search this form for things like $_SESSION['login_url'] and $_SESSION['old_url']

cbearhoney

I love the mod, though I have trouble getting the Login redirect to work in Firefox. Is it a cookie issue?

Also, I installed the Mod for SMF 1.1.7. Should I reinstall since I upgraded to 1.1.8?

Thanks.
Corporate America gives me hives.

Advertisement: