[eluser]kurucu[/eluser]
Agreed. Also, the condition is at risk as the first time generally means $firstime is unset (i.e. the false condition) and thus if false was dropped it would turn true again in the function declaration.
Perhaps swapping the logic around would help, so that the conditions false, unset, zero and default are all the same, and the confirmation condition becomes true...
Code:
public function logout($confirmed = FALSE)
{
$this->user->logOut();
$this->load->view('account/loggedOut');
if ($confirmed == FALSE) {
redirect('account/logout/1'); // or indeed any value at all, I think.
}
}
I use == rather than === here to trap zeros, unsets, the word False and so on.