Roundcube Community Forum

Release Support => Release Discussion => Topic started by: itmonitor on June 07, 2017, 07:39:27 AM

Title: RoundCube webmail: redirect on logout
Post by: itmonitor on June 07, 2017, 07:39:27 AM
Hi!

I need to configure redirection on logout for RoundCube. Mine is installed in WHM. I found out this code here https://codevote.blogspot.de/2013/07/roundcube-mail-how-to-redirect-to-url.html to add to RoundCube's index.php, but redirection to mydomain.com will not work. Is this code ok or perhaps there is a tweak that will do the redirection on logout trick?

Any advice is welcome :-)

Rgs

IM
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 07, 2017, 07:49:30 AM
Use the plugin https://plugins.roundcube.net/packages/marneu/logout_redirect
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 07, 2017, 08:24:50 AM
Thanks! Please, how do I install the plugin?
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 07, 2017, 09:31:05 AM
https://github.com/roundcube/roundcubemail/wiki/Plugin-API#installing-and-activating-plugins
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 09, 2017, 04:22:18 AM
Many thanks.

I need help making it work. Here are the steps I took:

1. Uploaded the plugin, it is now at /plugins/logout_redirect_master
2. Added the following settings to config.inc.php:

Code: [Select]
// ----------------------------------
// PLUGINS
// ----------------------------------

// List of active plugins (in plugins/ directory)
$config['plugins'] = array('cpanellogin','cpanellogout','logout_redirect_master');

/* %d will be replaced with the default user identity email domain part
 *    i.e. email@domain.com will replace %d with "domain.com"
**/
$config['logout_redirect_url'] = 'https://www.mydomain.com/';

However, the redirection to https://www.mydomain.com is not working onlogout. It will redirected to the same cpanel login page. Should I delete 'cpanellogout' from the enabled plugin list above?
 
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 09, 2017, 10:57:04 AM
I'm not sure about the conflict with the cpanel plugin but the folder name needs to be "logout_redirect" not "logout_redirect_master"
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 09, 2017, 12:09:35 PM
Thanks!

When downloading the logout_redirect plugin at https://github.com/marneu/logout_redirect , it will download a zipped file named logour_redirect-master. No problem, I renamed the plugin folder into logout_redirect and changed config.inc.php into
Code: [Select]
$config['plugins'] = array('cpanellogin','cpanellogout','logout_redirect'); but still the logout does not work.

Does this plugin needs the roundcube/plugin-installer: >=0.1.2?
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 09, 2017, 12:39:32 PM
You shouldn't need to, it maybe conflicting with the cpanel logout plugin, I'm not sure what that one does. Is there anything in the logs?
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 09, 2017, 12:45:22 PM
I can check, please, where is the log and the file name?
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 09, 2017, 01:36:39 PM
There should be a errors file in the logs file.
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 09, 2017, 02:52:32 PM
could not find any error log in the folders under the main folder RoundCube. Enven the folder Logs is empty. Do you know where I enable error logging?
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 09, 2017, 03:25:06 PM
That most likely means there are no errors. What is happening when you logout?
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 09, 2017, 11:46:34 PM
it logouts as usual, to the Webmail login from WHM/Cpanel, instead of logging out into the https URL I specified in the code above.
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 10, 2017, 12:20:55 AM
That wouldn't be the default behavior so the "cpanellogout" logout plugin is most likely overwriting the "logout_redirect" plugin. Try removing the "cpanellogout" plugin from the plugins array and see if it works then.
Title: Re: RoundCube webmail: redirect on logout
Post by: itmonitor on June 10, 2017, 01:52:17 AM
Skaero, thank you for your patience :-)

Well, I deleted 'cpanellogut' from the array, but still the logout is not redirected to the https URL. Just to help, I reproduce the steps I took when installing the logout_redirect plugin

1. I downloaded it and when unzipped, it will result in a folder named logout_redirect-master
2. I deleted the -master part and uploaded it to the roundcube/plugins folder in the server
3. On config.inc.php I added 'logout_redirect' to end of the array as follows:
Code: [Select]
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('cpanellogin','attachment_reminder','redundant_attachments','newmail_notifier','vcard_attachments','zipdownload','logout_redirect');
4. At the end of the config.inc.php file I pasted the code:
Code: [Select]
/* %d will be replaced with the default user identity email domain part
 *    i.e. email@domain.com will replace %d with "domain.com"
**/
$config['logout_redirect_url'] = 'https://www.mydomain.com/';

5. For every code change I did, I deleted Chrome's cookies.

Are all those steps/code ok?

Wild guesses:
Perhaps the redirect will not work with https?
When doing the login: from mydomain.com's home page, I click on a hyperlink that takes me to the WHM Webmail login page. I type user id and password and access the webmail. On logout it will redirect again to the WHM Webmail page (and not to mydomain.com's home page). Perhaps on the WHM Webmail login it will add a cookie that makes it return to the same login page on logout?
Title: Re: RoundCube webmail: redirect on logout
Post by: SKaero on June 11, 2017, 12:37:22 PM
Your changes look fine to me so I'd have to guess that something with cPanel is causing it to not work. The only other thing I could think to do would be to try to but a die statement in the plugin code to make sure it is getting that far.
Title: Re: RoundCube webmail: redirect on logout
Post by: devnull7 on July 14, 2017, 02:39:06 PM
Thanks itmonitor! Your link tip works perfectly for me.
I'm not sure why it didn't work for you.
Did you miss a step or wrote it wrong?
Title: Re: RoundCube webmail: redirect on logout
Post by: schmartin on May 12, 2020, 09:28:13 AM
If someone else has the same problem as itmonitor:
$config['logout_redirect_url'] = 'https://www.mydomain.com/';
must not be added at the end of the main config.inc.php but in the config.inc.php in the plugin-folder (e.g. plugins/logout_redirsct) which can easiest be copied from config.inc.pgp.dist in the same folder.
Title: Re: RoundCube webmail: redirect on logout
Post by: revolt2 on February 22, 2021, 05:46:18 PM
If someone else has the same problem as itmonitor:
$config['logout_redirect_url'] = 'https://www.mydomain.com/';
must not be added at the end of the main config.inc.php but in the config.inc.php in the plugin-folder (e.g. plugins/logout_redirsct) which can easiest be copied from config.inc.pgp.dist in the same folder.


sorry you gived wrong informations about  (e.g. plugins/logout_redirsct)
Title: Re: RoundCube webmail: redirect on logout
Post by: revolt2 on February 22, 2021, 05:51:23 PM
FOR ALL : The procedure normal way, is not working for that PLUGIN.

relay on :
https://github.com/roundcube/roundcubemail/wiki/Plugin-API#installing-and-activating-plugins

If im wrong please correct me, and write a tutorial how to.