forked from science-ation/science-ation
Put some superuser stuff on the participant invite page so alison can see whats going on
This commit is contained in:
parent
b26d9a3dc4
commit
caf1207fbf
@ -96,7 +96,12 @@ if($_POST['show_types'])
|
|||||||
if(count($u['roles'])) {
|
if(count($u['roles'])) {
|
||||||
echo "<b>";
|
echo "<b>";
|
||||||
echo "<a href=\"#\" onclick=\"return openeditor({$u['id']})\">";
|
echo "<a href=\"#\" onclick=\"return openeditor({$u['id']})\">";
|
||||||
echo $u['firstname']." ".$u['lastname'];
|
if($u['firstname'] || $u['lastname']) {
|
||||||
|
echo $u['firstname']." ".$u['lastname'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo i18n("No name specified");
|
||||||
|
}
|
||||||
echo "</a>";
|
echo "</a>";
|
||||||
echo "</b>";
|
echo "</b>";
|
||||||
echo "<table>";
|
echo "<table>";
|
||||||
|
@ -167,19 +167,7 @@
|
|||||||
|
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
|
|
||||||
/*
|
if( ($_POST['action']=="invitenew" || $_POST['action']=="inviteexisting") && $_POST['email'] && $type != '') {
|
||||||
//FIXME: commente dby james 2010-12-21 - we need ta better way to know which types we can invite
|
|
||||||
$allowed_types = array('judge', 'volunteer');
|
|
||||||
if($type == '') $type = $_GET['type'];
|
|
||||||
if($type != '') {
|
|
||||||
if(!in_array($type, $allowed_types)) {
|
|
||||||
echo "Type $type not allowed for invite<br /><br/>";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
|
|
||||||
$newUser=user_invite($_POST['email'], null, $_POST['email'], $type);
|
$newUser=user_invite($_POST['email'], null, $_POST['email'], $type);
|
||||||
if(is_array($newUser)) {
|
if(is_array($newUser)) {
|
||||||
echo happy(i18n("%1 successfully invited to be a %2",array($_POST['email'],$type)));
|
echo happy(i18n("%1 successfully invited to be a %2",array($_POST['email'],$type)));
|
||||||
@ -188,16 +176,7 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
|
|||||||
echo error($newUser);
|
echo error($newUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($_POST['action']=="inviteexisting" && $_POST['email'] && $type != '') {
|
|
||||||
|
|
||||||
$newUser=user_invite($_POST['email'], null, $_POST['email'], $type);
|
|
||||||
if(is_array($newUser)) {
|
|
||||||
echo happy(i18n("%1 successfully invited to be a %2",array($_POST['email'],$type)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo error($newUser);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<form method=\"post\" name=\"invite\" action=\"participant_invite.php\">\n";
|
echo "<form method=\"post\" name=\"invite\" action=\"participant_invite.php\">\n";
|
||||||
echo "<input type=\"hidden\" name=\"action\" id=\"action\" value=\"invite\" />\n";
|
echo "<input type=\"hidden\" name=\"action\" id=\"action\" value=\"invite\" />\n";
|
||||||
echo "<table>";
|
echo "<table>";
|
||||||
@ -224,19 +203,42 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
|
|||||||
|
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
|
|
||||||
$q=mysql_query("SELECT users.id, users.firstname, users.lastname, accounts.username, accounts.email, accounts.pendingemail FROM users
|
if($_SESSION['superuser']=="yes") {
|
||||||
JOIN accounts on users.accounts_id=accounts.id
|
$q=mysql_query("SELECT users.id, users.firstname, users.lastname, accounts.username, accounts.email, accounts.pendingemail, users.schools_id, schools.school
|
||||||
JOIN user_roles ON user_roles.users_id=users.id
|
FROM users
|
||||||
JOIN roles ON user_roles.roles_id=roles.id
|
LEFT JOIN schools ON users.schools_id=schools.id
|
||||||
WHERE schools_id='$schoolid'
|
JOIN accounts on users.accounts_id=accounts.id
|
||||||
AND conferences_id='{$conference['id']}'
|
JOIN user_roles ON user_roles.users_id=users.id
|
||||||
AND roles.type='participant'");
|
JOIN roles ON user_roles.roles_id=roles.id
|
||||||
|
AND users.conferences_id='{$conference['id']}'
|
||||||
|
AND schools.conferences_id='{$conference['id']}'
|
||||||
|
AND roles.type='participant'");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$q=mysql_query("SELECT users.id, users.firstname, users.lastname, accounts.username, accounts.email, accounts.pendingemail FROM users
|
||||||
|
JOIN accounts on users.accounts_id=accounts.id
|
||||||
|
JOIN user_roles ON user_roles.users_id=users.id
|
||||||
|
JOIN roles ON user_roles.roles_id=roles.id
|
||||||
|
WHERE schools_id='$schoolid'
|
||||||
|
AND conferences_id='{$conference['id']}'
|
||||||
|
AND roles.type='participant'");
|
||||||
|
}
|
||||||
|
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "<h2>".i18n("The following participants have been invited from your school")."</h2>\n";
|
if($_SESSION['superuser']=="yes") {
|
||||||
|
echo "<h2>".i18n("The following participants have been invited from all school (you're a superuser!)")."</h2>\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<h2>".i18n("The following participants have been invited from your school")."</h2>\n";
|
||||||
|
}
|
||||||
echo "<table class=\"tableview\">\n";
|
echo "<table class=\"tableview\">\n";
|
||||||
echo "<tr><th>Username</th><th>Email Address</th><th>First Name</th><th>Last Name</th><th>Actions</th>";
|
echo "<tr><th>Username</th><th>Email Address</th><th>First Name</th><th>Last Name</th>";
|
||||||
|
if($_SESSION['superuser']=="yes") {
|
||||||
|
echo "<th>School</th>";
|
||||||
|
}
|
||||||
|
echo "<th>Actions</th>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
while($r=mysql_fetch_object($q)) {
|
while($r=mysql_fetch_object($q)) {
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
@ -251,6 +253,10 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
|
|||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo " <td>$r->firstname</td>";
|
echo " <td>$r->firstname</td>";
|
||||||
echo " <td>$r->lastname</td>";
|
echo " <td>$r->lastname</td>";
|
||||||
|
if($_SESSION['superuser']=="yes") {
|
||||||
|
echo "<td>$r->school</td>";
|
||||||
|
}
|
||||||
|
|
||||||
echo " <td><a href=\"#\" onclick=\"return uninvite($r->id)\">uninvite</a></td>";
|
echo " <td><a href=\"#\" onclick=\"return uninvite($r->id)\">uninvite</a></td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ $tabs = array(
|
|||||||
'school' => array(
|
'school' => array(
|
||||||
'label' => 'School',
|
'label' => 'School',
|
||||||
'name' => 'Select School Information',
|
'name' => 'Select School Information',
|
||||||
'types' => array('teacher','participant','principal','parent'),
|
'types' => array('teacher','participant','principal'),
|
||||||
'file' => 'user_school.php',
|
'file' => 'user_school.php',
|
||||||
'status_func' => false,
|
'status_func' => false,
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -25,10 +25,8 @@
|
|||||||
require_once('common.inc.php');
|
require_once('common.inc.php');
|
||||||
require_once('user.inc.php');
|
require_once('user.inc.php');
|
||||||
|
|
||||||
/* Ensure they're logged in as something, anything */
|
|
||||||
user_auth_required();
|
|
||||||
|
|
||||||
$edit_id = isset($_GET['users_id']) ? intval($_GET['users_id']) : $_SESSION['users_id'];
|
$edit_id = isset($_GET['users_id']) ? intval($_GET['users_id']) : $_SESSION['users_id'];
|
||||||
|
|
||||||
if($edit_id != $_SESSION['users_id'])
|
if($edit_id != $_SESSION['users_id'])
|
||||||
user_auth_required('admin');
|
user_auth_required('admin');
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user