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
e46966b3
Commit
e46966b3
authored
Aug 08, 2003
by
Mac Newbold
Browse files
Show old and new swap settings in the email we send when values change.
parent
7db97feb
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/showexp.php3
View file @
e46966b3
...
...
@@ -219,11 +219,6 @@ if ($submit) {
$errors
[
'Max Duration'
]
=
"Time must be non-zero"
;
}
}
if
(
count
(
$strs
)
>
0
)
{
$str
=
implode
(
","
,
$strs
);
DBQueryWarn
(
"update experiments set
$str
"
.
"where pid='
$pid
' and eid='
$eid
'"
);
}
if
(
$errors
)
{
echo
"<table class=nogrid
align=center border=0 cellpadding=6 cellspacing=0>
...
...
@@ -246,6 +241,23 @@ if ($submit) {
echo
"</table><br>
\n
"
;
# Jump back into edit mode
$edit
=
1
;
$mail
=
0
;
}
else
{
$q
=
DBQueryFatal
(
"select * from experiments "
.
"where pid='
$pid
' and eid='
$eid
'"
);
$r
=
mysql_fetch_array
(
$q
);
$olds
=
(
$r
[
swappable
]
?
"Yes"
:
"No"
);
$oldsr
=
$r
[
noswap_reason
];
$oldi
=
(
$r
[
idleswap
]
?
"Yes"
:
"No"
);
$oldit
=
$r
[
idleswap_timeout
]
/
60.0
;
$oldir
=
$r
[
noidleswap_reason
];
$olda
=
(
$r
[
autoswap
]
?
"Yes"
:
"No"
);
$oldat
=
$r
[
autoswap_timeout
]
/
60.0
;
if
(
count
(
$strs
)
>
0
)
{
$str
=
implode
(
","
,
$strs
);
DBQueryWarn
(
"update experiments set
$str
"
.
"where pid='
$pid
' and eid='
$eid
'"
);
}
}
if
(
$mail
)
{
$q
=
DBQueryFatal
(
"select * from experiments "
.
...
...
@@ -271,10 +283,14 @@ if ($submit) {
TBMAIL
(
$TBMAIL_OPS
,
"
$pid
/
$eid
swap settings changed"
,
"
\n
The swap settings for
$pid
/
$eid
have changed.
\n
"
.
"
\n
The reasons and/or timeouts have changed.
\n
"
.
"
\n
The old settings were:
\n
"
.
#"Swappable:\t$olds\t($oldsr)\n".
"Idleswap:
\t
$oldi
\t
(after
$oldit
hrs)
\t
(
$oldir
)
\n
"
.
"MaxDuration:
\t
$olda
\t
(after
$oldat
hrs)
\n
"
.
"
\n
The new settings are:
\n
"
.
#"Swappable:\t$s\t($sr)\n".
"Idleswap:
\t
$i
\t
(after
$it
hrs)
\t
(
$ir
)
\n
"
.
"
Autoswap
:
\t
$a
\t
(after
$at
hrs)
\n
"
.
"
MaxDuration
:
\t
$a
\t
(after
$at
hrs)
\n
"
.
"
\n
Creator:
\t
$cuid
(
$cname
<
$cemail
>)
\n
"
.
"Swapper:
\t
$suid
(
$sname
<
$semail
>)
\n
"
.
"
\n
If it is necessary to change these settings, "
.
...
...
www/toggle.php
View file @
e46966b3
...
...
@@ -98,16 +98,24 @@ elseif ($type=="swappable" || $type=="idleswap" || $type=="autoswap") {
$ir
=
$r
[
noidleswap_reason
];
$a
=
(
$r
[
autoswap
]
?
"Yes"
:
"No"
);
$at
=
$r
[
autoswap_timeout
]
/
60.0
;
$olds
=
(
$type
==
"swappable"
?
"Yes"
:
$s
);
$oldi
=
(
$type
==
"idleswap"
?
"Yes"
:
$i
);
$olda
=
(
$type
==
"autoswap"
?
"Yes"
:
$a
);
TBUserInfo
(
$uid
,
$user_name
,
$user_email
);
TBUserInfo
(
$cuid
,
$cname
,
$cemail
);
TBUserInfo
(
$suid
,
$sname
,
$semail
);
TBMAIL
(
$TBMAIL_OPS
,
"
$pid
/
$eid
swap settings changed"
,
"
\n
The swap settings for
$pid
/
$eid
have changed.
\n
"
.
"
\n
The
$type
bit has been cleared.
\n
"
.
"
\n
The old settings were:
\n
"
.
#"Swappable:\t$olds\t('$sr')\n".
"Idleswap:
\t
$oldi
\t
(after
$it
hrs)
\t
('
$ir
')
\n
"
.
"MaxDuration:
\t
$olda
\t
(after
$at
hrs)
\n
"
.
"
\n
The new settings are:
\n
"
.
#"Swappable:\t$s\t('$sr')\n".
"Idleswap:
\t
$i
\t
(after
$it
hrs)
\t
('
$ir
')
\n
"
.
"
Autoswap
:
\t
$a
\t
(after
$at
hrs)
\n
"
.
"
MaxDuration
:
\t
$a
\t
(after
$at
hrs)
\n
"
.
"
\n
Creator:
\t
$cuid
(
$cname
<
$cemail
>)
\n
"
.
"Swapper:
\t
$suid
(
$sname
<
$semail
>)
\n
"
.
"
\n
If it is necessary to change these settings, "
.
...
...
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