-
Notifications
You must be signed in to change notification settings - Fork 9
/
system.php
476 lines (440 loc) · 13.2 KB
/
system.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<?php
// This file is part of the Huygens Remote Manager
// Copyright and license notice: see license.txt
use hrm\Nav;
use hrm\OmeroConnection;
use hrm\System;
use hrm\Util;
require_once dirname(__FILE__) . '/inc/bootstrap.php';
session_start();
if (isset($_GET['home'])) {
header("Location: " . "home.php");
exit();
}
if (!isset($_SESSION['user']) || !$_SESSION['user']->isLoggedIn() || !$_SESSION['user']->isAdmin()) {
header("Location: " . "login.php");
exit();
}
if (isset($_SERVER['HTTP_REFERER'])) {
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
}
$message = "";
// Javascript includes
$script = array("ajax_utils.js", "json-rpc-client.js");
include("header.inc.php");
?>
<div id="nav">
<div id="navleft">
<ul>
<?php
echo(Nav::linkWikiPage('HuygensRemoteManagerHelpSystemSummary'));
?>
</ul>
</div>
<div id="navright">
<ul>
<?php
echo(Nav::textUser($_SESSION['user']->name()));
echo(Nav::linkHome(Util::getThisPageName()));
?>
</ul>
</div>
<div class="clear"></div>
</div>
<div id="content">
<h3><img alt="Summary" src="./images/system_title.png" width="40"/> System
summary</h3>
<div id="system">
<?php
// Check if we have the latest HRM version
$latestVersion = System::getLatestHRMVersionFromRemoteAsInteger();
if ($latestVersion != -1 &&
System::getHRMVersionAsInteger() < $latestVersion
) {
?>
<p class="updateNotification">
<a href="javascript:openWindow(
'http://huygens-rm.org/home/?q=node/4')">
<img src="images/check_for_update.png" alt="Version check"/>
 
A newer version of HRM
<?php
echo "(" . System::getHRMVersionAsString($latestVersion) . ")";
?>
is available!</a></p>
<?php
} else {
?>
<p class="noUpdateNotification">
<img src="images/check_for_update.png" alt="Version check"/>  
Congratulations, you are running the latest version of HRM!</p>
<?php
}
?>
<table>
<tr>
<td class="section">
Huygens Remote Manager
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
HRM version
</td>
<td class="value">
<?php echo System::getHRMVersionAsString(); ?>
</td>
</tr>
<tr>
<td class="key">
HRM required database version
</td>
<td class="value">
<?php echo System::getDBLastRevision(); ?>
</td>
</tr>
<tr>
<td class="key">
HRM current database version
</td>
<td class="value">
<?php echo System::getDBCurrentRevision(); ?>
</td>
</tr>
<tr>
<td class="key">
HuCore minimum required version
</td>
<td class="value">
<?php echo System::getMinHuCoreVersionAsString(); ?>
</td>
</tr>
<tr>
<td class="key">
HuCore current version
</td>
<td class="value">
<?php echo System::getHucoreVersionAsString(); ?>
</td>
</tr>
<tr>
<td class="key">
HuCore server type
</td>
<td class="value">
<?php echo System::getHucoreServerType(); ?>
</td>
</tr>
<tr>
<td class="section">
Licenses in use
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
<a href="licenses.php">
<img src="images/note.png" alt="License details"/>
Detailed license information</a>
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
HuCore license file
</td>
<td class="value">
<?php
if (System::hucoreHasValidLicense()) {
echo "valid";
} else {
echo "missing or invalid";
}
?>
</td>
</tr>
<?php
if ($omero_transfers) {
?>
<tr>
<td class="section">
HRM-OMERO Connector
</td>
<td class="value">
</td>
<tr>
<td class="key">
Version
</td>
<td class="value">
<?php echo OmeroConnection::getConnectorVersion(); ?>
</td>
</tr>
<?php
}
?>
<tr>
<td class="section">
System
</td>
<td class="value">
</td>
<tr>
<td class="key">
Operating system
</td>
<td class="value">
<?php echo System::getOperatingSystem(); ?>
</td>
</tr>
<tr>
<td class="key">
Kernel release
</td>
<td class="value">
<?php echo System::getKernelRelease(); ?>
</td>
</tr>
<tr>
<td class="section">
LAMP versions
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
Apache version
</td>
<td class="value">
<?php echo System::getApacheVersion(); ?>
</td>
</tr>
<tr>
<td class="key">
Database type and version
</td>
<td class="value">
<?php echo System::getDatabaseType() . ' ' .
System::getDatabaseVersion(); ?>
</td>
</tr>
<tr>
<td class="key">
PHP (Apache mod) version
</td>
<td class="value">
<?php echo System::getPHPVersion(); ?>
</td>
</tr>
<tr>
<td class="section">
Configuration
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
<a href="#" id="sendMail">
<img src="images/note.png" alt="Send"/>
Send test e-mail to HRM admin
</a>
</td>
<td class="value" id="sendMailStatus">
</td>
</tr>
<tr>
<td class="key"
>Memory limit
</td>
<td class="value">
<?php echo System::getMemoryLimit(); ?>
</td>
</tr>
<tr>
<td class="key">
Max execution time
</td>
<td class="value">
<?php echo System::getMaxExecutionTimeFromIni(); ?>
</td>
</tr>
<tr>
<td class="key">
File downloads
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="subkey">
HRM configuration
</td>
<td class="value">
<?php echo System::isDownloadEnabledFromConfig(); ?>
</td>
</tr>
<tr>
<td class="key">
Maximum post size
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="subkey">
php.ini
</td>
<td class="value">
<?php echo System::getPostMaxSizeFromIni(); ?>
</td>
</tr>
<tr>
<td class="subkey">
HRM configuration
</td>
<td class="value">
<?php echo System::getPostMaxSizeFromConfig(); ?>
</td>
</tr>
<tr>
<td class="subkey">
in use
</td>
<td class="value">
<?php echo System::getPostMaxSize(); ?>
</td>
</tr>
<tr>
<td class="key"
>File uploads
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="subkey">
php.ini
</td>
<td class="value">
<?php echo System::isUploadEnabledFromIni(); ?>
</td>
</tr>
<tr>
<td class="subkey">
HRM configuration
</td>
<td class="value">
<?php echo System::isUploadEnabledFromConfig(); ?>
</td>
</tr>
<tr>
<td class="subkey">in use
</td>
<td class="value">
<?php echo System::isUploadEnabled(); ?>
</td>
</tr>
<tr>
<td class="key">
Maximum upload file size
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="subkey">
php.ini
</td>
<td class="value">
<?php echo System::isUploadMaxFileSizeFromIni(); ?>
</td>
</tr>
<tr>
<td class="subkey">
HRM configuration
</td>
<td class="value">
<?php echo System::isUploadMaxFileSizeFromConfig(); ?>
</td>
</tr>
<tr>
<td class="subkey">in use
</td>
<td class="value">
<?php echo System::getUploadMaxFileSize(); ?>
</td>
</tr>
<tr>
<td class="section">
Extended PHP configuration
</td>
<td class="value">
</td>
</tr>
<tr>
<td class="key">
<a href="./phpinfo.php">
<img src="images/note.png" alt="PHP info"/>
Display PHP info
</a>
</td>
<td class="value">
</td>
</tr>
</table>
</div> <!-- system -->
</div> <!-- content -->
<div id="rightpanel">
<div id="info">
<h3>Quick help</h3>
<p>This page displays information about your installation
and server.</p>
<p>Click on <b>Display PHP info</b> at the bottom of the
table to get more extended information on your
installation.</p>
</div>
<div id="message">
<?php
echo "<p>$message</p>";
?>
</div>
</div> <!-- rightpanel -->
<?php
include("footer.inc.php");
?>
<!-- Activate Ajax functions to send a test email to the HRM administrator -->
<script type="text/javascript">
$(document).ready($('#sendMail').click(function () {
JSONRPCRequest({
method: 'jsonSendTestEmail',
params: []
}, function (response) {
if ("message" in response) {
$('#sendMailStatus').html("<b>" + response['message'] + "</b>");
} else {
// In case of a timeout
$('#sendMailStatus').html("<b>Interrupted!</b>");
}
});
}));
</script>