Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
adf9b66b
Commit
adf9b66b
authored
Dec 13, 2007
by
Richard Mansfield
Browse files
Show institutional admins on admin notifications page
parent
f9bfc075
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/notifications.php
View file @
adf9b66b
...
...
@@ -25,7 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'
INSTITUTIONAL
ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configusers/adminnotifications'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'adminnotifications'
,
'admin'
));
...
...
@@ -35,12 +35,23 @@ define('SECTION_PAGE', 'notifications');
require_once
(
'pieforms/pieform.php'
);
$sql
=
'SELECT u.*, a.activity, a.method
global
$USER
;
$sql
=
'
SELECT
u.id, u.username, u.firstname, u.lastname, u.preferredname, u.admin, u.staff,
a.activity, a.method
FROM {usr} u
LEFT JOIN {usr_activity_preference} a ON a.usr = u.id
WHERE u.admin = ?'
;
LEFT OUTER JOIN {usr_institution} ui
ON (ui.usr = u.id'
.
(
$USER
->
get
(
'admin'
)
?
''
:
' AND ui.institution IN ('
.
join
(
','
,
array_map
(
'db_quote'
,
array_keys
(
$USER
->
get
(
'institutions'
))))
.
')'
)
.
')
GROUP BY
u.id, u.username, u.firstname, u.lastname, u.preferredname, u.admin, u.staff,
a.activity, a.method
HAVING ('
.
(
$USER
->
get
(
'admin'
)
?
'u.admin = 1 OR '
:
''
)
.
'SUM(ui.admin) > 0)'
;
$admins
=
get_records_sql_array
(
$sql
,
array
(
1
)
);
$admins
=
get_records_sql_array
(
$sql
,
null
);
$types
=
get_column
(
'activity_type'
,
'name'
,
'admin'
,
1
);
$types
=
array_flip
(
$types
);
foreach
(
array_keys
(
$types
)
as
$k
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment