forked from aarpon/hrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
select_hpc_popup.php
107 lines (77 loc) · 2.69 KB
/
select_hpc_popup.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
// This file is part of the Huygens Remote Manager
// Copyright and license notice: see license.txt
use hrm\Fileserver;
require_once dirname(__FILE__) . '/inc/bootstrap.php';
session_start();
if (!isset($_SESSION['user']) || !$_SESSION['user']->isLoggedIn()) {
header("Location: " . "login.php");
exit();
}
// fileserver related code
if (!isset($_SESSION['fileserver'])) {
$name = $_SESSION['user']->name();
$_SESSION['fileserver'] = new Fileserver($name);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Huygens Remote Manager</title>
<!-- Include jQuery -->
<script type="text/javascript" src="scripts/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
<!--
function lock(l) {
var hpc = l.options[l.options.selectedIndex].value;
window.opener.document.forms["select"].elements["hpc"].value = hpc;
window.opener.document.forms["select"].elements["hpc"].style.color = "black";
}
//-->
</script>
<!-- Theming support -->
<script type="text/javascript" src="scripts/theming.js"></script>
<!-- Main stylesheets -->
<link rel="stylesheet" type="text/css" href="css/fonts.css?v=3.7">
<link rel="stylesheet" type="text/css" href="css/default.css?v=3.7">
<!-- Themes -->
<link rel="stylesheet" type="text/css" href="css/themes/dark.css?v=3.7" title="dark">
<link rel="alternate stylesheet" type="text/css" href="css/themes/light.css?v=3.7" title="light">
</head>
<body>
<div>
<form method="get" action="">
<fieldset>
<legend>Available files</legend>
<?php
$files = $_SESSION['fileserver']->listFiles(true);
?>
<div id="userfiles">
<select name="userfiles[]"
title="Available files"
class="selection"
size="10"
onchange="lock(this)">
<?php
foreach ($files as $file) {
$style = "";
print " <option value=\"$file\" $style>$file </option>\n";
}
?>
</select>
</div>
</fieldset>
<div>
<input name="update"
type="submit"
value=""
class="icon update"/>
</div>
<div>
<input type="button" value="close" onclick="window.close()"/>
</div>
</form>
</div>
</body>
</html>