diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-03-19 08:33:36 +0100 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-03-19 08:33:36 +0100 |
commit | 33b06c448443bb0085ff986c341594d80903f43b (patch) | |
tree | e80977f084f5f149471995976edb4a01eee886a9 /lib/connector | |
parent | 097ce76fc4383c68856ee70db0c87f0e9f5fefb4 (diff) | |
parent | de09883d860d6507a2d287d0b8bae394963c4b94 (diff) | |
download | nextcloud-server-33b06c448443bb0085ff986c341594d80903f43b.tar.gz nextcloud-server-33b06c448443bb0085ff986c341594d80903f43b.zip |
Merge branch 'master' into sabredav_1.6
Diffstat (limited to 'lib/connector')
-rw-r--r-- | lib/connector/sabre/auth.php | 1 | ||||
-rw-r--r-- | lib/connector/sabre/directory.php | 4 | ||||
-rw-r--r-- | lib/connector/sabre/principal.php | 44 |
3 files changed, 3 insertions, 46 deletions
diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php index 1e87c7cee08..8964ef7d0de 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/connector/sabre/auth.php @@ -23,6 +23,7 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { * @return bool */ protected function validateUserPass($username, $password){ + OC_Util::setUpFS();//login hooks may need early access to the filesystem if(OC_User::login($username,$password)){ OC_Util::setUpFS(); return true; diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index d1cb55ce130..912c8cd439a 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -73,8 +73,8 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa $nodes = array(); // foreach(scandir($this->path) as $node) if($node!='.' && $node!='..') $nodes[] = $this->getChild($node); - if( OC_Filesystem::is_dir($this->path)){ - $dh = OC_Filesystem::opendir($this->path); + if( OC_Filesystem::is_dir($this->path . '/')){ + $dh = OC_Filesystem::opendir($this->path . '/'); while(( $node = readdir($dh)) !== false ){ if($node!='.' && $node!='..'){ $nodes[] = $this->getChild($node); diff --git a/lib/connector/sabre/principal.php b/lib/connector/sabre/principal.php index 6cfb3449e1a..d1456f7c642 100644 --- a/lib/connector/sabre/principal.php +++ b/lib/connector/sabre/principal.php @@ -9,50 +9,6 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend { /** - * TODO: write doc - */ - public static function addPrincipal($params){ - // Add the user - $uri = 'principals/'.$params['uid']; - $displayname = $params['uid']; - $query = OC_DB::prepare('INSERT INTO *PREFIX*principals (uri,displayname) VALUES(?,?)'); - $query->execute(array($uri,$displayname)); - - // Add calendar and addressbook read and write support (sharing calendars) - $uri = 'principals/'.$params['uid'].'/calendar-proxy-read'; - $displayname = null; - $query->execute(array($uri,$displayname)); - $uri = 'principals/'.$params['uid'].'/calendar-proxy-write'; - $query->execute(array($uri,$displayname)); - $uri = 'principals/'.$params['uid'].'/addressbook-proxy-read'; - $query->execute(array($uri,$displayname)); - $uri = 'principals/'.$params['uid'].'/addressbook-proxy-write'; - $query->execute(array($uri,$displayname)); - - return true; - } - - /** - * TODO: write doc - */ - public static function deletePrincipal($params){ - $query = OC_DB::prepare('SELECT * FROM *PREFIX*principals'); - $result = $query->execute(); - - $deleteprincipal = OC_DB::prepare('DELETE FROM *PREFIX*principals WHERE id = ?'); - $deletegroup = OC_DB::prepare('DELETE FROM *PREFIX*principalgroups WHERE principal_id = ? OR member_id = ?'); - // We have to delete the principals and relations! Principals include - while($row = $result->fetchRow()){ - // Checking if the principal is in the prefix - $array = explode('/',$row['uri']); - if ($array[1] != $params['uid']) continue; - $deleteprincipal->execute(array($row['id'])); - $deletegroup->execute(array($row['id'],$row['id'])); - } - return true; - } - - /** * Returns a list of principals based on a prefix. * * This prefix will often contain something like 'principals'. You are only |