Commit 68cd0f18 authored by Robert Ricci's avatar Robert Ricci
Browse files

Give regular users the ability to toggle their plab bit, and explain

what it means a little more.
parent 364af0c0
...@@ -257,7 +257,6 @@ function SPITFORM($formfields, $errors) ...@@ -257,7 +257,6 @@ function SPITFORM($formfields, $errors)
# #
# Planetlab bit # Planetlab bit
# #
if ($isadmin) {
if ($formfields['plab_user']) { if ($formfields['plab_user']) {
$checked = "checked"; $checked = "checked";
} else { } else {
...@@ -265,13 +264,12 @@ function SPITFORM($formfields, $errors) ...@@ -265,13 +264,12 @@ function SPITFORM($formfields, $errors)
} }
echo "<tr> echo "<tr>
<td colspan=2>PlanetLab User:</td> <td colspan=2>Use simplified PlanetLab view:</td>
<td class=left> <td class=left>
<input type='checkbox' name=\"formfields[plab_user]\" value='1' <input type='checkbox' name=\"formfields[plab_user]\" value='1'
$checked> $checked>
</td> </td>
</tr>\n"; </tr>\n";
}
# #
# Notes # Notes
...@@ -605,17 +603,12 @@ if ($isadmin && ...@@ -605,17 +603,12 @@ if ($isadmin &&
} }
# #
# Only admins can change the plab_user bit. # Change the plab bit to a simple 1 or 0
# #
if ($isadmin && ($defaults[plab_user] != $formfields[plab_user])) { if ($formfields[plab_user]) {
if ($formfields[plab_user]) { $plab_bit = 1;
$new_bit = 1; } else {
} else { $plab_bit = 0;
$new_bit = 0;
}
DBQueryFatal("UPDATE users SET plab_user=$new_bit ".
"WHERE uid='$target_uid'");
} }
# #
...@@ -635,6 +628,7 @@ if (strcmp($defaults[usr_name], $formfields[usr_name]) || ...@@ -635,6 +628,7 @@ if (strcmp($defaults[usr_name], $formfields[usr_name]) ||
strcmp($defaults[usr_title], $formfields[usr_title]) || strcmp($defaults[usr_title], $formfields[usr_title]) ||
strcmp($defaults[usr_affil], $formfields[usr_affil]) || strcmp($defaults[usr_affil], $formfields[usr_affil]) ||
strcmp($defaults[usr_shell], $formfields[usr_shell]) || strcmp($defaults[usr_shell], $formfields[usr_shell]) ||
strcmp($defaults[plab_user], $formfields[plab_user]) ||
# Check this too, since we want to call out if the email addr changed. # Check this too, since we want to call out if the email addr changed.
strcmp($defaults[usr_email], $formfields[usr_email])) { strcmp($defaults[usr_email], $formfields[usr_email])) {
...@@ -651,6 +645,7 @@ if (strcmp($defaults[usr_name], $formfields[usr_name]) || ...@@ -651,6 +645,7 @@ if (strcmp($defaults[usr_name], $formfields[usr_name]) ||
"usr_title=\"$usr_title\", ". "usr_title=\"$usr_title\", ".
"usr_affil=\"$usr_affil\", ". "usr_affil=\"$usr_affil\", ".
"usr_shell=\"$usr_shell\", ". "usr_shell=\"$usr_shell\", ".
"plab_user=\"$plab_bit\", ".
"usr_modified=now() ". "usr_modified=now() ".
"WHERE uid=\"$target_uid\""); "WHERE uid=\"$target_uid\"");
......
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