add events to fine-tune user deletion
This commit is contained in:
parent
5fdcd88176
commit
a092aac32d
16
EVENTS.txt
16
EVENTS.txt
@ -714,3 +714,19 @@ StartRobotsTxt: Before outputting the robots.txt page
|
|||||||
EndRobotsTxt: After the default robots.txt page (good place for customization)
|
EndRobotsTxt: After the default robots.txt page (good place for customization)
|
||||||
- &$action: RobotstxtAction being shown
|
- &$action: RobotstxtAction being shown
|
||||||
|
|
||||||
|
StartDeleteUserForm: starting the data in the form for deleting a user
|
||||||
|
- $action: action being shown
|
||||||
|
- $user: user being deleted
|
||||||
|
|
||||||
|
EndDeleteUserForm: Ending the data in the form for deleting a user
|
||||||
|
- $action: action being shown
|
||||||
|
- $user: user being deleted
|
||||||
|
|
||||||
|
StartDeleteUser: handling the post for deleting a user
|
||||||
|
- $action: action being shown
|
||||||
|
- $user: user being deleted
|
||||||
|
|
||||||
|
EndDeleteUser: handling the post for deleting a user
|
||||||
|
- $action: action being shown
|
||||||
|
- $user: user being deleted
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ class DeleteuserAction extends ProfileFormAction
|
|||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
$this->element('legend', _('Delete user'));
|
$this->element('legend', _('Delete user'));
|
||||||
|
if (Event::handle('StartDeleteUserForm', array($this, $this->user))) {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
_('Are you sure you want to delete this user? '.
|
_('Are you sure you want to delete this user? '.
|
||||||
'This will clear all data about the user from the '.
|
'This will clear all data about the user from the '.
|
||||||
@ -144,6 +145,8 @@ class DeleteuserAction extends ProfileFormAction
|
|||||||
$this->hidden($k, $v);
|
$this->hidden($k, $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Event::handle('EndDeleteUserForm', array($this, $this->user));
|
||||||
|
}
|
||||||
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user"));
|
$this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user"));
|
||||||
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user'));
|
$this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
@ -158,7 +161,9 @@ class DeleteuserAction extends ProfileFormAction
|
|||||||
|
|
||||||
function handlePost()
|
function handlePost()
|
||||||
{
|
{
|
||||||
|
if (Event::handle('StartDeleteUser', array($this, $this->user))) {
|
||||||
$this->user->delete();
|
$this->user->delete();
|
||||||
|
Event::handle('EndDeleteUser', array($this, $this->user));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user