Issue #0001653:
This commit is contained in:
parent
e82be237fe
commit
a074251cc9
60
application/controllers/WorldcheckController.php
Normal file
60
application/controllers/WorldcheckController.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
class WorldcheckController extends Zend_Controller_Action
|
||||
{
|
||||
protected $siret;
|
||||
protected $id;
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once '/WorldCheck/WsWorldCheck.php';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$message = '';
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$param->dirNom = 'HOLLANDE'; //$request->getParam('dirNom');
|
||||
$param->dirPrenom = ''; //$request->getParam('dirPrenom');
|
||||
$param->dirNaissJJ = $request->getParam('dirNaissJJ');
|
||||
$param->dirDateNaissMM = $request->getParam('dirDateNaissMM');
|
||||
$param->dirDateNaissAAAA = $request->getParam('dirDateNaissAAAA');
|
||||
$param->dirCpVille = $request->getParam('dirCpVille');
|
||||
|
||||
$data->customId1 = '1';
|
||||
$data->customId2 = '2';
|
||||
$data->name = $param->dirNom.' '.$param->dirPrenom;
|
||||
$data->nameType = 'INDIVIDUAL';
|
||||
|
||||
$wc = new WsWorldCheck();
|
||||
$nameIdentifier = $wc->getScreener($data);
|
||||
|
||||
$matchCount = new stdClass();
|
||||
$matchCount = $wc->getDetailsName($nameIdentifier);
|
||||
|
||||
if ($matchCount->unresolvedMatchCount == 0)
|
||||
{
|
||||
$message = 'Aucun résultat.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = 'Résultats de recherche';
|
||||
$matches = $wc->getMatchesName($nameIdentifier, 'WATCHLIST', 0, $matchCount->unresolvedMatchCount);
|
||||
}
|
||||
|
||||
$this->view->assign('message', $message);
|
||||
$this->view->assign('param', $param);
|
||||
$this->view->assign('matches', $matches);
|
||||
$this->view->assign('nameIdentifier', $nameIdentifier);
|
||||
}
|
||||
|
||||
public function matchresultAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
21
application/views/default/scripts/worldcheck/index.phtml
Normal file
21
application/views/default/scripts/worldcheck/index.phtml
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
print_r($this->message);
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
$result = array();
|
||||
foreach ($this->matches->match as $key => $value)
|
||||
{
|
||||
echo '<p>'.$this->param->dirNom.' '.$this->param->dirPrenom.'</p>';
|
||||
$result[$key] = $value;
|
||||
echo 'Match Found by: '.$result[$key]->matchFoundBy.'<br/>';
|
||||
echo 'Match Resolution: '.$result[$key]->matchResolution.'<br/>';
|
||||
echo 'Match Risk: '.$result[$key]->matchRisk.'<br/>';
|
||||
echo 'Match Score: '.$result[$key]->matchScore.'<br/>';
|
||||
}
|
||||
//print_r($this->params);
|
||||
//print_r($this->nameIdentifier);
|
||||
|
||||
?>
|
||||
|
||||
<h1></h1>
|
@ -4,7 +4,7 @@ class WsWorldCheck
|
||||
protected $webservices = array();
|
||||
protected $cacheEnable = false;
|
||||
protected $cacheWrite = false;
|
||||
protected $headerData = array();
|
||||
protected $wcData = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -16,7 +16,7 @@ class WsWorldCheck
|
||||
|
||||
$configWC = new Zend_Config_Ini('/Worldcheck/applicationWC.ini');
|
||||
$data = $configWC->toArray();
|
||||
$this->headerData = $data['worldcheck'];
|
||||
$this->wcData = $data['worldcheck'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,12 +58,12 @@ class WsWorldCheck
|
||||
{
|
||||
$headerPart = '<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">';
|
||||
$headerPart .= '<wsse:UsernameToken wsu:Id="UsernameToken-19" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">';
|
||||
$headerPart .= '<wsse:Username>'.$this->headerData['username'].'</wsse:Username>';
|
||||
$headerPart .= '<wsse:Password Type="'.$this->headerData['passwordType'].'">'.$this->headerData['password'].'</wsse:Password>';
|
||||
$headerPart .= '<wsse:Username>'.$this->wcData['username'].'</wsse:Username>';
|
||||
$headerPart .= '<wsse:Password Type="'.$this->wcData['passwordType'].'">'.$this->wcData['password'].'</wsse:Password>';
|
||||
$headerPart .= '</wsse:UsernameToken></wsse:Security>';
|
||||
|
||||
$headerVar = new SoapVar($headerPart, XSD_ANYXML);
|
||||
$header = new SoapHeader($this->headerData['namespace'], $this->headerData['securityType'], $headerVar, true);
|
||||
$header = new SoapHeader($this->wcData['namespace'], $this->wcData['securityType'], $headerVar, true);
|
||||
return $header;
|
||||
}
|
||||
|
||||
@ -78,6 +78,8 @@ class WsWorldCheck
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->screenRequest = $data;
|
||||
$params->screenRequest->groupIdentifier = $this->wcData['groupIdentifier'];
|
||||
$params->screenRequest->assigneeIdentifier = $this->wcData['assigneeIdentifier'];
|
||||
$client = $this->loadClientWC('screener');
|
||||
try {
|
||||
return $client->screen($params)->return;
|
||||
@ -285,8 +287,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('user');
|
||||
$param = new stdClass();
|
||||
$param->userIdentifierList = new stdClass;
|
||||
$param->userIdentifierList->userIdentifiers = new stdClass();
|
||||
$param->userIdentifierList->userIdentifiers->userIdentifier = $userIdentifier;
|
||||
try {
|
||||
return $client->getUserNames($param)->return;
|
||||
@ -358,8 +358,6 @@ class WsWorldCheck
|
||||
$client = $this->loadClientWC('preference');
|
||||
$param = new stdClass();
|
||||
$param->groupIdentifier = $groupIdentifier;
|
||||
$param->groupConfigVariableTypeSet = new stdClass();
|
||||
$param->groupConfigVariableTypeSet->groupConfigVariableTypes = new stdClass();
|
||||
$param->groupConfigVariableTypeSet->groupConfigVariableTypes->groupConfigVariableType = $groupConfigVariableType;
|
||||
|
||||
try {
|
||||
@ -465,14 +463,12 @@ class WsWorldCheck
|
||||
* addNote
|
||||
* @param string nameIdentifier
|
||||
* @param string note
|
||||
* @return object
|
||||
* @return string [success]
|
||||
*/
|
||||
public function addNote($nameIdentifier, $note)
|
||||
public function addNoteName($nameIdentifier, $note)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
$param->note = $note;
|
||||
|
||||
@ -488,6 +484,99 @@ class WsWorldCheck
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* archive
|
||||
* @param string nameIdentifier
|
||||
* @return string [success]
|
||||
*/
|
||||
public function archive($nameIdentifier)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
|
||||
try {
|
||||
return $client->archive($param)->return;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param string nameIdentifier
|
||||
* @return string [success]
|
||||
*/
|
||||
public function delete($nameIdentifier)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
|
||||
try {
|
||||
return $client->delete($param)->return;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* assign
|
||||
* @param string nameIdentifier
|
||||
* @param string assigneeIdentifier
|
||||
* @return string [success]
|
||||
*/
|
||||
public function assign($nameIdentifier, $assigneeIdentifier)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
$param->assigneeIdentifier = $assigneeIdentifier;
|
||||
|
||||
try {
|
||||
return $client->assign($param)->return;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* unassign
|
||||
* @param string nameIdentifier
|
||||
* @return string [success]
|
||||
*/
|
||||
public function unassign($nameIdentifier)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
|
||||
try {
|
||||
return $client->unassign($param)->return;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* changeOwner
|
||||
* @param string nameIdentifier
|
||||
@ -498,8 +587,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
$param->ownerIdentifier = $ownerIdentifier;
|
||||
|
||||
@ -546,7 +633,7 @@ class WsWorldCheck
|
||||
* @param int limit
|
||||
* @return object
|
||||
*/
|
||||
public function getMatches($nameIdentifier, $matchType, $start, $limit)
|
||||
public function getMatchesName($nameIdentifier, $matchType, $start, $limit)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
@ -556,7 +643,7 @@ class WsWorldCheck
|
||||
$param->limit = $limit;
|
||||
|
||||
try {
|
||||
return $client->getMatches($param)->return;
|
||||
return $client->getMatches($param)->return->matches;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
@ -643,8 +730,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifierList = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers = new stdClass();
|
||||
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
|
||||
|
||||
try {
|
||||
@ -671,8 +756,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('match');
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifierList = new stdClass();
|
||||
$param->matchIdentifierList->matchIdentifiers = new stdClass();
|
||||
$param->matchIdentifierList->matchIdentifiers->matchIdentifier = $matchIdentifier;
|
||||
$param->note = $note;
|
||||
|
||||
@ -724,7 +807,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('match');
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = new stdClass();
|
||||
$param->matchIdentifier = $matchIdentifier;
|
||||
|
||||
try {
|
||||
@ -748,7 +830,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('match');
|
||||
$param = new stdClass();
|
||||
$param->groupIdentifier = new stdClass();
|
||||
$param->groupIdentifier = $groupIdentifier;
|
||||
|
||||
try {
|
||||
@ -835,8 +916,6 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('match');
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifierList = new stdClass();
|
||||
$param->matchIdentifierList->matchIdentifiers = new stdClass();
|
||||
$param->matchIdentifierList->matchIdentifiers->matchIdentifier = $data->matchIdentifier;
|
||||
$param->matchRisk = $data->matchRisk;
|
||||
$param->matchStatus = $data->matchStatus;
|
||||
|
@ -2,4 +2,6 @@ worldcheck.username = ylenaour@scores-decisions.com
|
||||
worldcheck.password = accelus
|
||||
worldcheck.passwordType = http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
|
||||
worldcheck.namespace = http://screening.complinet.com/
|
||||
worldcheck.securityType = Security
|
||||
worldcheck.securityType = Security
|
||||
worldcheck.groupIdentifier = cng_so_64
|
||||
worldcheck.assigneeIdentifier = cnu_so_77
|
Loading…
Reference in New Issue
Block a user