forked from GNUsocial/gnu-social
trac155 first step to delete account
darcs-hash:20081123215059-099f7-a0a969229b20fc01ca54f15b166333b3e5a32137.gz
This commit is contained in:
parent
a627c69944
commit
daf14886b3
@ -35,6 +35,8 @@ class ProfilesettingsAction extends SettingsAction {
|
|||||||
$this->show_avatar_form();
|
$this->show_avatar_form();
|
||||||
common_element('h2', NULL, _('Change password'));
|
common_element('h2', NULL, _('Change password'));
|
||||||
$this->show_password_form();
|
$this->show_password_form();
|
||||||
|
common_element('h2', NULL, _('Delete my account'));
|
||||||
|
$this->show_delete_form();
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +56,10 @@ class ProfilesettingsAction extends SettingsAction {
|
|||||||
$this->upload_avatar();
|
$this->upload_avatar();
|
||||||
} else if ($this->arg('changepass')) {
|
} else if ($this->arg('changepass')) {
|
||||||
$this->change_password();
|
$this->change_password();
|
||||||
|
} else if ($this->arg('deleteaccount')) {
|
||||||
|
$this->delete_account();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_settings_form() {
|
function show_settings_form() {
|
||||||
@ -187,6 +192,20 @@ class ProfilesettingsAction extends SettingsAction {
|
|||||||
common_element_end('form');
|
common_element_end('form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_delete_form() {
|
||||||
|
|
||||||
|
$user = common_current_user();
|
||||||
|
common_element_start('form', array('method' => 'POST',
|
||||||
|
'id' => 'password',
|
||||||
|
'action' =>
|
||||||
|
common_local_url('profilesettings')));
|
||||||
|
|
||||||
|
common_hidden('token', common_session_token());
|
||||||
|
|
||||||
|
common_submit('deleteaccount', _('Delete my account'));
|
||||||
|
common_element_end('form');
|
||||||
|
}
|
||||||
|
|
||||||
function save_profile() {
|
function save_profile() {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
$fullname = $this->trimmed('fullname');
|
$fullname = $this->trimmed('fullname');
|
||||||
@ -434,4 +453,11 @@ class ProfilesettingsAction extends SettingsAction {
|
|||||||
$this->show_form(_('Password saved.'), true);
|
$this->show_form(_('Password saved.'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete_account() {
|
||||||
|
|
||||||
|
$user = common_current_user();
|
||||||
|
assert(!is_null($user)); # should already be checked
|
||||||
|
|
||||||
|
$this->show_form(_('You will be asked to confirmed, nothing was deleted.'), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user