I've been looking for a way to change the logout link for users within my plugin, but setLogoutPage() will result in it being a relative link, when I want it to go to an external site.
Ex. My site is example.com, so the link normally is example.com/logout.php. If I do setLogoutPage to https://foo.com, the link ends up being example.com/https://foo.com.
Is there a way to avoid the link being relative, or to add a new link there and remove the old one?
Editing navbar (logout link) via plugin
Moderators: Developer, Contributor
Editing navbar (logout link) via plugin
Mantis 2.25.1
PHP 7.4.19
PHP 7.4.19
Re: Editing navbar (logout link) via plugin
You can redirect with this setting:
/**
* Specify where the user should be sent after logging out.
* @global string $g_logout_redirect_page
*/
$g_logout_redirect_page = "http://www_mypage.com";
/**
* Specify where the user should be sent after logging out.
* @global string $g_logout_redirect_page
*/
$g_logout_redirect_page = "http://www_mypage.com";
Re: Editing navbar (logout link) via plugin
That line doesn't seem to work. I've also tried using setLogoutRedirectPage. The link remains the same, and simply refreshes the same page when you click it.
Mantis 2.25.1
PHP 7.4.19
PHP 7.4.19
Re: Editing navbar (logout link) via plugin
In that case raise an issue on http://www.mantisbt.org/bugs
Re: Editing navbar (logout link) via plugin
Is there a way to just hide the link through a plugin?
Mantis 2.25.1
PHP 7.4.19
PHP 7.4.19
Re: Editing navbar (logout link) via plugin
Then you need to create that plugin.
In your case I would adjust logout.php with a fixed redirect
In your case I would adjust logout.php with a fixed redirect
Re: Editing navbar (logout link) via plugin
I considered it.
There really should be a hook or HTML ID on the logout button, though, since the only way I could get it in jQuery was find the logout icon, then go to the parent.
There really should be a hook or HTML ID on the logout button, though, since the only way I could get it in jQuery was find the logout icon, then go to the parent.
Mantis 2.25.1
PHP 7.4.19
PHP 7.4.19