Skip to content

Instantly share code, notes, and snippets.

@jburns131
Created October 16, 2013 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jburns131/7014415 to your computer and use it in GitHub Desktop.
Save jburns131/7014415 to your computer and use it in GitHub Desktop.
<?php
...
public function logoutAttempt()
{
$sql = new Db();
$this->sessionAxis->start();
$currentUser = new \Acms\Core\Entities\CurrentUser($this->sessionAxis);
$tableColumns = [
'acms_id' => '',
'modified' => date("Y-m-d H:i:s", time()),
];
$conditions = 'id = :id';
$bind = ['id' => $currentUser->getId()];
$sql->dbUpdate('users', $tableColumns, $conditions, $bind);
$this->sessionAxis->destroy();
$cookieName = str_replace('.', '_', $_SERVER['SERVER_NAME']) . '_acms';
setcookie($_SERVER['SERVER_NAME'] . '_acms', false, time() - 3600, '/', $_SERVER['SERVER_NAME']);
header('Location: ' . $this->basePath);
exit;
return false;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment