Commit 2a2f172b authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Default user activity preferences for new users

parent 46549e26
......@@ -411,14 +411,13 @@ function activity_get_users($activitytype, $userids=null, $userobjs=null, $admin
* id
*/
function activity_set_defaults($user_id) {
global $USER;
log_debug($USER);
log_debug($user_id);
$activitytypes = get_records_array('activity_type', 'admin', 0);
foreach ($activitytypes as $type) {
log_debug('set ' . $type . ' for ' . $user_id);
insert_record('usr_activity_preference', (object)array(
'usr' => $user_id,
'activity' => $type->name,
'method' => 'internal',
));
}
}
......
......@@ -657,7 +657,7 @@ function handle_event($event, $data) {
// this is here because the core can't listen to events
// @todo, this is VERY ugly, and someone should fix it
if ($event == 'createuser') {
activity_set_defaults($event->id);
activity_set_defaults($data->id);
}
$plugintypes = plugin_types();
......
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