Skip to content
GitLab
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
b554bda9
Commit
b554bda9
authored
Feb 09, 2017
by
Leigh B Stoller
Browse files
Forgot about guest users in previous commit for duration.
parent
34179821
Changes
2
Hide whitespace changes
Inline
Side-by-side
apt/create_instance.in
View file @
b554bda9
...
...
@@ -253,7 +253,7 @@ fatal($@)
#
# Make sure all the required arguments were provided.
#
foreach
my
$key
("
username
",
"
email
",
"
profile
",
"
portal
"
,
"
duration
"
)
{
foreach
my
$key
("
username
",
"
email
",
"
profile
",
"
portal
")
{
fatal
("
Missing required attribute '
$key
'
")
if
(
!
(
exists
(
$xmlparse
->
{'
attribute
'}
->
{"
$key
"})
&&
defined
(
$xmlparse
->
{'
attribute
'}
->
{"
$key
"})
&&
...
...
@@ -271,13 +271,20 @@ my ($value, $user_urn, $user_uid, $user_hrn, $user_email, $project, $pid,
$portal
=
$xmlparse
->
{'
attribute
'}
->
{"
portal
"}
->
{'
value
'};
# User specified duration.
$duration
=
$xmlparse
->
{'
attribute
'}
->
{"
duration
"}
->
{'
value
'};
if
(
$duration
!~
/^\d+$/
)
{
fatal
("
Duration is not an integer
");
if
(
exists
(
$xmlparse
->
{'
attribute
'}
->
{"
duration
"})
&&
defined
(
$xmlparse
->
{'
attribute
'}
->
{"
duration
"})
&&
$xmlparse
->
{'
attribute
'}
->
{"
duration
"}
->
{'
value
'}
ne
"")
{
$duration
=
$xmlparse
->
{'
attribute
'}
->
{"
duration
"}
->
{'
value
'};
if
(
$duration
!~
/^\d+$/
)
{
fatal
("
Duration is not an integer
");
}
if
(
$duration
<
1
||
$duration
>
$maxduration
)
{
UserError
("
Duration must be at least 1 hour but
"
.
"
not more then
$maxduration
hour(s)
");
}
}
if
(
$duration
<
1
||
$duration
>
$maxduration
)
{
UserError
("
Duration must be at least 1 hour but
"
.
"
not more then
$maxduration
hour(s)
");
else
{
$duration
=
$maxduration
;
}
#
...
...
www/aptui/instantiate.ajax
View file @
b554bda9
...
...
@@ -907,7 +907,9 @@ function Do_Submit()
$args
[
"auth_token"
]
=
$_SESSION
[
"auth_token"
];
}
}
$args
[
"duration"
]
=
$formfields
[
"duration"
];
if
(
$this_user
)
{
$args
[
"duration"
]
=
$formfields
[
"duration"
];
}
if
(
0
)
{
TBERROR
(
print_r
(
$args
,
true
),
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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