-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdatepref.php
More file actions
58 lines (49 loc) · 1.43 KB
/
updatepref.php
File metadata and controls
58 lines (49 loc) · 1.43 KB
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
<?php
function setifpost($ix) {
if (isset($_POST[$ix]))
$_SESSION[$ix] = $_POST[$ix];
else
$_SESSION[$ix] = 'off';
}
if (!session_id())
session_start();
setifpost('showverse');
setifpost('showchap');
setifpost('showh2');
setifpost('showfna');
setifpost('showfn1');
setifpost('showfnblock');
setifpost('oneline');
setifpost('linespace');
setifpost('exegetic');
setifpost('indent_type');
setifpost('include_orig_lang');
setifpost('markadded');
setifpost('font');
setifpost('fontsize');
if (isset($_POST['godsname'])) {
switch ($_POST['godsname']) {
case 'Herren':
case 'HERREN':
case 'Jahve':
case 'JHVH':
$_SESSION['godsname'] = $_POST['godsname'];
break;
default:
$_SESSION['godsname'] = 'HERREN';
break;
}
}
if (isset($_POST['usecookie'])) {
if ($_SERVER['HTTP_HOST']==='localhost') { // We are testing
$host = 'localhost';
$use_https = false;
}
else { // Production system
$host = 'denfriebibel.dk';
$use_https = true;
}
foreach (['showverse', 'showchap', 'showh2', 'showfna', 'showfn1', 'showfnblock', 'oneline', 'linespace', 'exegetic', 'indent_type', 'include_orig_lang', 'markadded', 'godsname', 'font','fontsize'] as $key)
setcookie($key, $_SESSION[$key], time()+60*60*24*365*2 /* 2 years */, '/', $host, $use_https, true);
}
header('location: ' . $_POST['referer']);