Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
062bd816
Commit
062bd816
authored
Jun 04, 2003
by
Mac Newbold
Browse files
Make idleswap timeout editable via the web for admins only.
parent
c4475f39
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/showexp.php3
View file @
062bd816
...
...
@@ -165,6 +165,10 @@ if ($submit) {
$str
.
=
",noidleswap_reason=
\"
$noidleswap
\"
"
;
$mail
=
1
;
}
if
(
isset
(
$idleswap
)
&&
$idleswap
!=
""
&&
$idleswap
>
0
&&
ISADMIN
())
{
$str
.
=
",idleswap_timeout=
\"
"
.
(
60
*
$idleswap
)
.
"
\"
"
;
$mail
=
1
;
}
if
(
isset
(
$autoswap
)
&&
$autoswap
!=
""
&&
$autoswap
>
0
)
{
$str
.
=
",autoswap_timeout=
\"
"
.
(
60
*
$autoswap
)
.
"
\"
"
;
$mail
=
1
;
...
...
www/showstuff.php3
View file @
062bd816
...
...
@@ -582,7 +582,6 @@ function SHOWEXP($pid, $eid, $edit=0) {
$autoswap_hrs
=
(
$autoswap_timeout
/
60.0
);
$idleswap_hrs
=
(
$idleswap_timeout
/
60.0
);
$idleswap_str
=
$idleswap_hrs
.
" hour"
.
(
$idleswap_hrs
==
1
?
""
:
"s"
);
if
(
$edit
)
{
# make this a form too
echo
"<form action=
\"
showexp.php3?pid=
$pid
&eid=
$eid
\"
method=POST>
\n
"
;
...
...
@@ -590,13 +589,20 @@ function SHOWEXP($pid, $eid, $edit=0) {
"name=noswap value=
\"
$noswap_reason
\"
size=30>"
;
$noidleswap
=
"Why: <input type=text "
.
"name=noidleswap value=
\"
$noidleswap_reason
\"
size=30>"
;
$autoswap_str
=
"<input type=text size=
2
name=autoswap "
.
$autoswap_str
=
"<input type=text size=
3
name=autoswap "
.
"value=
\"
$autoswap_hrs
\"
> hour"
.
(
$autoswap_hrs
==
1
?
""
:
"s"
);
}
else
{
$noswap
=
"(
\"
$noswap_reason
\"
)"
;
$noidleswap
=
"(
\"
$noidleswap_reason
\"
)"
;
$autoswap_str
=
$autoswap_hrs
.
" hour"
.
(
$autoswap_hrs
==
1
?
""
:
"s"
);
}
if
(
$edit
&&
ISADMIN
()
)
{
# Admins can edit the idleswap time.
$idleswap_str
=
"<input type=text size=3 name=idleswap "
.
"value=
\"
$idleswap_hrs
\"
> hour"
.
(
$idleswap_hrs
==
1
?
""
:
"s"
);
}
else
{
$idleswap_str
=
$idleswap_hrs
.
" hour"
.
(
$idleswap_hrs
==
1
?
""
:
"s"
);
}
if
(
$swappable
)
$swappable
=
"Yes
...
...
@@ -706,9 +712,7 @@ function SHOWEXP($pid, $eid, $edit=0) {
<td class=
\"
left
\"
>
$autoswap
</td>
</tr>
\n
"
;
# XXX: isadmin doesn't use the uid you give it, and we don't have a real
# uid to send here. so just make something up to match the prototype.
if
(
isadmin
(
123
))
{
if
(
ISADMIN
())
{
echo
"<tr>
<td>Idle Ignore:</td>
<td class=
\"
left
\"
>
$idle_ignore
</td>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment