webservice/application/controllers/IndexController.php

59 lines
1.4 KiB
PHP
Raw Normal View History

2010-08-30 07:49:44 +00:00
<?php
class IndexController extends Zend_Controller_Action
{
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');
} 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()
{
$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
$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);
}
2010-09-13 09:53:55 +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-08-30 07:49:44 +00:00
}