-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetLock.php
More file actions
25 lines (18 loc) · 736 Bytes
/
getLock.php
File metadata and controls
25 lines (18 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
session_start();
require 'defines.php';
require 'lib.php';
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
//check if a lock file exists
if (checkOrgan($_GET['organ'])) {
if (checkFilename($_GET['file']) or $_GET['file'] == "template" or $_GET['file'] == "email" or $_GET['file'] == "resolutions.txt") {
if (checkLock($_SESSION['user'], $_GET['organ'], $_GET['file'])) {
createLock($_SESSION['user'], $_GET['organ'], $_GET['file']);
echo '<response>Get lock file until '. date('H-i', time() + 15 * 60) .' </response>';
} else {
echo "<response>Another user is editing this file</response>";
}
}
}
?>