2010-08-30 07:49:44 +00:00
|
|
|
<?php
|
|
|
|
class IndexController extends Zend_Controller_Action
|
|
|
|
{
|
2010-09-20 09:38:18 +00:00
|
|
|
protected $appConfig;
|
|
|
|
|
2010-09-13 09:53:55 +00:00
|
|
|
public function init()
|
2010-08-30 07:49:44 +00:00
|
|
|
{
|
|
|
|
/* Initialize action controller here */
|
|
|
|
}
|
|
|
|
|
2010-09-13 09:53:55 +00:00
|
|
|
public function preDispatch()
|
|
|
|
{
|
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
if (!$auth->hasIdentity()){
|
|
|
|
$this->_redirect('/user/login');
|
2010-09-20 09:38:18 +00:00
|
|
|
} else {
|
|
|
|
$bootstrap = $this->getInvokeArg('bootstrap');
|
|
|
|
$this->appConfig = $bootstrap->getOptions();
|
2010-09-13 09:53:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-30 07:49:44 +00:00
|
|
|
public function indexAction()
|
|
|
|
{
|
2010-10-20 14:30:23 +00:00
|
|
|
$listeWs = array(
|
|
|
|
'WsEntreprise' => array(
|
|
|
|
'titre' => 'WebService Entreprise',
|
|
|
|
'protect'=> array()
|
|
|
|
),
|
|
|
|
'WsInterne' => array(
|
|
|
|
'titre' => 'WebService Interne',
|
|
|
|
'protect'=> array('mricois', 'ylenaour', 'sbeaugrand')
|
|
|
|
),
|
|
|
|
);
|
2010-08-30 07:49:44 +00:00
|
|
|
|
2010-10-20 14:30:23 +00:00
|
|
|
$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;
|
|
|
|
}
|
2010-09-20 09:38:18 +00:00
|
|
|
}
|
2010-10-20 14:30:23 +00:00
|
|
|
$this->view->assign('ws', $displayWs);
|
2010-09-17 14:49:18 +00:00
|
|
|
}
|
2010-09-13 09:53:55 +00:00
|
|
|
|
2010-09-21 15:22:15 +00:00
|
|
|
public function testAction()
|
|
|
|
{
|
2010-10-08 07:37:43 +00:00
|
|
|
//Connexion au service - Faire comme ci on charger le WSDL de l'extérieur
|
2010-09-23 16:20:08 +00:00
|
|
|
//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
|
2010-09-21 15:22:15 +00:00
|
|
|
}
|
2010-08-30 07:49:44 +00:00
|
|
|
}
|
|
|
|
|