events for creating a group

This commit is contained in:
Evan Prodromou 2011-01-26 18:35:01 -07:00
parent 5fee38b025
commit 2682915b99
2 changed files with 64 additions and 52 deletions

View File

@ -1063,3 +1063,9 @@ StartGroupEditFormData: Beginning the group edit form entries
EndGroupEditFormData: Ending the group edit form entries
- $form: The form widget being shown
StartGroupSave: After initializing but before saving a group
- &$group: group about to be saved
EndGroupSave: After saving a group, aliases, and first member
- $group: group that was saved

View File

@ -512,6 +512,8 @@ class User_group extends Memcached_DataObject
$group->mainpage = $mainpage;
$group->created = common_sql_now();
if (Event::handle('StartGroupSave', array(&$group))) {
$result = $group->insert();
if (!$result) {
@ -570,6 +572,10 @@ class User_group extends Memcached_DataObject
}
$group->query('COMMIT');
Event::handle('EndGroupSave', array($group));
}
return $group;
}