Autorisé les connexions de tous les utilisateurs actifs
This commit is contained in:
parent
43990a22fc
commit
33927fc6dc
@ -22,11 +22,17 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
if ($checkAuth) {
|
||||
$login = $request->getParam('login');
|
||||
$pass = $request->getParam('pass', '');
|
||||
|
||||
$hach = $request->getParam('hach');
|
||||
if (!empty($hach)) {
|
||||
$pass = $hach;
|
||||
}
|
||||
$checkIp = $request->getParam('checkIp');
|
||||
// --- Est ce que l'on a checkIp=only lors de la requête
|
||||
$iponly = false;
|
||||
if ($checkIp == 'only') {
|
||||
$hach = 'iponly:'.$_SERVER['REMOTE_ADDR'];
|
||||
$iponly = true;
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
@ -40,7 +46,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$session = new Zend_Session_Namespace($storage->getNamespace());
|
||||
//$session->setExpirationSeconds(86400);
|
||||
$auth->setStorage($storage);
|
||||
|
||||
} else {
|
||||
@ -118,34 +123,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
|
||||
}
|
||||
|
||||
// --- No contrat define
|
||||
if ( $identity->dateContrat == '0000-00-00 00:00:00' || $identity->dateContrat === null ) {
|
||||
// --- If no params are detected, display a message to contact support
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('aide')
|
||||
->setActionName('message')
|
||||
->setParam('typeMsg', 'support');
|
||||
}
|
||||
// --- Check dateContrat and calculate end of contrat
|
||||
else {
|
||||
|
||||
$hour = intval(substr($identity->dateContrat,11,2));
|
||||
$min = intval(substr($identity->dateContrat,14,2));
|
||||
$sec = intval(substr($identity->dateContrat,17,2));
|
||||
$month = intval(substr($identity->dateContrat,5,2)) + $identity->periodContrat;
|
||||
$day = intval(substr($identity->dateContrat,8,2));
|
||||
$year = intval(substr($identity->dateContrat,0,4));
|
||||
$dateFinContrat = mktime($hour,$min,$sec,$month,$day,$year);
|
||||
|
||||
if ( time() > $dateFinContrat ) {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('user')
|
||||
->setActionName('logout')
|
||||
->setParam('message', "Votre Contrat est arrivé à expiration.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// --- Sauvegarde des paramètres
|
||||
$auth->getStorage()->write($identity);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user