- Add the activate screen to the editor

- Add sponsor user types to the editor
This commit is contained in:
dave 2009-01-22 05:24:34 +00:00
parent cd1de0ddfd
commit c3ebf1f6cd
2 changed files with 32 additions and 13 deletions

View File

@ -29,9 +29,14 @@
$tabs = array('personal' => array(
'name' => 'Personal',
'types' => array('student','judge','committee','volunteer'),
'types' => array('student','judge','committee','volunteer','sponsor'),
'file' => '../user_personal.php',
),
'roles' => array(
'name' => 'Roles/Account',
'types' => array('student','judge','committee','volunteer','sponsor'),
'file' => '../user_activate.php',
),
'judgeother' => array(
'name' => 'Judge Other',
'types' => array('judge'),

View File

@ -42,15 +42,22 @@
$action_what = $user_what[$action_type];
}
if($_SESSION['embed'] == true)
$eid = $_SESSION['embed_edit_id'];
else
$uid = $_SESSION['users_id'];
$u = user_load($_SESSION['users_id']);
$u = user_load($eid);
switch($_POST['action']) {
case 'delete':
//okay here we go, lets get rid of them completely, since this is what theyve asked for
message_push(happy(i18n("Account successfully deleted. Goodbye")));
user_delete($u);
header('location: user_login.php?action=logout');
if($_SESSION['embed'] == true)
display_messages();
else
header('location: user_login.php?action=logout');
exit;
case 'remove':
@ -77,13 +84,20 @@
$u = user_load($u['id']);
$type = $_SESSION['users_type'];
$m = $user_what[$type];
send_header("Role and Account Management",
array("$m Main" => "{$type}_main.php")
if($_SESSION['embed'] == true) {
echo "<br/>";
display_messages();
echo "<h3>".i18n("Role and Account Management")."</h3>";
echo "<br/>";
} else {
$type = $_SESSION['users_type'];
$m = $user_what[$type];
send_header("Role and Account Management",
array("$m Main" => "{$type}_main.php")
);
}
$action_url = ($_SESSION['embed'] == true) ? $_SESSION['embed_submit_url'] : $_SERVER['PHP_SELF'];
foreach($u['types'] as $t) {
echo '<h3>'.i18n("Role: {$user_what[$t]}").'</h3>';
@ -98,7 +112,7 @@
}
echo '<table><tr><td>';
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<form method=\"post\" action=\"$action_url\">";
echo "<input type=\"hidden\" name=\"action\" value=\"activate\">\n";
echo "<input type=\"hidden\" name=\"action_type\" value=\"$t\">\n";
echo "<input style=\"width: 200px;\" $a type=\"submit\" value=\"".i18n("Activate Role")."\">";
@ -106,7 +120,7 @@
echo '</td><td>';
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<form method=\"post\" action=\"$action_url\">";
echo "<input type=\"hidden\" name=\"action\" value=\"deactivate\">\n";
echo "<input type=\"hidden\" name=\"action_type\" value=\"$t\">\n";
echo "<input style=\"width: 200px;\" $d type=\"submit\" value=\"".i18n("Deactivate Role")."\">";
@ -114,7 +128,7 @@
echo '</td><td>';
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<form method=\"post\" action=\"$action_url\">";
echo "<input type=\"hidden\" name=\"action\" value=\"remove\">\n";
echo "<input type=\"hidden\" name=\"action_type\" value=\"$t\">\n";
echo "<input style=\"width: 200px;\" $d onclick=\"return confirmClick('".i18n("Are you sure you want to remove this role from your account?\\nThis action cannot be undone.")."')\" type=\"submit\" value=\"".i18n("Remove Role")."\">";
@ -132,10 +146,10 @@
echo '</li><li>'.i18n("The <b>Delete Entire Account</b> button below completely deletes your entire account. You will not receive any future email for any roles. It completely removes you from the system. This action cannot be undone.");
echo '</ul>';
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<form method=\"post\" action=\"$action_url\">";
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
echo "<input style=\"width: 300px;\" onclick=\"return confirmClick('".i18n("Are you sure you want to completely delete your account?\\nDoing so will remove you from our mailing list for future years and you will never hear from us again.\\nThis action cannot be undone.")."')\" type=\"submit\" value=\"".i18n("Delete Entire Account")."\">";
echo "</form>";
send_footer();
if($_SESSION['embed'] != true) send_footer();
?>