mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Add "groupDelete" action
This commit is contained in:
parent
7ce1add5dc
commit
09b3d77b19
@ -41,6 +41,15 @@ final class Events
|
||||
*/
|
||||
const GROUP_CREATE = 'groupCreate';
|
||||
|
||||
/**
|
||||
* A group is deleted.
|
||||
*
|
||||
* This event is triggered after a group has been deleted. An associative
|
||||
* array with the following items is passed to the event handlers:
|
||||
* - "id": int, deleted group ID.
|
||||
*/
|
||||
const GROUP_DELETE = 'groupDelete';
|
||||
|
||||
/**
|
||||
* An operator cannot be authenticated.
|
||||
*
|
||||
|
@ -448,6 +448,8 @@ function update_group_members($group_id, $new_value)
|
||||
/**
|
||||
* Deletes a group with specified ID.
|
||||
*
|
||||
* Triggers {@link \Mibew\EventDispatcher\Events::GROUP_DELETE} event.
|
||||
*
|
||||
* @param int $group_id ID of the group that should be deleted.
|
||||
*/
|
||||
function delete_group($group_id)
|
||||
@ -456,4 +458,7 @@ function delete_group($group_id)
|
||||
$db->query("DELETE FROM {opgroup} WHERE groupid = ?", array($group_id));
|
||||
$db->query("DELETE FROM {operatortoopgroup} WHERE groupid = ?", array($group_id));
|
||||
$db->query("UPDATE {thread} SET groupid = 0 WHERE groupid = ?", array($group_id));
|
||||
|
||||
$args = array('id' => $group_id);
|
||||
EventDispatcher::getInstance()->triggerEvent(Events::GROUP_DELETE, $args);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user