summaryrefslogtreecommitdiff
path: root/actions/deleteuser.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
committerCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
commit714d920faea302b55857cc3bec4e9e6160ea136a (patch)
treecffa5ee7a3261ad24b272cb3ced16a6c1dcafad1 /actions/deleteuser.php
parentc187bf55974347f7ddb4f28714af57861dce8f08 (diff)
parent51a245f18c1e4a830c5eb94f3e60c6b4b3e560ee (diff)
Merge branch '0.9.x' into 1.0.x
Conflicts: classes/statusnet.ini db/statusnet.sql lib/jabber.php lib/xmppmanager.php
Diffstat (limited to 'actions/deleteuser.php')
-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));
+ }
}
}
-