Skip to content
GitLab
Menu
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
cf518acd
Commit
cf518acd
authored
Dec 10, 2008
by
Richard Mansfield
Browse files
Set activity prefs for first admin; make all admin activity prefs default to email
parent
7a13ca9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/activity.php
View file @
cf518acd
...
...
@@ -162,13 +162,21 @@ function activity_set_defaults($eventdata) {
function
activity_add_admin_defaults
(
$userids
)
{
$activitytypes
=
get_records_array
(
'activity_type'
,
'admin'
,
1
);
$haveemail
=
in_array
(
'email'
,
array_map
(
create_function
(
'$a'
,
'return $a->name;'
),
plugins_installed
(
'notification'
)));
if
(
$haveemail
)
{
$method
=
'email'
;
}
else
{
$method
=
'internal'
;
}
foreach
(
$activitytypes
as
$type
)
{
foreach
(
$userids
as
$id
)
{
if
(
!
record_exists
(
'usr_activity_preference'
,
'usr'
,
$id
,
'activity'
,
$type
->
id
))
{
insert_record
(
'usr_activity_preference'
,
(
object
)
array
(
'usr'
=>
$id
,
'activity'
=>
$type
->
id
,
'method'
=>
'internal'
,
'method'
=>
$method
,
));
}
}
...
...
htdocs/lib/upgrade.php
View file @
cf518acd
...
...
@@ -606,6 +606,7 @@ function core_install_lastcoredata_defaults() {
set_profile_field
(
$user
->
id
,
'lastname'
,
$user
->
lastname
);
set_config
(
'installed'
,
true
);
handle_event
(
'createuser'
,
$user
->
id
);
activity_add_admin_defaults
(
array
(
$user
->
id
));
db_commit
();
// if we're installing, set up the block categories here and then poll the plugins.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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