Hello everybody!
What if we can redirect the logout to a specific link determined by us?
It's easy, see the code below!
In your ACP: Modules -> HTML&JAVASCRIPT -> JavaScript codes management -> [Create a new JavaScript]
Title *: <- Whatever you want
Placement : <- In all the pages
Javascript Code * : <- Select, copy and paste the code below in this field:
I await your feedback,
JS
What if we can redirect the logout to a specific link determined by us?
It's easy, see the code below!
In your ACP: Modules -> HTML&JAVASCRIPT -> JavaScript codes management -> [Create a new JavaScript]
Title *: <- Whatever you want
Placement : <- In all the pages
Javascript Code * : <- Select, copy and paste the code below in this field:
- Code:
/***
* Application: LogoutRedirect.js
* Description: Logout redirect to a link of your choice!
* Version: 0.02282015-jq1.9.1
* RC1 (Release candidate 1!) - ébé
* Author: JScript - 2015/02/28
* Copyright (c) 2015 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
var LogoutRedirect = '/portal' ; // <- Change the link for what you want!
if (localStorage.getItem("logout")) {
localStorage.removeItem("logout");
location.href = LogoutRedirect;
};
jQuery(function() {
if (!_userdata.session_logged_in) {
return false;
}
var _ToolBar = setInterval(function() {
if (document.getElementById('fa_welcome') !== null) {
clearInterval(_ToolBar);
jQuery('a[href$="logout=1"]').attr('href', jQuery('#logout').attr('href'));
jQuery('a[href*="logout=1"]').click(function(event) {
localStorage.setItem("logout", 1);
});
}
}, 1000);
});
I await your feedback,
JS