Changeset 5121 in subversion
- Timestamp:
- Aug 24, 2011 9:15:40 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/http_authentication/http_authentication.php
r5094 r5121 6 6 * Make use of an existing HTTP authentication and perform login with the existing user credentials 7 7 * 8 * @version 1.3 8 * Configuration: 9 * // redirect the client to this URL after logout. This page is then responsible to clear HTTP auth 10 * $rcmail_config['logout_url'] = 'http://server.tld/logout.html'; 11 * 12 * see http://stackoverflow.com/questions/31326/is-there-a-browser-equivalent-to-ies-clearauthenticationcache 13 * about how HTTP auth can be cleared 14 * 15 * @version 1.4 9 16 * @author Thomas Bruederli 10 17 */ 11 18 class http_authentication extends rcube_plugin 12 19 { 13 public $task = 'login ';20 public $task = 'login|logout'; 14 21 15 22 function init() … … 17 24 $this->add_hook('startup', array($this, 'startup')); 18 25 $this->add_hook('authenticate', array($this, 'authenticate')); 26 $this->add_hook('logout_after', array($this, 'logout')); 19 27 } 20 28 … … 47 55 return $args; 48 56 } 57 58 function logout($args) 59 { 60 // redirect to configured URL in order to clear HTTP auth credentials 61 if (!empty($_SERVER['PHP_AUTH_USER']) && $args['user'] == $_SERVER['PHP_AUTH_USER'] && ($url = rcmail::get_instance()->config->get('logout_url'))) { 62 header("Location: $url", true, 307); 63 } 64 } 49 65 50 66 }
Note: See TracChangeset
for help on using the changeset viewer.
