/** * Get callback from facebook. * * @return boolean */ public function getCallback() { $this->client->authenticate($_GET['code']); $token = $this->client->getAccessToken(); if (!empty($token)) { $this->putSessionToken($token); return true; } return false; }
public function runClient($username, $password) { global $session; $userReg = Client::authenticate($username, $password); if ($userReg) { $session->Clientlogin($userReg); return true; } else { return false; } }
public static function client_login() { $params = $_POST; $client = Client::authenticate($params['username'], $params['password']); if (!$client) { View::make('login/index.html', array('error' => 'Väärä käyttäjätunnus tai salasana!', 'username' => $params['username'])); } else { $_SESSION['client'] = $client->id; Redirect::to("/asiakkaat/omattiedot"); } }
public function testUserAuthenticationFailure() { self::$functions->expects($this->once())->method('ldap_connect')->with($this->equalTo('my_ldap_server'), $this->equalTo(389))->will($this->returnValue('my_ldap_resource')); self::$functions->expects($this->once())->method('ldap_bind')->with($this->equalTo('my_ldap_resource'), $this->equalTo('my_ldap_user'), $this->equalTo('my_ldap_password'))->will($this->returnValue(false)); $this->setExpectedException('\\Kanboard\\Core\\Ldap\\ClientException'); $ldap = new Client(); $ldap->open('my_ldap_server'); $ldap->authenticate('my_ldap_user', 'my_ldap_password'); }