ElkArte Community

Extending Elk => Addons => Topic started by: ahrasis on February 12, 2017, 10:22:11 am

Title: [ADDON] LILOR: Log In Log Out Redirect
Post by: ahrasis on February 12, 2017, 10:22:11 am
LILOR: Log In Log Out Redirect

Thank you for using/testing it.

Yours friendly,
Abu Fahim Ismail.

BSD3. Feel free to modify but try to keep author's link if it is in there somewhere. ;)

#Change Logs

@Version 1.0.1
- Fix incorrect uninstall.

@Version 1.0.0
- Initial release.
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: ahrasis on February 14, 2017, 07:32:18 am
This mod is not fully hook yet because I have not test it using action hooks for it i.e. integrate_action_login_after and integrate_action_logout_after. I forgot all about it until I review other posts relating to hook.

Do you think that these modification code can be added via the above mentioned action hooks instead?
1. integrate_action_login_after
Code: [Select]
	global $modSettings;
if (!empty($modSettings['login_redirect_enable']) && !empty($modSettings['login_redirect_url']))
{
if (empty($_SESSION['login_url']))
$_SESSION['login_url'] = $modSettings['login_redirect_url'];
}
2. integrate_action_logout_after
Code: [Select]
		global $modSettings;
if (!empty($modSettings['logout_redirect_enable']) && !empty($modSettings['logout_redirect_url']))
{
if (empty($_SESSION['logout_url']))
$_SESSION['logout_url'] = $modSettings['logout_redirect_url'];
}

I will test later when I am on my own laptop.

Edited: Naaah... I can test it here too and it is working. It is fully hook now.

Edited again: Noooo... It was the leftovers from the unhook version. It's not working. :( :( :(
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: ahrasis on February 14, 2017, 10:10:53 am
#Change Logs

@Version 1.0.1
- Fix incorrect uninstall.
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: emanuele on February 14, 2017, 02:33:37 pm
Just to be sure on what I'm going to ask: what does the addon do?
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: ahrasis on February 14, 2017, 03:42:43 pm
Redirect on login and/or logout.
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: emanuele on February 14, 2017, 08:41:10 pm
I'm pretty sure I have understood where it does redirect, but if I were a "normal" user, I would ask "are not members already redirected on login?".
So, I guess the description is something like:
QuoteWhen a member logs in, usually ElkArte sends him to the last page he was visiting (sort of :P), this addon changes the behaviour, redirecting any member that has performed a login to a page chosen by the admin.
Just because these days I'm in a psychopathic mood. :P
Title: Re: [ADDON] LILOR: Log In Log Out Redirect
Post by: ahrasis on February 14, 2017, 11:16:03 pm
Yup. That should be right. He will be redirected to a page chosen by admin on login and logout via this addon.