forked from elabftw/elabftw
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.php
71 lines (52 loc) · 1.64 KB
/
test.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
<?php
/**
* index.php
*
* @author Nicolas CARPi <[email protected]>
* @copyright 2012 Nicolas CARPi
* @see http://www.elabftw.net Official website
* @license AGPL-3.0
* @package elabftw
*/
/**
* Index page
*
*/
use \Elabftw\Elabftw\Tools as Tools;
require_once 'inc/common.php';
$page_title = _('Home');
$selected_menu = null;
// Check if already logged in
if (isset($_SESSION['auth']) && $_SESSION['auth'] === 1) {
}
require_once 'inc/head.php';
$formKey = new \Elabftw\Elabftw\FormKey();
// if we are not in https, die saying we work only in https
if (!Tools::usingSsl()) {
// get the url to display a link to click (without the port)
$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
$message = "eLabFTW works only in HTTPS. Please enable HTTPS on your server. Or click this link : <a href='$url'>$url</a>";
display_message('error', $message);
require_once 'inc/footer.php';
exit;
}
?>
<section class='center'>
<h2><?php echo _('OpenSauce = Open Source Chemistry'); ?></h2>
</section>
<script>
// Check for cookies
function checkCookiesEnabled() {
var cookieEnabled = (navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
document.cookie="testcookie";
cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
}
return (cookieEnabled);
}
if (!checkCookiesEnabled()) {
var cookie_alert = "<div class='errorbox messagebox<p><?php echo _('Please enable cookies in your navigator to continue.'); ?></p></div>";
document.write(cookie_alert);
}
</script>
<?php require_once 'inc/footer.php';