summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-07-20 16:36:36 +0200
committerJakob Sack <kde@jakobsack.de>2011-07-20 16:36:36 +0200
commit86cd8063b49315246929f51774ac5314dab2c2cb (patch)
tree0559fc537bba3ef5679aba66d8d888e636e275e4 /lib
parentbf1ca75710a99a96ba39790e9db79bb0a0f950b4 (diff)
downloadnextcloud-server-86cd8063b49315246929f51774ac5314dab2c2cb.tar.gz
nextcloud-server-86cd8063b49315246929f51774ac5314dab2c2cb.zip
Use SabreDAV authentication Code!
Diffstat (limited to 'lib')
-rw-r--r--lib/Sabre/DAV/Auth/Backend/Owncloud.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Sabre/DAV/Auth/Backend/Owncloud.php b/lib/Sabre/DAV/Auth/Backend/Owncloud.php
new file mode 100644
index 00000000000..8c8556f9f20
--- /dev/null
+++ b/lib/Sabre/DAV/Auth/Backend/Owncloud.php
@@ -0,0 +1,35 @@
+<?php
+require_once("lib/base.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_Sabre_DAV_Auth_Backend_Owncloud 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;
+ }
+ }
+}