mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-05 13:43:00 +00:00
32 lines
609 B
PHP
32 lines
609 B
PHP
<?php
|
|
|
|
class Sabre_DAV_Auth_MockBackend implements Sabre_DAV_Auth_IBackend {
|
|
|
|
protected $currentUser;
|
|
|
|
/**
|
|
* @param Sabre_DAV_Server $server
|
|
* @param string $realm
|
|
* @throws Sabre_DAV_Exception_NotAuthenticated
|
|
*/
|
|
function authenticate(Sabre_DAV_Server $server, $realm) {
|
|
|
|
if ($realm=='failme') throw new Sabre_DAV_Exception_NotAuthenticated('deliberate fail');
|
|
|
|
$this->currentUser = 'admin';
|
|
|
|
}
|
|
|
|
function setCurrentUser($user) {
|
|
|
|
$this->currentUser = $user;
|
|
|
|
}
|
|
|
|
function getCurrentUser() {
|
|
|
|
return $this->currentUser;
|
|
|
|
}
|
|
|
|
}
|