getControllerName(); $action = $request->getActionName(); if ( in_array($controller, array('service')) || ( $controller == 'user' && in_array($action, array('login', 'logout')) ) ) { //Do nothing } else { $auth = Zend_Auth::getInstance(); if ( $auth->hasIdentity() ) { $username = $auth->getIdentity()->username; $idClient = $auth->getIdentity()->idClient; $wsServices = array(); //Get all webservice client $clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php'; foreach( $clients as $section => $params ) { if ( $params['actif'] && (isset($params['idClient']) && in_array($idClient,$params['idClient'])) ) { $params['name'] = $section; $params['type'] = 'client'; if ( $idClient == 1 ) { $params['name'] = 'Client - '.ucfirst($section); } $wsServices[$section] = $params; } } //Standard service if ( count($wsServices)==0 || $idClient==1 ) { $services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php'; foreach( $services as $section => $params ) { if ( $params['actif'] ) { $params['name'] = ucfirst($section); $params['type'] = 'sd'; if ( isset($params['idClient']) && in_array($idClient,$params['idClient']) ) { if ( $idClient == 1 ) { $params['name'] = 'SD - '.ucfirst($section); } $wsServices[$section] = $params; } elseif ( !isset($params['idClient']) ) { if ( $idClient == 1 ) { $params['name'] = 'SD - '.ucfirst($section); } $wsServices[$section] = $params; } } } } $layout = Zend_Layout::getMVCInstance(); $view = $layout->getView(); $view->WsServices = $wsServices; } } // Zend_Auth::hasIdentity } }