public function switchUser($username) { if (($user = $this->_userManager->getUser($username)) === null) { return false; } $this->updateSessionUser($user); $this->getApplication()->setUser($user); return true; }