Commit a53e7231 authored by Leigh Stoller's avatar Leigh Stoller

Fix the case where a specific profile is requested in the URL. This page is

dangerously close to a full rewrite.
parent b9c985fd
...@@ -123,10 +123,10 @@ if (isset($profile)) { ...@@ -123,10 +123,10 @@ if (isset($profile)) {
SPITUSERERROR("No published version for profile"); SPITUSERERROR("No published version for profile");
exit(); exit();
} }
$profile = $obj->uuid();
} }
$profile_array[$profile] = $obj->name(); $profile = $obj;
$profilename = $obj->name(); $profile_array[$profile->uuid()] = $profile->name();
$profilename = $profile->name();
} }
else { else {
# #
...@@ -150,9 +150,9 @@ if (isset($profile)) { ...@@ -150,9 +150,9 @@ if (isset($profile)) {
SPITUSERERROR("No permission to use profile: $profile"); SPITUSERERROR("No permission to use profile: $profile");
exit(); exit();
} }
$profile = $obj->uuid(); $profile = $obj;
$profile_array[$profile] = $obj->name(); $profile_array[$profile->uuid()] = $profile->name();
$profilename = $obj->name(); $profilename = $profile->name();
} }
} }
else { else {
...@@ -400,7 +400,8 @@ function SPITFORM($formfields, $newuser, $errors) ...@@ -400,7 +400,8 @@ function SPITFORM($formfields, $newuser, $errors)
# Send the original argument for the initial array stuff above. # Send the original argument for the initial array stuff above.
# Needs more work. # Needs more work.
echo "<input type='hidden' name='profile' value='$profile'>\n"; $thisuuid = $profile->uuid();
echo "<input type='hidden' name='profile' value='$thisuuid'>\n";
} }
if (isset($this_user)) { if (isset($this_user)) {
$spitsshkeystuff(); $spitsshkeystuff();
...@@ -495,7 +496,8 @@ if (!isset($create)) { ...@@ -495,7 +496,8 @@ if (!isset($create)) {
$defaults["username"] = ""; $defaults["username"] = "";
$defaults["email"] = ""; $defaults["email"] = "";
$defaults["sshkey"] = ""; $defaults["sshkey"] = "";
$defaults["profile"] = (isset($profile) ? $profile : $profile_default); $defaults["profile"] = (isset($profile) ?
$profile->uuid() : $profile_default);
$defaults["where"] = $DEFAULT_AGGREGATE; $defaults["where"] = $DEFAULT_AGGREGATE;
# #
......
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