webservice/application/controllers/IndexController.php

56 lines
1.4 KiB
PHP

<?php
class IndexController extends Zend_Controller_Action
{
protected $appConfig;
public function init(){}
public function preDispatch()
{
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()){
$this->_redirect('/user/login');
} else {
$bootstrap = $this->getInvokeArg('bootstrap');
$this->appConfig = $bootstrap->getOptions();
}
}
public function indexAction()
{
$listeWs = array(
'WsEntreprise' => array(
'titre' => 'WebService Entreprise',
'protect'=> array()
),
'WsInterne' => array(
'titre' => 'WebService Interne',
'protect'=> array('mricois', 'ylenaour', 'sbeaugrand')
),
);
$username = Zend_Auth::getInstance()->getIdentity();
$displayWs = array();
foreach($listeWs as $key => $ws)
{
if ( count($ws['protect'])>0 && !in_array($username, $ws['protect']) )
{
$displayWs[$key] = $ws;
} else {
$displayWs[$key] = $ws;
}
}
$this->view->assign('ws', $displayWs);
}
public function testAction()
{
//Connexion au service - Faire comme ci on charger le WSDL de l'extérieur
//getFunctions / getTypes
//Pour chaque Function, identifier les Types puis proposer les champs associés
//Valider les formulaires pour executer la requête du service
//Utiliser le jeux de tests disponible
}
}