Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1720917
principalBackendDokuwiki.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
principalBackendDokuwiki.php
View Options
<?php
/**
* Principal backend for DokuWiki - some functions are not implemented, as they
* are currently not needed. Only the bare minimum is present.
*/
class
DokuWikiSabrePrincipalBackend
extends
Sabre\DAVACL\PrincipalBackend\AbstractBackend
{
public
function
getPrincipalsByPrefix
(
$prefixPath
)
{
global
$auth
;
$users
=
$auth
->
retrieveUsers
();
$principals
=
array
();
foreach
(
$users
as
$user
=>
$info
)
{
$principal
=
'principals/'
.
$user
;
if
(
strpos
(
$principal
,
$prefixPath
)
===
0
)
$data
=
$this
->
getPrincipalByPath
(
$user
);
if
(!
empty
(
$data
))
$principals
[]
=
$data
;
}
return
$principals
;
}
public
function
getPrincipalByPath
(
$path
)
{
global
$auth
;
$user
=
str_replace
(
'principals/'
,
''
,
$path
);
$userData
=
$auth
->
getUserData
(
$user
);
if
(
$userData
===
false
)
return
array
();
return
array
(
'uri'
=>
'principals/'
.
$user
,
'email'
=>
$userData
[
'mail'
],
'displayname'
=>
$userData
[
'name'
],
'id'
=>
0
);
}
public
function
updatePrincipal
(
$path
,
\Sabre\DAV\PropPatch
$propPatch
)
{
}
public
function
searchPrincipals
(
$prefixPath
,
array
$searchProperties
,
$test
=
'allof'
)
{
}
public
function
getGroupMemberSet
(
$principal
)
{
return
array
();
}
public
function
getGroupMemberShip
(
$principal
)
{
return
array
();
}
public
function
setGroupMemberSet
(
$principal
,
array
$members
)
{
throw
new
Exception\NotImplemented
(
'Not Implemented'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 23, 10:45 AM (1 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
905068
Default Alt Text
principalBackendDokuwiki.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment