예제 #1
0
파일: legacydavacl.php 프로젝트: gvde/core
 /**
  * Converts the v1 principal `principal/<username>` to the new v2
  * `principal/users/<username>` which is required for permission checks
  *
  * @inheritdoc
  */
 function getCurrentUserPrincipal()
 {
     $principalV1 = parent::getCurrentUserPrincipal();
     if (is_null($principalV1)) {
         return $principalV1;
     }
     return $this->convertPrincipal($principalV1, true);
 }
예제 #2
0
 function propFind(PropFind $propFind, INode $node)
 {
     /* Overload current-user-principal */
     $propFind->handle('{DAV:}current-user-principal', function () {
         if ($url = parent::getCurrentUserPrincipal()) {
             return new Principal(Principal::HREF, $url . '/');
         } else {
             return new Principal(Principal::UNAUTHENTICATED);
         }
     });
     parent::propFind($propFind, $node);
 }