1<?php
2
3/**
4 * DokuWiki WebDAV Plugin: Lock file backend for Sabre DAV
5 *
6 * @copyright Copyright (C) 2019-2020
7 * @author Giuseppe Di Terlizzi (giuseppe.diterlizzi@gmail.com)
8 * @license GNU GPL 2
9 */
10
11namespace dokuwiki\plugin\webdav\core\Backend;
12
13use Sabre\DAV;
14
15class LocksFile extends DAV\Locks\Backend\File
16{
17    /**
18     * Locks a uri
19     *
20     * @param string $uri
21     * @param LockInfo $lockInfo
22     * @return bool
23     */
24    public function lock($uri, DAV\Locks\LockInfo $lockInfo)
25    {
26        $lockInfo->user = @$_SERVER['REMOTE_USER'];
27        $lockInfo->ua   = @$_SERVER['HTTP_USER_AGENT'];
28        return parent::lock($uri, $lockInfo);
29    }
30}
31