Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
a0b99dc6
Commit
a0b99dc6
authored
Dec 06, 2017
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes to ensure that short extensions get all the way up to the
maximum extension limit.
parent
a4d2769f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
www/aptui/js/extend.js
www/aptui/js/extend.js
+3
-3
www/aptui/status.ajax
www/aptui/status.ajax
+5
-11
No files found.
www/aptui/js/extend.js
View file @
a0b99dc6
...
...
@@ -429,7 +429,7 @@ window.ShowExtendModal = (function()
// Request as much time as possible, up to the maximum allowed
// by the reservation system. Put up a modal for confirmation.
//
function
RequestMaxExtension
(
hours
)
function
RequestMaxExtension
(
hours
,
actual
)
{
$
(
'
#restricted_extend_modal #hours
'
).
html
(
hours
);
...
...
@@ -449,7 +449,7 @@ window.ShowExtendModal = (function()
"
status
"
,
"
RequestExtension
"
,
{
"
uuid
"
:
uuid
,
"
howlong
"
:
hours
});
"
howlong
"
:
actual
});
xmlthing
.
done
(
requestcallback
);
});
sup
.
ShowModal
(
'
#restricted_extend_modal
'
);
...
...
@@ -546,7 +546,7 @@ window.ShowExtendModal = (function()
}
else
if
(
hours
<
24
)
{
// Different path; request as much as we can get.
RequestMaxExtension
(
hours
);
RequestMaxExtension
(
hours
,
later
);
}
else
{
// Maximum number of days beyond current expiration!
...
...
www/aptui/status.ajax
View file @
a0b99dc6
...
...
@@ -363,22 +363,16 @@ function Do_RequestExtension()
goto
bad
;
}
$wanted
=
$ajax_args
[
"howlong"
];
if
(
!
preg_match
(
"/^\d+$/"
,
$wanted
))
{
if
(
strtotime
(
$wanted
))
{
if
(
!
ISADMIN
())
{
SPITAJAX_ERROR
(
1
,
"Only administrators can use a datetime"
);
if
(
preg_match
(
"/^\d+$/"
,
$wanted
))
{
if
(
$wanted
<
1
)
{
SPITAJAX_ERROR
(
1
,
"Hours must be an integer greater then 1"
);
goto
bad
;
}
}
else
{
elseif
(
!
strtotime
(
$wanted
))
{
SPITAJAX_ERROR
(
1
,
"Invalid characters in hours"
);
goto
bad
;
}
}
else
if
(
$wanted
<
1
)
{
SPITAJAX_ERROR
(
1
,
"Hours must be an integer greater then 1"
);
goto
bad
;
}
if
(
ISADMIN
())
{
if
(
isset
(
$ajax_args
[
"reason"
])
&&
$ajax_args
[
"reason"
]
!=
""
)
{
$reason
=
$ajax_args
[
"reason"
];
...
...
Write
Preview
Markdown
is supported
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