aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/DAV/Auth
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/Sabre/DAV/Auth')
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php14
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Backend/AbstractDigest.php32
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Backend/Apache.php22
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Backend/File.php33
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Backend/PDO.php35
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/IBackend.php12
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/DAV/Auth/Plugin.php60
7 files changed, 108 insertions, 100 deletions
diff --git a/3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php b/3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php
index 11bab8c7af7..1e89b84f9a1 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php
+++ b/3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php
@@ -8,9 +8,9 @@
*
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author James David Low (http://jameslow.com/)
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
abstract class Sabre_DAV_Auth_Backend_AbstractBasic implements Sabre_DAV_Auth_IBackend {
@@ -28,6 +28,8 @@ abstract class Sabre_DAV_Auth_Backend_AbstractBasic implements Sabre_DAV_Auth_IB
* This method should return true or false depending on if login
* succeeded.
*
+ * @param string $username
+ * @param string $password
* @return bool
*/
abstract protected function validateUserPass($username, $password);
@@ -47,13 +49,15 @@ abstract class Sabre_DAV_Auth_Backend_AbstractBasic implements Sabre_DAV_Auth_IB
/**
* Authenticates the user based on the current request.
*
- * If authentication is succesful, true must be returned.
+ * If authentication is successful, true must be returned.
* If authentication fails, an exception must be thrown.
*
+ * @param Sabre_DAV_Server $server
+ * @param string $realm
* @throws Sabre_DAV_Exception_NotAuthenticated
* @return bool
*/
- public function authenticate(Sabre_DAV_Server $server,$realm) {
+ public function authenticate(Sabre_DAV_Server $server, $realm) {
$auth = new Sabre_HTTP_BasicAuth();
$auth->setHTTPRequest($server->httpRequest);
@@ -75,5 +79,5 @@ abstract class Sabre_DAV_Auth_Backend_AbstractBasic implements Sabre_DAV_Auth_IB
}
-}
+}
diff --git a/3rdparty/Sabre/DAV/Auth/Backend/AbstractDigest.php b/3rdparty/Sabre/DAV/Auth/Backend/AbstractDigest.php
index 5bdc72753ec..9833928b976 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Backend/AbstractDigest.php
+++ b/3rdparty/Sabre/DAV/Auth/Backend/AbstractDigest.php
@@ -4,12 +4,12 @@
* HTTP Digest authentication backend class
*
* This class can be used by authentication objects wishing to use HTTP Digest
- * Most of the digest logic is handled, implementors just need to worry about
- * the getDigestHash method
+ * Most of the digest logic is handled, implementors just need to worry about
+ * the getDigestHash method
*
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
@@ -17,7 +17,7 @@ abstract class Sabre_DAV_Auth_Backend_AbstractDigest implements Sabre_DAV_Auth_I
/**
* This variable holds the currently logged in username.
- *
+ *
* @var array|null
*/
protected $currentUser;
@@ -25,24 +25,26 @@ abstract class Sabre_DAV_Auth_Backend_AbstractDigest implements Sabre_DAV_Auth_I
/**
* Returns a users digest hash based on the username and realm.
*
- * If the user was not known, null must be returned.
- *
+ * If the user was not known, null must be returned.
+ *
* @param string $realm
- * @param string $username
- * @return string|null
+ * @param string $username
+ * @return string|null
*/
- abstract public function getDigestHash($realm,$username);
+ abstract public function getDigestHash($realm, $username);
/**
* Authenticates the user based on the current request.
*
- * If authentication is succesful, true must be returned.
+ * If authentication is successful, true must be returned.
* If authentication fails, an exception must be thrown.
*
+ * @param Sabre_DAV_Server $server
+ * @param string $realm
* @throws Sabre_DAV_Exception_NotAuthenticated
- * @return bool
+ * @return bool
*/
- public function authenticate(Sabre_DAV_Server $server,$realm) {
+ public function authenticate(Sabre_DAV_Server $server, $realm) {
$digest = new Sabre_HTTP_DigestAuth();
@@ -83,9 +85,9 @@ abstract class Sabre_DAV_Auth_Backend_AbstractDigest implements Sabre_DAV_Auth_I
}
/**
- * Returns the currently logged in username.
- *
- * @return string|null
+ * Returns the currently logged in username.
+ *
+ * @return string|null
*/
public function getCurrentUser() {
diff --git a/3rdparty/Sabre/DAV/Auth/Backend/Apache.php b/3rdparty/Sabre/DAV/Auth/Backend/Apache.php
index 6bcd76bdcb0..d4294ea4d86 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Backend/Apache.php
+++ b/3rdparty/Sabre/DAV/Auth/Backend/Apache.php
@@ -4,34 +4,36 @@
* Apache authenticator
*
* This authentication backend assumes that authentication has been
- * conifgured in apache, rather than within SabreDAV.
+ * configured in apache, rather than within SabreDAV.
*
* Make sure apache is properly configured for this to work.
*
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_DAV_Auth_Backend_Apache implements Sabre_DAV_Auth_IBackend {
/**
- * Current apache user
- *
- * @var string
+ * Current apache user
+ *
+ * @var string
*/
protected $remoteUser;
-
+
/**
* Authenticates the user based on the current request.
*
- * If authentication is succesful, true must be returned.
+ * If authentication is successful, true must be returned.
* If authentication fails, an exception must be thrown.
*
- * @return bool
+ * @param Sabre_DAV_Server $server
+ * @param string $realm
+ * @return bool
*/
- public function authenticate(Sabre_DAV_Server $server,$realm) {
+ public function authenticate(Sabre_DAV_Server $server, $realm) {
$remoteUser = $server->httpRequest->getRawServerValue('REMOTE_USER');
if (is_null($remoteUser)) {
@@ -47,7 +49,7 @@ class Sabre_DAV_Auth_Backend_Apache implements Sabre_DAV_Auth_IBackend {
* Returns information about the currently logged in user.
*
* If nobody is currently logged in, this method should return null.
- *
+ *
* @return array|null
*/
public function getCurrentUser() {
diff --git a/3rdparty/Sabre/DAV/Auth/Backend/File.php b/3rdparty/Sabre/DAV/Auth/Backend/File.php
index db1f04c4772..de308d64a67 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Backend/File.php
+++ b/3rdparty/Sabre/DAV/Auth/Backend/File.php
@@ -4,29 +4,28 @@
* This is an authentication backend that uses a file to manage passwords.
*
* The backend file must conform to Apache's htdigest format
- *
+ *
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_DAV_Auth_Backend_File extends Sabre_DAV_Auth_Backend_AbstractDigest {
/**
- * List of users
- *
+ * List of users
+ *
* @var array
*/
protected $users = array();
/**
- * Creates the backend object.
+ * Creates the backend object.
*
* If the filename argument is passed in, it will parse out the specified file fist.
- *
- * @param string $filename
- * @return void
+ *
+ * @param string|null $filename
*/
public function __construct($filename=null) {
@@ -38,22 +37,22 @@ class Sabre_DAV_Auth_Backend_File extends Sabre_DAV_Auth_Backend_AbstractDigest
/**
* Loads an htdigest-formatted file. This method can be called multiple times if
* more than 1 file is used.
- *
- * @param string $filename
+ *
+ * @param string $filename
* @return void
*/
public function loadFile($filename) {
foreach(file($filename,FILE_IGNORE_NEW_LINES) as $line) {
- if (substr_count($line, ":") !== 2)
+ if (substr_count($line, ":") !== 2)
throw new Sabre_DAV_Exception('Malformed htdigest file. Every line should contain 2 colons');
-
+
list($username,$realm,$A1) = explode(':',$line);
if (!preg_match('/^[a-zA-Z0-9]{32}$/', $A1))
throw new Sabre_DAV_Exception('Malformed htdigest file. Invalid md5 hash');
-
+
$this->users[$realm . ':' . $username] = $A1;
}
@@ -62,10 +61,10 @@ class Sabre_DAV_Auth_Backend_File extends Sabre_DAV_Auth_Backend_AbstractDigest
/**
* Returns a users' information
- *
- * @param string $realm
- * @param string $username
- * @return string
+ *
+ * @param string $realm
+ * @param string $username
+ * @return string
*/
public function getDigestHash($realm, $username) {
diff --git a/3rdparty/Sabre/DAV/Auth/Backend/PDO.php b/3rdparty/Sabre/DAV/Auth/Backend/PDO.php
index 0301503601e..eac18a23fbb 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Backend/PDO.php
+++ b/3rdparty/Sabre/DAV/Auth/Backend/PDO.php
@@ -4,38 +4,37 @@
* This is an authentication backend that uses a file to manage passwords.
*
* The backend file must conform to Apache's htdigest format
- *
+ *
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_DAV_Auth_Backend_PDO extends Sabre_DAV_Auth_Backend_AbstractDigest {
/**
- * Reference to PDO connection
- *
- * @var PDO
+ * Reference to PDO connection
+ *
+ * @var PDO
*/
protected $pdo;
/**
- * PDO table name we'll be using
- *
+ * PDO table name we'll be using
+ *
* @var string
*/
protected $tableName;
/**
- * Creates the backend object.
+ * Creates the backend object.
*
* If the filename argument is passed in, it will parse out the specified file fist.
- *
- * @param string $filename
- * @param string $tableName The PDO table name to use
- * @return void
+ *
+ * @param PDO $pdo
+ * @param string $tableName The PDO table name to use
*/
public function __construct(PDO $pdo, $tableName = 'users') {
@@ -45,15 +44,15 @@ class Sabre_DAV_Auth_Backend_PDO extends Sabre_DAV_Auth_Backend_AbstractDigest {
}
/**
- * Returns the digest hash for a user.
- *
- * @param string $realm
- * @param string $username
- * @return string|null
+ * Returns the digest hash for a user.
+ *
+ * @param string $realm
+ * @param string $username
+ * @return string|null
*/
public function getDigestHash($realm,$username) {
- $stmt = $this->pdo->prepare('SELECT username, digesta1 FROM `'.$this->tableName.'` WHERE username = ?');
+ $stmt = $this->pdo->prepare('SELECT username, digesta1 FROM '.$this->tableName.' WHERE username = ?');
$stmt->execute(array($username));
$result = $stmt->fetchAll();
diff --git a/3rdparty/Sabre/DAV/Auth/IBackend.php b/3rdparty/Sabre/DAV/Auth/IBackend.php
index 1f67af4c2d9..5be5d1bc93d 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/IBackend.php
+++ b/3rdparty/Sabre/DAV/Auth/IBackend.php
@@ -5,7 +5,7 @@
*
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
@@ -14,18 +14,20 @@ interface Sabre_DAV_Auth_IBackend {
/**
* Authenticates the user based on the current request.
*
- * If authentication is succesful, true must be returned.
+ * If authentication is successful, true must be returned.
* If authentication fails, an exception must be thrown.
*
- * @return bool
+ * @param Sabre_DAV_Server $server
+ * @param string $realm
+ * @return bool
*/
- function authenticate(Sabre_DAV_Server $server,$realm);
+ function authenticate(Sabre_DAV_Server $server,$realm);
/**
* Returns information about the currently logged in username.
*
* If nobody is currently logged in, this method should return null.
- *
+ *
* @return string|null
*/
function getCurrentUser();
diff --git a/3rdparty/Sabre/DAV/Auth/Plugin.php b/3rdparty/Sabre/DAV/Auth/Plugin.php
index f3718fcf469..55a4e391674 100644..100755
--- a/3rdparty/Sabre/DAV/Auth/Plugin.php
+++ b/3rdparty/Sabre/DAV/Auth/Plugin.php
@@ -2,48 +2,47 @@
/**
* This plugin provides Authentication for a WebDAV server.
- *
+ *
* It relies on a Backend object, which provides user information.
*
* Additionally, it provides support for:
* * {DAV:}current-user-principal property from RFC5397
* * {DAV:}principal-collection-set property from RFC3744
- *
+ *
* @package Sabre
* @subpackage DAV
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_DAV_Auth_Plugin extends Sabre_DAV_ServerPlugin {
/**
- * Reference to main server object
- *
- * @var Sabre_DAV_Server
+ * Reference to main server object
+ *
+ * @var Sabre_DAV_Server
*/
private $server;
/**
* Authentication backend
- *
- * @var Sabre_DAV_Auth_Backend_Abstract
+ *
+ * @var Sabre_DAV_Auth_IBackend
*/
private $authBackend;
/**
- * The authentication realm.
- *
- * @var string
+ * The authentication realm.
+ *
+ * @var string
*/
private $realm;
/**
- * __construct
- *
- * @param Sabre_DAV_Auth_Backend_Abstract $authBackend
- * @param string $realm
- * @return void
+ * __construct
+ *
+ * @param Sabre_DAV_Auth_IBackend $authBackend
+ * @param string $realm
*/
public function __construct(Sabre_DAV_Auth_IBackend $authBackend, $realm) {
@@ -53,9 +52,9 @@ class Sabre_DAV_Auth_Plugin extends Sabre_DAV_ServerPlugin {
}
/**
- * Initializes the plugin. This function is automatically called by the server
- *
- * @param Sabre_DAV_Server $server
+ * Initializes the plugin. This function is automatically called by the server
+ *
+ * @param Sabre_DAV_Server $server
* @return void
*/
public function initialize(Sabre_DAV_Server $server) {
@@ -67,11 +66,11 @@ class Sabre_DAV_Auth_Plugin extends Sabre_DAV_ServerPlugin {
/**
* Returns a plugin name.
- *
+ *
* Using this name other plugins will be able to access other plugins
- * using Sabre_DAV_Server::getPlugin
- *
- * @return string
+ * using Sabre_DAV_Server::getPlugin
+ *
+ * @return string
*/
public function getPluginName() {
@@ -81,10 +80,10 @@ class Sabre_DAV_Auth_Plugin extends Sabre_DAV_ServerPlugin {
/**
* Returns the current users' principal uri.
- *
- * If nobody is logged in, this will return null.
- *
- * @return string|null
+ *
+ * If nobody is logged in, this will return null.
+ *
+ * @return string|null
*/
public function getCurrentUser() {
@@ -97,10 +96,11 @@ class Sabre_DAV_Auth_Plugin extends Sabre_DAV_ServerPlugin {
/**
* This method is called before any HTTP method and forces users to be authenticated
- *
+ *
* @param string $method
+ * @param string $uri
* @throws Sabre_DAV_Exception_NotAuthenticated
- * @return bool
+ * @return bool
*/
public function beforeMethod($method, $uri) {