34 lines
972 B
PHP
34 lines
972 B
PHP
|
<?php
|
||
|
class WsScores
|
||
|
{
|
||
|
protected $webservices = array();
|
||
|
|
||
|
public function __construct(){
|
||
|
$config = new Zend_Config_Ini(APPLICATION_PATH .
|
||
|
'/configs/webservices.ini', APPLICATION_ENV);
|
||
|
$this->webservices = $config->webservices->toArray();
|
||
|
}
|
||
|
|
||
|
public function getInfosLogin($login, $ipUtilisateur = ''){
|
||
|
$params = new stdClass();
|
||
|
$params->login = $login;
|
||
|
$params->ipUtilisateur = $ipUtilisateur;
|
||
|
$client = $this->loadClient('interne');
|
||
|
$reponse = $client->getInfosLogin($params);
|
||
|
return $reponse->getInfosLoginResult;
|
||
|
}
|
||
|
|
||
|
protected function loadClient($webservice){
|
||
|
$wsdl = $this->webservices[$webservice]['wsdl'];
|
||
|
$options = $this->webservices[$webservice]['options'];
|
||
|
$auth = Zend_Auth::getInstance();
|
||
|
$login = $auth->getIdentity()->username;
|
||
|
$hash = md5($login.'|'.$auth->getIdentity()->password);
|
||
|
$options['login'] = $login;
|
||
|
$options['password'] = $hash;
|
||
|
$client = new SoapClient($wsdl, $options);
|
||
|
return $client;
|
||
|
}
|
||
|
}
|
||
|
|