Skip to content

Commit

Permalink
fix for MDL-9983, trigger certain events out of the core to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
toyomoyo committed Jul 10, 2007
1 parent 2f338ab commit a160cf0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 2 additions & 3 deletions course/category.php
Expand Up @@ -58,6 +58,8 @@
if (! set_field("course_categories", "name", $category->name, "id", $category->id)) {
notify("An error occurred while renaming the category");
}
// MDL-9983
events_trigger('category_updated', $category);
}

/// Set the category theme if requested
Expand Down Expand Up @@ -87,9 +89,6 @@
fix_course_sortorder($category->id);
}
}

// MDL-9983
events_trigger('category_updated', $category);
}


Expand Down
5 changes: 4 additions & 1 deletion group/edit.php
Expand Up @@ -84,7 +84,10 @@
}
if (groups_delete_group($id)) {
// MDL-9983
events_trigger('group_deleted', $id);
$eventdata = new object();
$eventdata->group = $id;
$eventdata->course = $courseid;
events_trigger('group_deleted', $eventdata);
redirect(groups_home_url($course->id, null, $groupingid, false));
} else {
print_error('erroreditgroup', 'group', groups_home_url($course->id));
Expand Down
6 changes: 6 additions & 0 deletions login/change_password.php
Expand Up @@ -68,6 +68,12 @@

$strpasswordchanged = get_string('passwordchanged');

// MDL-9983
$eventdata = new object();
$eventdata -> user = $USER;
$eventdata -> newpassword = $data -> newpassword1;
events_trigger('password_changed', $eventdata);

add_to_log($course->id, 'user', 'change password', "view.php?id=$USER->id&course=$course->id", "$USER->id");

$fullname = fullname($USER, true);
Expand Down
6 changes: 0 additions & 6 deletions user/edit.php
Expand Up @@ -113,12 +113,6 @@
}
}

// MDL-9983
$eventdata = new object();
$eventdata -> user = $USER;
$eventdata -> newpassword = $data -> newpassword1;
events_trigger('password_changed', $eventdata);

redirect("$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id");
}

Expand Down

0 comments on commit a160cf0

Please sign in to comment.