/**
* Logout the user form the current symfony application and from the
* CAS server
* @param boolean $onlyLocal Set it to true, to logout from the application, but stay login in the CAS
*/
public function logout($url = null, $onlyLocal = false)
{
parent::signOut();
$this->username = null;
if (!$onlyLocal) {
sfCAS::initPhpCAS();
if (!empty($url)) {
phpCAS::logoutWithUrl($url);
} else {
phpCas::logout();
}
}
}