core/source/overwrites/principal_backend.php

125 lines
2.3 KiB
PHP
Raw Normal View History

2025-09-09 12:07:53 +02:00
<?php
2025-09-22 23:17:08 +02:00
/*
davina Calendar data CalDAV conditioner
Copyright (C) 2025 Fenris <fenris@folksprak.org>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
<https://www.gnu.org/licenses/>.
*/
2025-09-09 12:07:53 +02:00
2025-09-16 12:05:35 +02:00
namespace davina\overwrites;
2025-09-09 12:07:53 +02:00
require_once('vendor/autoload.php');
2025-09-21 13:27:37 +02:00
require_once(DIR_LOGIC . '/helpers/list.php');
2025-09-09 12:07:53 +02:00
/**
*/
class class_principle_backend
implements \Sabre\DAVACL\PrincipalBackend\BackendInterface
{
/**
2025-09-21 18:49:03 +02:00
* @var array {map<string, \davina\model\struct_realm>}
2025-09-09 12:07:53 +02:00
*/
2025-09-21 18:49:03 +02:00
private array $realms;
2025-09-21 13:27:37 +02:00
/**
*/
public function __construct(
2025-09-21 18:49:03 +02:00
array $realms
2025-09-21 13:27:37 +02:00
)
2025-09-09 12:07:53 +02:00
{
2025-09-21 18:49:03 +02:00
$this->realms = $realms;
2025-09-21 13:27:37 +02:00
}
/**
*/
public function getPrincipalsByPrefix(
$prefixPath
)
{
2025-09-21 18:49:03 +02:00
return [
[
'uri' => 'principals/-',
'{DAV:}displayname' => 'default',
],
];
2025-09-09 12:07:53 +02:00
}
/**
*/
public function getPrincipalByPath(
$path
)
{
$parts = \explode('/', $path);
$username = $parts[1];
return [
'uri' => $path,
'displayname' => $username,
];
}
/**
*/
public function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch)
{
throw (new \Exception('not implemented: updatePrincipal'));
}
/**
*/
public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof')
{
throw (new \Exception('not implemented: searchPrincipals'));
}
/**
*/
public function findByUri($uri, $principalPrefix)
{
throw (new \Exception('not implemented: findByUri'));
}
/**
*/
public function getGroupMemberSet($principal)
{
throw (new \Exception('not implemented: getGroupMemberSet'));
}
/**
*/
public function getGroupMembership($principal)
{
return [];
}
/**
*/
public function setGroupMemberSet($principal, array $members)
{
throw (new \Exception('not implemented: setGroupMemberSet'));
}
}
?>