diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-07-27 19:07:28 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-07-27 19:07:28 +0200 |
commit | f5c0dbd947d45520550b68dae77a894f871a0758 (patch) | |
tree | 5e3c8fe6a12af97990fd529fb0d692ddc9400386 /lib/connector/sabre/auth.php | |
parent | 59e55b711b36a41c4e4c621b5a46f9d601e15c38 (diff) | |
download | nextcloud-server-f5c0dbd947d45520550b68dae77a894f871a0758.tar.gz nextcloud-server-f5c0dbd947d45520550b68dae77a894f871a0758.zip |
Use autoload
Diffstat (limited to 'lib/connector/sabre/auth.php')
-rw-r--r-- | lib/connector/sabre/auth.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php new file mode 100644 index 00000000000..4e974ad821d --- /dev/null +++ b/lib/connector/sabre/auth.php @@ -0,0 +1,34 @@ +<?php +/** + * HTTP Basic authentication backend class + * + * This class can be used by authentication objects wishing to use HTTP Basic + * Most of the digest logic is handled, implementors just need to worry about + * the validateUserPass method. + * + * @package Sabre + * @subpackage DAV + * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved. + * @author James David Low (http://jameslow.com/) + * @author Evert Pot (http://www.rooftopsolutions.nl/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { + /** + * Validates a username and password + * + * This method should return true or false depending on if login + * succeeded. + * + * @return bool + */ + protected function validateUserPass($username, $password){ + if(OC_USER::login($username,$password)){ + OC_UTIL::setUpFS(); + return true; + } + else{ + return false; + } + } +} |