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

gnowak

@PJLawrence

The problem is that the code is not evaluated correctly and the login is not redirected.

Quotemaybe you need to set the text box to $GLOBALS["$modSettings['logon_redirect_url']"]

I guess you mean that the text box should be something like this: $GLOBALS["$_SESSION['old_url']"]

But it then returns this error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/example.com/Sources/LogInOut.php(148) : eval()'d code on line 1
Curriculum Vitae [nofollow]

PJLawrence

sorry I got the syntax a bit wrong try...
$GLOBALS["$_SESSION"]['old_url']

gnowak

Your suggestion does not return an error, but the redirection does not work in my case.
Curriculum Vitae [nofollow]

PJLawrence

Sorry about that, I forgot that $_SESSION variables are global anyway so adding $GLOBALS wouldn't have worked anyway. Let me know if you solve the problem since is seems odd that eval does not work in this case.

Eclipse16V

Nice Mod

Here the German Lang
// Redirect on Login and/or Logout MOD
$txt['logon_redirect_enable'] = 'Aktiviere die Login-Weiterleitung<br /><span class="smalltext">(Leitet User nach dem Login auf eine bestimmt Seite weiter.)</span>';
$txt['logon_redirect_url'] = 'Login URL';
$txt['logout_redirect_enable'] = 'Aktiviere die Logout-Weiterleitung<br /><span class="smalltext">(Leitet User nach dem Logout auf eine bestimmt Seite weiter.)</span>';
$txt['logout_redirect_url'] = 'Logout URL';
I worked with:
SMF 2 in German

Shop:
SID Giessen

Bugo

Russian translation:

// PJL : Start of Redirect on login/logout Mod.
$txt['logon_redirect_enable'] = 'Перенаправлять пользователей после авторизации<br /><span class="smalltext">(Пользователи будут перенаправлены по указанному ниже адресу)</span>';
$txt['logon_redirect_url'] = 'Введите URL-адрес для перехода';
$txt['logout_redirect_enable'] = 'Перенаправлять пользователей после выхода с форума?<br /><span class="smalltext">(Пользователи будут перенаправлены по указанному ниже адресу)</span>';
$txt['logout_redirect_url'] = 'Введите URL-адрес для перехода';
// End Mod.

Eclipse16V

Nice Mod

Please update it for SMF 2.0RC3  ;)

Thanks
I worked with:
SMF 2 in German

Shop:
SID Giessen

Tedi

Hello PJ,

thx for that mod.

I'm using SMF 1.1.11 in an iframe, and like to redirect the user to the top main page of our site after logout.

I entered the url "http://www.fcv-vfl.de [nofollow]" in the input field for the logout-redirection.
The redirection works, but the new page was shown in the iframe instead.

How or where can I do an input for the target-attribut of the url ? Something like "_TOP" or "_BLANK" ?

I guess it should work by using the "...index.php?action= ... "

But  I don't like to modify any other php-files manually,  because I don't want to do it all again after a future smf update.

Any idea ?

Thx.
Tedi

PJLawrence

Sorry I don't think this is possible via this mod. The "_TOP" or "_BLANK" needs to be included within the html tag. I'm not sure this can be achieved via PHP maybe ask in the "SMF Coding Discussion" board. Note SMF mods work via modifying the PHP code, so if you change any php code you can always convert your modifications into an SMF mod at a later stage.

Tedi

Hm. I see. So I'll try to find another solution.
Thx anyway.

choloman05


PJLawrence

Sorry not had a the time to test it fully on RC4. However, it should, in theory, install and work with RC4 as it is.

choloman05

Quote from: PJLawrence on November 16, 2010, 05:02:48 AM
Sorry not had a the time to test it fully on RC4. However, it should, in theory, install and work with RC4 as it is.

Thank you! I'll try it out.

mulder1094

I have installed this mod on a clean install of smf2.rc4 - like in previous posts the logout redirect works great, however the login redirect simply goes to the forum index page.

Here is the weird bit...

This problem ONLY occurs in Google Chrome, with firefox or IE the mod works fine.

In the past I have used the "redirect on register" MOD and I had the same trouble with Chrome, when I posted in the forum for that MOD and was told to check settings for Chrome, this didn't change anything, does anyone here have any solutions?


Donny Bahama

I'm evaluating SMF to see if it will meet my needs. Just to confirm, does this mod set a global redirect page (for all users) or can each user (or better yet, group) be assigned a different page?

Ricky.

This mod does not provide facility to set redirect / login for all members !

Thilo

Hi there,

has anyone this mod (Redirect on Login and/or Logout mod   V 0.4 )

running together with the "Anti-Spam Links" Mod V1.0.1 ?


Because in my case the first one stops the second one working...


Well - makes kind of sense - since both mods changing the way the links are displayed and function.


But - since both Mods are really useful it would be perfekt to have a chance to let them work together...


Anyone any ideas ? or no way to get those two together working ?

GL700Wing

#77
For SMF 2.1
If you download the v0.4 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))
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Advertisement: