Correct condition

This commit is contained in:
Michael RICOIS 2012-08-01 12:07:42 +00:00
parent b4ddca623b
commit 7c574d164e

View File

@ -76,7 +76,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$identity->time = time() + $identity->timeout;
$layout = Zend_Layout::getMVCInstance();
if ( !empty($identity->dateContrat) && $layout->isEnabled() )
if ( !isset($identity->dateContrat) && $layout->isEnabled() )
{
//Get customer's params
$paramsM = new Application_Model_CustomerParams();
@ -84,7 +84,8 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
->where('idClient = ?', $identity->idClient)
//@todo : add service from WebService
->order('dateContrat DESC')->limit(1);
Zend_Registry::get('firebug')->info($sql->__toString());
$params = $paramsM->fetchAll($sql)->toArray();
if (count($params)>0) {
$identity->filterRNCS = $params[0]['filterRNCS'];
@ -115,8 +116,10 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
}
}
Zend_Registry::get('firebug')->info($identity);
//No contrat define
if ( $identity->dateContrat!='0000-00-00 00:00:00' ) {
if ( $identity->dateContrat=='0000-00-00 00:00:00' ) {
//If no params are detected, display a message to contact support
$request->setModuleName('default')
->setControllerName('aide')