PHP-Error behoben wenn versucht wird Suchanfragen über Caldav Schnittstelle

auszuführen
This commit is contained in:
Andreas Österreicher
2018-09-14 15:54:18 +02:00
parent 1cea25a6f3
commit c32f9b6b5a
+46 -46
View File
@@ -3,40 +3,40 @@
/** /**
* PDO principal backend * PDO principal backend
* *
* This is a simple principal backend that maps exactly to the users table, as * This is a simple principal backend that maps exactly to the users table, as
* used by Sabre_DAV_Auth_Backend_PDO. * used by Sabre_DAV_Auth_Backend_PDO.
* *
* It assumes all principals are in a single collection. The default collection * It assumes all principals are in a single collection. The default collection
* is 'principals/', but this can be overriden. * is 'principals/', but this can be overriden.
* *
* @package Sabre * @package Sabre
* @subpackage DAVACL * @subpackage DAVACL
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved. * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/) * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/ */
class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\BackendInterface class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\BackendInterface
{ {
/** /**
* PDO table name for 'principals' * PDO table name for 'principals'
* *
* @var string * @var string
*/ */
protected $tableName; protected $tableName;
/** /**
* PDO table name for 'group members' * PDO table name for 'group members'
* *
* @var string * @var string
*/ */
protected $groupMembersTableName; protected $groupMembersTableName;
protected $result_ma; protected $result_ma;
/** /**
* Sets up the backend. * Sets up the backend.
* *
* @param PDO $pdo * @param PDO $pdo
* @param string $tableName * @param string $tableName
*/ */
public function __construct($auth) public function __construct($auth)
{ {
@@ -46,7 +46,7 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
$ma = new mitarbeiter(); $ma = new mitarbeiter();
$this->result_ma = $ma->getMitarbeiter(null,null,null); $this->result_ma = $ma->getMitarbeiter(null,null,null);
*/ */
} }
/** /**
* Liefert den eingeloggten User * Liefert den eingeloggten User
@@ -60,20 +60,20 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
/** /**
* Returns a list of principals based on a prefix. * Returns a list of principals based on a prefix.
* *
* This prefix will often contain something like 'principals'. You are only * This prefix will often contain something like 'principals'. You are only
* expected to return principals that are in this base path. * expected to return principals that are in this base path.
* *
* You are expected to return at least a 'uri' for every user, you can * You are expected to return at least a 'uri' for every user, you can
* return any additional properties if you wish so. Common properties are: * return any additional properties if you wish so. Common properties are:
* {DAV:}displayname * {DAV:}displayname
* {http://sabredav.org/ns}email-address - This is a custom SabreDAV * {http://sabredav.org/ns}email-address - This is a custom SabreDAV
* field that's actualy injected in a number of other properties. If * field that's actualy injected in a number of other properties. If
* you have an email address, use this property. * you have an email address, use this property.
* *
* @param string $prefixPath * @param string $prefixPath
* @return array * @return array
*/ */
public function getPrincipalsByPrefix($prefixPath) public function getPrincipalsByPrefix($prefixPath)
{ {
//$prefixPath = principals //$prefixPath = principals
//error_log('Principal.php/getPrincipalsByPrefix('.$prefixPath.')'); //error_log('Principal.php/getPrincipalsByPrefix('.$prefixPath.')');
@@ -82,7 +82,7 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
if($prefixPath=='principals') if($prefixPath=='principals')
{ {
$principals[] = array( $principals[] = array(
'id' => $user, 'id' => $user,
'uri' => 'principals/'.$user, 'uri' => 'principals/'.$user,
@@ -118,7 +118,7 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
'{DAV:}displayname' => '', '{DAV:}displayname' => '',
'{http://sabredav.org/ns}email-address' => '', '{http://sabredav.org/ns}email-address' => '',
); );
}*/ }*/
} }
else //if($prefixPath=='principals/oesi') else //if($prefixPath=='principals/oesi')
@@ -138,13 +138,13 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
/** /**
* Returns a specific principal, specified by it's path. * Returns a specific principal, specified by it's path.
* The returned structure should be the exact same as from * The returned structure should be the exact same as from
* getPrincipalsByPrefix. * getPrincipalsByPrefix.
* *
* @param string $path * @param string $path
* @return array * @return array
*/ */
public function getPrincipalByPath($path) public function getPrincipalByPath($path)
{ {
//$path = principals/oesi //$path = principals/oesi
//error_log('Principal.php/getPrincipalByPath('.$path.')'); //error_log('Principal.php/getPrincipalByPath('.$path.')');
@@ -164,26 +164,26 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
} }
/** /**
* Returns the list of members for a group-principal * Returns the list of members for a group-principal
* *
* @param string $principal * @param string $principal
* @return array * @return array
*/ */
public function getGroupMemberSet($principal) public function getGroupMemberSet($principal)
{ {
//error_log('Principal.php/getGroupMemberSet('.$principal.')'); //error_log('Principal.php/getGroupMemberSet('.$principal.')');
$result = array(); $result = array();
return $result; return $result;
} }
/** /**
* Returns the list of groups a principal is a member of * Returns the list of groups a principal is a member of
* *
* @param string $principal * @param string $principal
* @return array * @return array
*/ */
public function getGroupMembership($principal) public function getGroupMembership($principal)
{ {
//$principal = username //$principal = username
// error_log('Principal.php/getGroupMembership('.$principal.')'); // error_log('Principal.php/getGroupMembership('.$principal.')');
@@ -215,17 +215,17 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
/** /**
* Updates the list of group members for a group principal. * Updates the list of group members for a group principal.
* *
* The principals should be passed as a list of uri's. * The principals should be passed as a list of uri's.
* *
* @param string $principal * @param string $principal
* @param array $members * @param array $members
* @return void * @return void
*/ */
public function setGroupMemberSet($principal, array $members) public function setGroupMemberSet($principal, array $members)
{ {
throw new \Sabre\DAV\Exception('Not implemented'); throw new \Sabre\DAV\Exception('Not implemented');
} }
public function updatePrincipal($path, $mutations) public function updatePrincipal($path, $mutations)
{ {
throw new \Sabre\DAV\Exception('Not implemented'); throw new \Sabre\DAV\Exception('Not implemented');
@@ -233,6 +233,6 @@ class MySabre_DAVACL_PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\
public function searchPrincipals($prefixPath,array $searchProperties) public function searchPrincipals($prefixPath,array $searchProperties)
{ {
throw new \Sabre\DAV\Exceptin('Not implemented'); throw new \Sabre\DAV\Exception('Not implemented');
} }
} }