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-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
c66b3b9e
Commit
c66b3b9e
authored
Jan 12, 2015
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused function, was moved to another file.
parent
f131e866
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
74 deletions
+1
-74
www/aptui/manage_profile.ajax
www/aptui/manage_profile.ajax
+1
-74
No files found.
www/aptui/manage_profile.ajax
View file @
c66b3b9e
<?php
#
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -281,79 +281,6 @@ function Do_GuestInstantiate()
'quickvm_authkey'
=>
$creator
->
auth_token
()));
}
#
# Instantiate profile.
#
function
Do_Instantiate
()
{
global
$this_user
,
$am_array
,
$DEFAULT_AGGREGATE
,
$ISCLOUD
;
global
$ajax_args
;
if
(
!
isset
(
$ajax_args
[
"uuid"
]))
{
SPITAJAX_ERROR
(
1
,
"Missing profile uuid"
);
return
;
}
$profile
=
Profile
::
Lookup
(
$ajax_args
[
"uuid"
]);
if
(
!
$profile
)
{
SPITAJAX_ERROR
(
1
,
"Unknown profile uuid"
);
return
;
}
if
(
!
isset
(
$this_user
))
{
if
(
!
$profile
->
ispublic
())
{
SPITAJAX_ERROR
(
1
,
"Not enough permission to instantiate profile"
);
return
;
}
}
elseif
(
!
$profile
->
CanInstantiate
(
$this_user
))
{
SPITAJAX_ERROR
(
1
,
"Not enough permission to instantiate profile"
);
return
;
}
$args
=
array
();
$args
[
"username"
]
=
$this_user
->
uid
();
$args
[
"email"
]
=
$this_user
->
email
();
$args
[
"profile"
]
=
$profile
->
uuid
();
# Guest users not allowed to provide rspec
if
(
isset
(
$this_user
)
&&
array_key_exists
(
"rspec"
,
$ajax_args
))
{
$args
[
"rspec"
]
=
$ajax_args
[
"rspec"
];
}
$opts
=
""
;
# Guest users not allowed to choose aggregate.
if
(
isset
(
$this_user
)
&&
(
$ISCLOUD
||
ISADMIN
()
||
STUDLY
())
&&
isset
(
$ajax_args
[
"where"
]))
{
if
(
array_key_exists
(
$ajax_args
[
"where"
],
$am_array
))
{
$opts
=
"-a "
.
$am_array
[
$ajax_args
[
"where"
]];
}
else
{
SPITAJAX_ERROR
(
1
,
"Invalid Aggregate"
);
return
;
}
}
else
{
# Temporary until constraint system in place.
$best
=
$profile
->
BestAggregate
();
if
(
!
$best
)
{
$best
=
$DEFAULT_AGGREGATE
;
}
$opts
=
"-a "
.
$am_array
[
$best
];
}
#
# Invoke the backend.
#
$errors
=
array
();
list
(
$instance
,
$creator
)
=
Instance
::
Instantiate
(
$this_user
,
$opts
,
$args
,
$errors
);
if
(
!
isset
(
$instance
)
||
is_null
(
$instance
))
{
SPITAJAX_ERROR
(
1
,
$errors
[
"error"
]);
}
#
# Redirect user to status page.
#
$uuid
=
$instance
->
uuid
();
SPITAJAX_RESPONSE
(
"status.php?uuid=
$uuid
"
);
}
#
# Run a geni-lib script, returning the XML.
#
...
...
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