diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-31 12:25:48 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-31 12:25:48 +0000 |
| commit | e6d8f97bf2e0bbb4d95df0c4e030eb7ec6ef75a5 (patch) | |
| tree | 4f6fdadb51cbe1a2bb3b2b06c9bcabb0429d1a84 /plugins/http_authentication | |
| parent | 868c169e2a64c1d19a9b6bbcd98f268808dfd173 (diff) | |
Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore
git-svn-id: https://svn.roundcube.net/trunk@6034 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/http_authentication')
| -rw-r--r-- | plugins/http_authentication/http_authentication.php | 67 | ||||
| -rw-r--r-- | plugins/http_authentication/logout.html | 29 | ||||
| -rw-r--r-- | plugins/http_authentication/package.xml | 48 |
3 files changed, 0 insertions, 144 deletions
diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php deleted file mode 100644 index 6c873713e..000000000 --- a/plugins/http_authentication/http_authentication.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/** - * HTTP Basic Authentication - * - * Make use of an existing HTTP authentication and perform login with the existing user credentials - * - * Configuration: - * // redirect the client to this URL after logout. This page is then responsible to clear HTTP auth - * $rcmail_config['logout_url'] = 'http://server.tld/logout.html'; - * - * See logout.html (in this directory) for an example how HTTP auth can be cleared. - * - * @version @package_version@ - * @license GNU GPLv3+ - * @author Thomas Bruederli - */ -class http_authentication extends rcube_plugin -{ - public $task = 'login|logout'; - - function init() - { - $this->add_hook('startup', array($this, 'startup')); - $this->add_hook('authenticate', array($this, 'authenticate')); - $this->add_hook('logout_after', array($this, 'logout')); - } - - function startup($args) - { - // change action to login - if (empty($args['action']) && empty($_SESSION['user_id']) - && !empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) - $args['action'] = 'login'; - - return $args; - } - - function authenticate($args) - { - // Allow entering other user data in login form, - // e.g. after log out (#1487953) - if (!empty($args['user'])) { - return $args; - } - - if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { - $args['user'] = $_SERVER['PHP_AUTH_USER']; - $args['pass'] = $_SERVER['PHP_AUTH_PW']; - } - - $args['cookiecheck'] = false; - $args['valid'] = true; - - return $args; - } - - function logout($args) - { - // redirect to configured URL in order to clear HTTP auth credentials - if (!empty($_SERVER['PHP_AUTH_USER']) && $args['user'] == $_SERVER['PHP_AUTH_USER'] && ($url = rcmail::get_instance()->config->get('logout_url'))) { - header("Location: $url", true, 307); - } - } - -} - diff --git a/plugins/http_authentication/logout.html b/plugins/http_authentication/logout.html deleted file mode 100644 index 0a78a62f2..000000000 --- a/plugins/http_authentication/logout.html +++ /dev/null @@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>Logout</title> -<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> -<script type="text/javascript"> - -// as seen on http://stackoverflow.com/questions/31326/is-there-a-browser-equivalent-to-ies-clearauthenticationcache -$(document).ready(function(){ - if (document.all && document.execCommand) { - document.execCommand("ClearAuthenticationCache", "false"); - } - else { - $.ajax({ - url: location.href, - type: 'POST', - username: '__LOGOUT__', - password: '***********' - }); - } -}); - -</script> -</head> -<body> -<h1>You've successully been logged out!</h1> - -</body>
\ No newline at end of file diff --git a/plugins/http_authentication/package.xml b/plugins/http_authentication/package.xml deleted file mode 100644 index d8f2036b6..000000000 --- a/plugins/http_authentication/package.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 - http://pear.php.net/dtd/tasks-1.0.xsd - http://pear.php.net/dtd/package-2.0 - http://pear.php.net/dtd/package-2.0.xsd"> - <name>http_authentication</name> - <channel>pear.roundcube.net</channel> - <summary>HTTP Basic Authentication</summary> - <description>Make use of an existing HTTP authentication and perform login with the existing user credentials.</description> - <lead> - <name>Thomas Bruederli</name> - <user>thomasb</user> - <email>roundcube@gmail.com</email> - <active>yes</active> - </lead> - <date>2011-11-21</date> - <version> - <release>1.4</release> - <api>1.4</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> - <notes>-</notes> - <contents> - <dir baseinstalldir="/" name="/"> - <file name="http_authentication.php" role="php"> - <tasks:replace from="@name@" to="name" type="package-info"/> - <tasks:replace from="@package_version@" to="version" type="package-info"/> - </file> - <file name="logout.html" role="data"></file> - </dir> - <!-- / --> - </contents> - <dependencies> - <required> - <php> - <min>5.2.1</min> - </php> - <pearinstaller> - <min>1.7.0</min> - </pearinstaller> - </required> - </dependencies> - <phprelease/> -</package> |
