summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-26 12:40:30 -0500
committerEvan Prodromou <evan@status.net>2010-02-26 12:40:30 -0500
commit6781f95c733ed4d678fc4c09926efe195e590359 (patch)
tree5b9c8ea6e0a612a7bf05f5823878fce73bab2f7f /actions
parentd9d1a77bb02227e6e79392959643404391df2ea0 (diff)
parentc188ae15d926948f1851472f412071329002f403 (diff)
Merge branch 'blacklistplus' into testing
Conflicts: EVENTS.txt
Diffstat (limited to 'actions')
-rw-r--r--actions/deleteuser.php31
1 files changed, 18 insertions, 13 deletions
diff --git a/actions/deleteuser.php b/actions/deleteuser.php
index 32b703aa7..c4f84fad2 100644
--- a/actions/deleteuser.php
+++ b/actions/deleteuser.php
@@ -131,18 +131,21 @@ class DeleteuserAction extends ProfileFormAction
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
$this->element('legend', _('Delete user'));
- $this->element('p', null,
- _('Are you sure you want to delete this user? '.
- 'This will clear all data about the user from the '.
- 'database, without a backup.'));
- $this->element('input', array('id' => 'deleteuserto-' . $id,
- 'name' => 'profileid',
- 'type' => 'hidden',
- 'value' => $id));
- foreach ($this->args as $k => $v) {
- if (substr($k, 0, 9) == 'returnto-') {
- $this->hidden($k, $v);
+ if (Event::handle('StartDeleteUserForm', array($this, $this->user))) {
+ $this->element('p', null,
+ _('Are you sure you want to delete this user? '.
+ 'This will clear all data about the user from the '.
+ 'database, without a backup.'));
+ $this->element('input', array('id' => 'deleteuserto-' . $id,
+ 'name' => 'profileid',
+ 'type' => 'hidden',
+ 'value' => $id));
+ foreach ($this->args as $k => $v) {
+ if (substr($k, 0, 9) == 'returnto-') {
+ $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-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user'));
@@ -158,7 +161,9 @@ class DeleteuserAction extends ProfileFormAction
function handlePost()
{
- $this->user->delete();
+ if (Event::handle('StartDeleteUser', array($this, $this->user))) {
+ $this->user->delete();
+ Event::handle('EndDeleteUser', array($this, $this->user));
+ }
}
}
-