Ticket #1485956 (closed Feature Requests: fixed)
IMAP reconnection prevent plugins from handling password
| Reported by: | jsh | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.3-stable |
| Component: | Plugin API | Version: | svn-trunk |
| Severity: | normal | Keywords: | |
| Cc: | li@… |
Description
In method rcube_imap::set_flag() a reconnection to the IMAP server is done :
// close and re-open connection
// this prevents connection problems with Courier
$this->reconnect();
This reconnection is done with password stored in session but this prevents plugins from handling one time password usage.
Long explanation:
I'm in the process of writing a plugin for CAS SSO authentication.
The plugin is working great except when the method set_flag is called.
With CAS authentication, a CAS ticket is used as IMAP password. It can only be used once so the plugin request one and store it in $_SESSION[ 'password' ] at every page call. The problem is that the rcube_imap::reconnect() method doesn't allow the plugin to request a new CAS ticket so the IMAP authentication failed.
What solution to this would be best ?
- Add a plugin hook 'before_imap_connect' that would allow plugin to manipulate connection data just before the connection ?
- Drop the reconnect() method (probably not the right option...)
