public function login(AIS2Connection $connection) { assert($this->cookie !== null); if ($this->loggedIn) { return false; } $connection->addCookie('cosign-filter-ais2.uniba.sk', $this->cookie, 0, '/', 'ais2.uniba.sk'); $data = $connection->get(self::LOGIN); if (preg_match('@\\<title\\>IIKS \\- Prihlásenie\\</title\\>@', $data)) { return false; } $this->loggedIn = true; return true; }
public function logout(AIS2Connection $connection) { $connection->clearCookies(); $this->loggedIn = false; return true; }
public function logout(AIS2Connection $connection) { $connection->post(self::COSIGN_LOGOUT, array('verify' => 'Odhlásiť', 'url' => self::MAIN_PAGE)); return parent::logout($connection); }