Commit 7e7aa8b5 authored by Nigel McNie's avatar Nigel McNie
Browse files

Respect the 'deleted' flag on the usr table for site/institution staff/admin pages.

parent 6d78d50c
......@@ -39,7 +39,7 @@ $smarty = smarty();
// Get users who are currently administrators
// @todo later, exclude the user with uid 1
$adminusers = get_column('usr', 'id', 'admin', 1);
$adminusers = get_column('usr', 'id', 'admin', 1, 'deleted', 0);
$form = array(
'name' => 'adminusers',
......
......@@ -44,7 +44,12 @@ if ($institution === false) {
}
// Get users who are currently admins
$adminusers = get_column('usr_institution', 'usr', 'admin', 1, 'institution', $institution);
$adminusers = get_column_sql('SELECT ui.usr
FROM {usr_institution} ui
LEFT JOIN {usr} u ON ui.usr = u.id
WHERE ui.admin = 1
AND ui.institution = ?
AND u.deleted = 0', array($institution));
$form = array(
'name' => 'adminusers',
......
......@@ -44,7 +44,12 @@ if ($institution === false) {
}
// Get users who are currently staff
$staffusers = get_column('usr_institution', 'usr', 'staff', 1, 'institution', $institution);
$staffusers = get_column_sql('SELECT ui.usr
FROM {usr_institution} ui
LEFT JOIN {usr} u ON ui.usr = u.id
WHERE ui.staff = 1
AND ui.institution = ?
AND u.deleted = 0', array($institution));
$form = array(
'name' => 'staffusers',
......
......@@ -38,7 +38,7 @@ require_once('pieforms/pieform.php');
$smarty = smarty();
// Get users who are currently staff
$staffusers = get_column('usr', 'id', 'staff', 1);
$staffusers = get_column('usr', 'id', 'staff', 1, 'deleted', 0);
$form = array(
'name' => 'staffusers',
......
Supports Markdown
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