Remove access to xml for all user except client 1 and 147

This commit is contained in:
Michael RICOIS 2013-12-03 11:29:24 +00:00
parent b28e1676b3
commit ce0ca8bb68
2 changed files with 5 additions and 2 deletions

View File

@ -65,7 +65,7 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
if ($page->exportable('pdf')){
$view->pdf = $page->filename('pdf', $request->getParams());
}
if ($page->exportable('xml')){
if ($page->exportable('xml') && in_array($user->getIdClient(), array(1,147)) ){
$view->xml = $page->filename('xml', $request->getParams());
}
}

View File

@ -5,12 +5,15 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
{
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$user = new Scores_Utilisateur();
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
$view = $layout->getView();
$page = new Scores_Export_Print($controller, $action);
if ($page->exportable('xml') && !empty($view->exportObjet)) {
if ($page->exportable('xml') && !empty($view->exportObjet) && in_array($user->getIdClient(), array(1,147)) ) {
$page->objectToXML($view->exportObjet, $this->_request->getParams());
}
}