Roundcube Community Forum

 

RoundCube webmail: redirect on logout

Started by itmonitor, June 07, 2017, 07:39:27 AM

Previous topic - Next topic

itmonitor

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


itmonitor

Thanks! Please, how do I install the plugin?


itmonitor

#4
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:

// ----------------------------------
// 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 protected] 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?

SKaero

I'm not sure about the conflict with the cpanel plugin but the folder name needs to be "logout_redirect" not "logout_redirect_master"

itmonitor

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 $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?

SKaero

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?

itmonitor

I can check, please, where is the log and the file name?

SKaero

There should be a errors file in the logs file.

itmonitor

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?

SKaero

That most likely means there are no errors. What is happening when you logout?

itmonitor

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.

SKaero

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.

itmonitor

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: // 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:
/* %d will be replaced with the default user identity email domain part
*    i.e. [email protected] 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?