グループウェアの開発も終盤になり、いよいよ一番の難関!メールの開発に着手しようと考えてた。しかし、調べてみるとメールの開発は、かなり大変そうである。そこで、グループウェアから直接起動できるWebメールのライブラリを探していたところ、「Roundcube webmail」にたどり着いた。いくつかのグループウェアで採用しているという情報から、簡単にできるかもしれないとの思い出ダウンロードしてみた。
【必要な機能】
1. グループウェアから自動でログインする
2. ログアウトでグループウェアにリダイレクトする
//RoundcubeAutoLogin.php
// send parameters with post, its more secure because username and password not shown in browser and logfile
$rcuser=$_REQUEST['rc_user'];
$rcpass=$_REQUEST['rc_pass'];
//rc_user(メールアドレス)と'rc_pass(パスワード)をPOSTでRoundcubeAutoLogin.phpを起動すればいい。
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('logout_redirect');
/* %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'] = 'リダイレクト先のURL';
最後に、ログアウトではなくHOMEに戻るので
Roundcube/program/localization/ja_JP/labels.incの $labels['logout'] を HOME に変更した
$labels['welcome'] = '$productにようこそ';
$labels['username'] = 'ユーザー名';
$labels['password'] = 'パスワード';
$labels['server'] = 'サーバー';
$labels['login'] = 'ログイン';
$labels['menu'] = 'メニュー';
$labels['logout'] = 'HOME';
$labels['mail'] = '電子メール';