1: <?php
2: /**
3: * This class implements an authentication backend for Sabre_DAV based on
4: * Horde_Auth.
5: *
6: * Copyright 2009-2012 Horde LLC (http://www.horde.org/)
7: *
8: * @package Sabre
9: * @author Jan Schneider <jan@horde.org>
10: * @license @todo
11: */
12: class Sabre_DAV_Auth_Backend_Horde extends Sabre_DAV_Auth_Backend_Abstract
13: {
14: /**
15: * @var Horde_Auth
16: */
17: protected $_auth;
18:
19: public function __construct(Horde_Auth $auth)
20: {
21: $this->_auth = $auth;
22: }
23:
24: /**
25: * Returns the HTTP Digest hash for a username
26: *
27: * This must be the A1 part of the digest hash
28: *
29: * @param string $username
30: * @return string
31: */
32: public function getDigestHash($username)
33: {
34: // We don't have the A1 hash stored, and we don't have the plaintext
35: // passwords. Workaround?
36: }
37:
38: public function getUserList()
39: {
40: if (!$this->_auth->hasCapability('list')) {
41: return array();
42: }
43:
44: $users = array();
45: foreach ($this->_auth->listUsers() as $user) {
46: $users[] = array('href' => $user);
47: // We could potentially get {DAV:}displayname from the users'
48: // identities, but we should only do that if this method is not
49: // supposed to be called too often.
50: }
51:
52: return $users;
53: }
54:
55: }
56: