ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractBasic.php
Go to the documentation of this file.
1<?php
2
4
5use Sabre\DAV;
6use Sabre\HTTP;
9
22abstract class AbstractBasic implements BackendInterface {
23
32 protected $realm = 'sabre/dav';
33
39 protected $principalPrefix = 'principals/';
40
51 abstract protected function validateUserPass($username, $password);
52
59 function setRealm($realm) {
60
61 $this->realm = $realm;
62
63 }
64
94
96 $this->realm,
99 );
100
101 $userpass = $auth->getCredentials();
102 if (!$userpass) {
103 return [false, "No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured"];
104 }
105 if (!$this->validateUserPass($userpass[0], $userpass[1])) {
106 return [false, "Username or password was incorrect"];
107 }
108 return [true, $this->principalPrefix . $userpass[0]];
109
110 }
111
134
136 $this->realm,
137 $request,
139 );
140 $auth->requireLogin();
141
142 }
143
144}
foreach($paths as $path) $request
Definition: asyncclient.php:32
An exception for terminatinating execution or to throw for unit testing.
HTTP Basic authentication backend class.
challenge(RequestInterface $request, ResponseInterface $response)
This method is called when a user could not be authenticated, and authentication was required for the...
check(RequestInterface $request, ResponseInterface $response)
When this method is called, the backend must check if authentication was successful.
setRealm($realm)
Sets the authentication realm for this backend.
validateUserPass($username, $password)
Validates a username and password.
HTTP Basic authentication utility.
Definition: Basic.php:18
$password
Definition: cron.php:14
$auth
Definition: fileserver.php:48
This is the base class for any authentication object.
The RequestInterface represents a HTTP request.
This interface represents a HTTP response.
$response