1 |
fab7ff44
|
Bill Marquette
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
part of pfSense (http://www.pfsense.org/)
|
5 |
|
|
|
6 |
|
|
Copyright (C) 2007 Bill Marquette <bill.marquette@gmail.com>
|
7 |
|
|
All rights reserved.
|
8 |
|
|
|
9 |
|
|
Redistribution and use in source and binary forms, with or without
|
10 |
|
|
modification, are permitted provided that the following conditions are met:
|
11 |
|
|
|
12 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
13 |
|
|
this list of conditions and the following disclaimer.
|
14 |
|
|
|
15 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
16 |
|
|
notice, this list of conditions and the following disclaimer in the
|
17 |
|
|
documentation and/or other materials provided with the distribution.
|
18 |
|
|
|
19 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
20 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
21 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
22 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
23 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
24 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
25 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
26 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
27 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
29 |
|
|
*/
|
30 |
|
|
require("guiconfig.inc");
|
31 |
|
|
$pconfig['session_timeout'] = &$config['system']['webgui']['session_timeout'];
|
32 |
|
|
|
33 |
|
|
// Page title for main admin
|
34 |
d88c6a9f
|
Scott Ullrich
|
$pgtitle = array("System","User manager settings");
|
35 |
fab7ff44
|
Bill Marquette
|
|
36 |
|
|
if ($_POST) {
|
37 |
|
|
unset($input_errors);
|
38 |
|
|
|
39 |
|
|
/* input validation */
|
40 |
|
|
$reqdfields = explode(" ", "session_timeout");
|
41 |
|
|
$reqdfieldsn = explode(",", "Session Timeout");
|
42 |
|
|
|
43 |
|
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
44 |
|
|
|
45 |
ac09997e
|
Scott Ullrich
|
$timeout = intval($_POST['session_timeout']);
|
46 |
|
|
if ($timeout != "" && !is_numeric($timeout))
|
47 |
|
|
$input_errors[] = gettext("Session timeout must be an integer with value 1 or greater.");
|
48 |
|
|
|
49 |
|
|
if ($timeout < 1)
|
50 |
|
|
$input_errors[] = gettext("Session timeout must be an integer with value 1 or greater.");
|
51 |
|
|
|
52 |
|
|
if ($timeout > 999)
|
53 |
|
|
$input_errors[] = gettext("Session timeout must be an integer with value 1 or greater.");
|
54 |
fab7ff44
|
Bill Marquette
|
|
55 |
|
|
/* if this is an AJAX caller then handle via JSON */
|
56 |
|
|
if (isAjax() && is_array($input_errors)) {
|
57 |
|
|
input_errors2Ajax($input_errors);
|
58 |
|
|
exit;
|
59 |
|
|
}
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
if (!$input_errors) {
|
63 |
|
|
|
64 |
44c31706
|
Scott Ullrich
|
if($_POST['session_timeout'] && $_POST['session_timeout'] != "0")
|
65 |
|
|
$pconfig['session_timeout'] = intval($_POST['session_timeout']);
|
66 |
|
|
else
|
67 |
|
|
unset($config['system']['webgui']['session_timeout']);
|
68 |
|
|
|
69 |
fab7ff44
|
Bill Marquette
|
write_config();
|
70 |
|
|
|
71 |
a18a8bc6
|
Scott Ullrich
|
$retval = system_password_configure();
|
72 |
|
|
sync_webgui_passwords();
|
73 |
|
|
|
74 |
fab7ff44
|
Bill Marquette
|
pfSenseHeader("system_usermanager_settings.php");
|
75 |
|
|
}
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
include("head.inc");
|
79 |
|
|
?>
|
80 |
|
|
|
81 |
|
|
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
|
82 |
|
|
<?php include("fbegin.inc");?>
|
83 |
|
|
<?php if ($input_errors) print_input_errors($input_errors);?>
|
84 |
|
|
<?php if ($savemsg) print_info_box($savemsg);?>
|
85 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
86 |
|
|
<tr>
|
87 |
|
|
<td class="tabnavtbl">
|
88 |
|
|
<?php
|
89 |
|
|
$tab_array = array();
|
90 |
|
|
$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
|
91 |
|
|
$tab_array[] = array(gettext("Group"), false, "system_groupmanager.php");
|
92 |
|
|
$tab_array[] = array(gettext("Settings"), true, "system_usermanager_settings.php");
|
93 |
|
|
display_top_tabs($tab_array);
|
94 |
|
|
?>
|
95 |
|
|
</td>
|
96 |
|
|
<tr>
|
97 |
|
|
<td>
|
98 |
|
|
<div id="mainarea">
|
99 |
|
|
<form id="iform" name="iform" action="system_usermanager_settings.php" method="post">
|
100 |
|
|
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
|
101 |
|
|
<tr>
|
102 |
|
|
<td width="22%" valign="top" class="vncell">Session Timeout</td>
|
103 |
|
|
<td width="78%" class="vtable"> <input name="session_timeout" id="session_timeout" type="text"size="20" class="formfld unknown" value="<?=htmlspecialchars($pconfig['session_timeout']);?>" />
|
104 |
|
|
<br />
|
105 |
|
|
<?=gettext("Time in minutes to expire idle management sessions.");?><br />
|
106 |
|
|
</td>
|
107 |
|
|
</tr>
|
108 |
|
|
|
109 |
|
|
<tr>
|
110 |
|
|
<td width="22%" valign="top"> </td>
|
111 |
|
|
<td width="78%"> <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
|
112 |
|
|
</td>
|
113 |
|
|
</tr>
|
114 |
|
|
</table>
|
115 |
|
|
</form>
|
116 |
|
|
</div>
|
117 |
|
|
</td>
|
118 |
|
|
</tr>
|
119 |
|
|
</table>
|
120 |
|
|
|
121 |
|
|
<?php include("fend.inc");?>
|
122 |
|
|
</body>
|
123 |
|
|
</html>
|