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
20c82d27
Commit
20c82d27
authored
Dec 13, 2007
by
Richard Mansfield
Browse files
Add internal admin notifications for new institutional admins
parent
549cd6d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/edit.php
View file @
20c82d27
...
...
@@ -305,6 +305,9 @@ function edituser_institution_submit(Pieform $form, $values) {
db_begin
();
delete_records
(
'usr_institution'
,
'usr'
,
$user
->
id
,
'institution'
,
$i
->
institution
);
insert_record
(
'usr_institution'
,
$newuser
);
if
(
$newuser
->
admin
)
{
activity_add_admin_defaults
(
array
(
$user
->
id
));
}
handle_event
(
'updateuser'
,
$user
->
id
);
db_commit
();
break
;
...
...
htdocs/admin/users/institutionadmins.php
View file @
20c82d27
...
...
@@ -88,6 +88,7 @@ function adminusers_submit(Pieform $form, $values) {
SET admin = 1
WHERE usr IN ('
.
join
(
','
,
$values
[
'users'
])
.
') AND institution = '
.
db_quote
(
$inst
));
}
activity_add_admin_defaults
(
$values
[
'users'
]);
db_commit
();
$SESSION
->
add_ok_msg
(
get_string
(
'adminusersupdated'
,
'admin'
));
redirect
(
'/admin/users/institutionadmins.php?institution='
.
$inst
);
...
...
htdocs/lib/activity.php
View file @
20c82d27
...
...
@@ -425,6 +425,22 @@ function activity_set_defaults($user_id) {
}
function
activity_add_admin_defaults
(
$userids
)
{
$activitytypes
=
get_records_array
(
'activity_type'
,
'admin'
,
1
);
foreach
(
$activitytypes
as
$type
)
{
foreach
(
$userids
as
$id
)
{
if
(
!
record_exists
(
'usr_activity_preference'
,
'usr'
,
$id
,
'activity'
,
$type
->
name
))
{
insert_record
(
'usr_activity_preference'
,
(
object
)
array
(
'usr'
=>
$id
,
'activity'
=>
$type
->
name
,
'method'
=>
'internal'
,
));
}
}
}
}
function
activity_process_queue
()
{
db_begin
();
...
...
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