diff --git a/admin/account_list.php b/admin/account_list.php index 89b7281..7941031 100644 --- a/admin/account_list.php +++ b/admin/account_list.php @@ -96,7 +96,12 @@ if($_POST['show_types']) if(count($u['roles'])) { echo ""; echo ""; - echo $u['firstname']." ".$u['lastname']; + if($u['firstname'] || $u['lastname']) { + echo $u['firstname']." ".$u['lastname']; + } + else { + echo i18n("No name specified"); + } echo ""; echo ""; echo ""; diff --git a/participant_invite.php b/participant_invite.php index 60b6296..bda506e 100644 --- a/participant_invite.php +++ b/participant_invite.php @@ -167,19 +167,7 @@ echo "
"; -/* -//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

"; - exit; - } - } - */ - -if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') { +if( ($_POST['action']=="invitenew" || $_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))); @@ -188,16 +176,7 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') { 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 "\n"; echo "\n"; echo "
"; @@ -224,19 +203,42 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') { echo "\n"; - $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'"); + if($_SESSION['superuser']=="yes") { + $q=mysql_query("SELECT users.id, users.firstname, users.lastname, accounts.username, accounts.email, accounts.pendingemail, users.schools_id, schools.school + FROM users + LEFT JOIN schools ON users.schools_id=schools.id + 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 + 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 "
"; echo "
"; - echo "

".i18n("The following participants have been invited from your school")."

\n"; + if($_SESSION['superuser']=="yes") { + echo "

".i18n("The following participants have been invited from all school (you're a superuser!)")."

\n"; + } + else { + echo "

".i18n("The following participants have been invited from your school")."

\n"; + } echo "
\n"; - echo ""; + echo ""; + if($_SESSION['superuser']=="yes") { + echo ""; + } + echo ""; echo "\n"; while($r=mysql_fetch_object($q)) { echo ""; @@ -251,6 +253,10 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') { echo ""; echo " "; echo " "; + if($_SESSION['superuser']=="yes") { + echo ""; + } + echo " "; echo ""; diff --git a/user_edit_tabs.inc.php b/user_edit_tabs.inc.php index 80d23b5..5d2df3a 100644 --- a/user_edit_tabs.inc.php +++ b/user_edit_tabs.inc.php @@ -94,7 +94,7 @@ $tabs = array( 'school' => array( 'label' => 'School', 'name' => 'Select School Information', - 'types' => array('teacher','participant','principal','parent'), + 'types' => array('teacher','participant','principal'), 'file' => 'user_school.php', 'status_func' => false, 'enabled' => true, diff --git a/user_school.php b/user_school.php index 45cdd0f..1942ecf 100644 --- a/user_school.php +++ b/user_school.php @@ -25,10 +25,8 @@ require_once('common.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']; + if($edit_id != $_SESSION['users_id']) user_auth_required('admin'); else
UsernameEmail AddressFirst NameLast NameActions
UsernameEmail AddressFirst NameLast NameSchoolActions
$r->firstname$r->lastname$r->schoolid)\">uninvite