Commit 6c969dc8 authored by Leigh B Stoller's avatar Leigh B Stoller

Allow project/profile parameters in addition to uuid.

parent 614c9abd
......@@ -41,14 +41,20 @@ $isadmin = (ISADMIN() ? 1 : 0);
#
# Verify page arguments.
#
$reqargs = RequiredPageArguments("uuid", PAGEARG_STRING);
$optargs = OptionalPageArguments("source", PAGEARG_BOOLEAN,
$optargs = OptionalPageArguments("uuid", PAGEARG_STRING,
"profile",PAGEARG_STRING,
"project",PAGEARG_PROJECT,
"source", PAGEARG_BOOLEAN,
"rspec", PAGEARG_BOOLEAN);
if (!isset($uuid)) {
SPITUSERERROR("Must provide uuid!");
if (isset($uuid)) {
$profile = Profile::Lookup($uuid);
}
elseif (isset($project) && isset($profile)) {
$profile = Profile::LookupByName($project, $profile);
}
else {
SPITUSERERROR("Must provide a uuid or project/profile name!");
}
$profile = Profile::Lookup($uuid);
if (!$profile) {
SPITUSERERROR("No such profile!");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment