Skip to content

Commit bf755d5

Browse files
committed
Make credential deletion more selective
1 parent 089b137 commit bf755d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Pages/Account.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ function getContent()
2727
function postContent() {
2828
$this->gatekeeper(); // Logged-in users only
2929
if (($this->getInput('remove'))) {
30+
$rm = $this->getInput('remove');
3031
$user = \Idno\Core\site()->session()->currentUser();
31-
$user->twitter = array();
32+
if($rm === '1') {
33+
$user->twitter = array(); // wipes all credentials
34+
} else {
35+
unset($user->twitter[$rm]); // wipes specific credentials
36+
}
3237
$user->save();
3338
\Idno\Core\site()->session()->addMessage(\Idno\Core\Idno::site()->language()->_('Your Twitter settings have been removed from your account.'));
3439
}

0 commit comments

Comments
 (0)