-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.php
More file actions
141 lines (131 loc) · 3.11 KB
/
display.php
File metadata and controls
141 lines (131 loc) · 3.11 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
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
<?php
if (!defined('WC_BASE')) define('WC_BASE', __DIR__);
$ref=WC_BASE."/index.php";
if ($ref!=$_SERVER['SCRIPT_FILENAME']){
header("Location: index.php");
exit();
}
?>
<!-- #################### Start display #################### -->
<tr>
<td width="10"> </td>
<td valign="top">
<?php
if (!isset($_GET['confirmed'])){
?>
<h3>
<?php print _("Display preferences for");?>
<span style="color: red;">
<?php
print $_SESSION['user'];
?>
</span>
</h3>
<?php
if (!$TEMPLATE){
die(_("No template definitions found, please check your config file"));
}
?>
<form action="index.php" method="get">
<input type="hidden" name="action" value="display">
<input type="hidden" name="confirmed" value="true">
<table>
<tr>
<td>
<?php print _("Color scheme");?>
</td>
<td>
<select class="inputfield" size="1" name="style">
<?php
foreach ($TEMPLATE as $temp){
print "<option";
if ($_SESSION['style'] == $temp) {
echo " selected";
}
print " value=\"$temp\">";
print $temp;
print "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<?php print _("Number of domains displayed on page");?>
</td>
<td>
<input
class="inputfield"
type="text"
name="maxdisplay"
size="4"
value="<?php print $_SESSION['maxdisplay'];?>"
>
</td>
</tr>
<tr>
<td>
<?php print _("Number of accounts displayed on page");?>
</td>
<td>
<input
class="inputfield"
type="text"
name="account_maxdisplay"
size="4"
value="<?php print $_SESSION['account_maxdisplay'];?>"
>
</td>
</tr>
<tr>
<td>
<?php print _("Quota usage warn level");?>
</td>
<td>
<input
class="inputfield"
type="text"
name="warnlevel";
size="4"
value="<?php print $_SESSION['warnlevel'];?>"
>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input
class="inputfield"
type="submit"
value="<?php print _("Submit"); ?>"
>
</td>
</tr>
</table>
</form>
<?php
}
else { // if (!isset($_GET['confirmed']))
if ($authorized){
if ($_SESSION['style'] != $_GET['style']) {
print "<center><a class=\"navi\" href=\"index.php?action=settings\">";
print _("Reload page");
print "</a></center>";
}
$_SESSION['style'] = $_GET['style'];
$_SESSION['maxdisplay'] = $_GET['maxdisplay'];
$_SESSION['domain_row_pos'] = 0;
$_SESSION['account_maxdisplay'] = $_GET['account_maxdisplay'];
$_SESSION['account_row_pos'] = 0;
$_SESSION['warnlevel'] = $_GET['warnlevel'];
$query = "UPDATE settings SET style='".$_SESSION['style']."', maxdisplay='".$_SESSION['maxdisplay']."', warnlevel='".$_SESSION['warnlevel']."' WHERE username='".$_SESSION['user']."'";
$handle->query($query);
}
else {
print "<h3>".$err_msg."</h3>";
}
echo "</td></tr>\n";
include WC_BASE . "/settings.php";
}
?>
<!-- #################### End display #################### -->