Redirect on Login and/or Logout mod.

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

Previous topic - Next topic

PJLawrence

cbearhoney, you shouldn't need to reinstall the mod when upgrading from 1.1.7 to 1.1.8.
If this mod does not work as expected then deleting cookies and clearing your browser's cache is an option.

olufemo

good one. I have installed successfully and it is working.

just wish to know if there anyway of passing my current url of page I am to login URL, that is after login you will still be on page you are before

PJLawrence

Sorry no this mod can't be used to send people back to the last page they were viewing.
It may be possible to do this by modifying your theme code.
However it all depends on how you are using SMF and if you're bridging with another application.

Maybe this link will help http://forum.websitebaker2.org/index.php/topic,10310.0.html
Also try searching the forum for something like $_SESSION['login_url']

olufemo

Quote from: PJLawrence on July 07, 2009, 05:39:43 AM
Sorry no this mod can't be used to send people back to the last page they were viewing.
It may be possible to do this by modifying your theme code.
However it all depends on how you are using SMF and if you're bridging with another application.

Maybe this link will help http://forum.websitebaker2.org/index.php/topic,10310.0.html
Also try searching the forum for something like $_SESSION['login_url']


Thanks for the link. In which of files can I get those codes refers to, I seems not find them

PJLawrence

olufemo, I'm not sure what you mean.
You need to find another thread in this forum to see how to use the PHP _SESSION variables to enable what you require. Often this will require a modification to your smf theme php code.

Gilgimech

#45
I just installed this mod on a 1.1.10 version. The logout funtion works great, but the login doesn't work at all. No matter what I url I use, http://www.yoursite.xxx/ or http://www.yoursite.xxx/index.php.

And the only other mod I have installed is Advanced News

http://custom.simplemachines.org/mods/index.php?mod=1953


It still goes to the index of my forum.

does anyone know a fix for this?

ɔɔɔɔɔɔuɥoɾ

Did the install work with no errors?
If not, I suggest you Install it again (remove 1st of course) and then see which tests failed, and manually add those

If the test was a success and all went well, then you will have to wait for the mod author to help you


SMF 2.0 RC5

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

Gilgimech

Yeah, the mod installed fine. No errors, it just doesn't work for the login.

PJLawrence

Gilgimech,

Just out of curiosity what other mods do you have installed?

Thanks

Gilgimech


PJLawrence

Gilgimech, are you using the standard theme?

espressoguy

Quote from: PJLawrence on October 06, 2009, 02:32:42 PM
... are you using the standard theme?
I'm also using 1.1.10 and it doesn't work for me either.  I'm using "sus" theme.  How would I go about determining whether or not that theme changes the variables in question?   Have you actually verified that it does work on 1.1.10 by testing it?

PJLawrence

Espressoguy, you need to check your theme to see if it assigns one of the login or logout session variables (i.e $_SESSION['login_url'] ). I've not tested it as yet in version 1.1.10. However, the idea is that sometime next year I'll update this mod to try and address some of the issues raised on this form post.

gnowak

I applied this evil hack to redirect to the current page on login:

./Sources/LogInOut.php

// PJL Redirect on login/logout Mod.
   //if (!empty($modSettings['logon_redirect_enable']) && !empty($modSettings['logon_redirect_url']))
   if (!empty($modSettings['logon_redirect_enable'])) //GRN
   {
      if (empty($_SESSION['login_url']))
         //$_SESSION['login_url'] = $modSettings['logon_redirect_url'];
         $_SESSION['login_url'] = $_SESSION['old_url']; //GRN
   }
// End Mod.

Any suggestions for a cleaner approach?

Thanks
Curriculum Vitae [nofollow]

PJLawrence

#54
gnowak, which version of SMF are you using?
I think joining the if statements with an and statement would clean it up enough. Then if it works why worry about clean code, that's unless you plan to submit your own mod, which you're are welcome to do.

I've updated this mod for SMF 2.0 RC 2 today.
The redirection login and logout works on a clean install of SMF 2.0 RC 2. However, this does not guarantee that it will work in conjunction with any other mods or the non default theme.

gnowak

Hi, I am using SMF 1.1.11 and the mod works very well for me.

I am just wondering if I could redirect to something like this in the settings page on login: $_SESSION['old_url']

Then I would not have to do the hacking :-)

Thanks
Curriculum Vitae [nofollow]

Sudhakar Arjunan

Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

PJLawrence

gnowak, you could try using the PHP eval command, http://php.net/manual/en/function.eval.php, on the $modSettings['logon_redirect_url'] variable.

gnowak

Hey PJLawrence. I tried the eval command on the $modSettings['logon_redirect_url'] variable:


if (empty($_SESSION['login_url']))
$_SESSION['login_url'] = eval($modSettings['logon_redirect_url'].';');


In the settings page in SMF in the "Enter Login URL" text box I inserted: $_SESSION['old_url']

It doesn't work though :-\

Thanks for your time.

Curriculum Vitae [nofollow]

PJLawrence

#59
gnowak, what was the problem?
It could be related to a variable scope problem...
see http://php.net/manual/en/language.variables.scope.php
maybe you need to set the text box to $GLOBALS["modSettings"]['logon_redirect_url']

Advertisement: