Changeset 935
- Timestamp:
- 05/19/08 16:27:06 (3 months ago)
- Files:
-
- trunk/lib/jelix/auth/jAuth.class.php (modified) (2 diffs)
- trunk/lib/jelix/auth/jAuth.class.php (modified) (2 diffs)
- trunk/lib/jelix/auth/jAuth.class.php (modified) (2 diffs)
- trunk/lib/jelix/auth/jAuth.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/auth/jAuth.class.php
r839 r935 303 303 304 304 $_SESSION[$config['session_name']] = $user; 305 jEvent::notify ('AuthLogin', array('login'=>$login));305 $persistenceEnabled = ($persistant && isset($config['persistant_enable']) && $config['persistant_enable']); 306 306 307 307 // Add a cookie for session persistance, if enabled 308 if($persist ant && isset($config['persistant_enable']) && $config['persistant_enable']) {308 if($persistenceEnabled) { 309 309 if(!isset($config['persistant_crypt_key']) || !isset($config['persistant_cookie_name'])){ 310 310 throw new jException('jelix~auth.error.persistant.incorrectconfig','persistant_cookie_name, persistant_crypt_key'); 311 311 } 312 $cookieDuration=24*3600; 312 313 313 if(isset($config['persistant_duration'])) 314 314 $cookieDuration=$config['persistant_duration']*86400; 315 else 316 $cookieDuration=86400; // 24h 315 317 $cookieDuration+=time(); 316 318 $encryptedPassword=jCrypt::encrypt($password,$config['persistant_crypt_key']); … … 318 320 setcookie($config['persistant_cookie_name'].'[passwd]', $encryptedPassword, $cookieDuration, $config['persistant_cookie_path']); 319 321 } 322 323 jEvent::notify ('AuthLogin', array('login'=>$login, 'persistenceEnabled'=>$persistenceEnabled)); 320 324 return true; 321 325 }else trunk/lib/jelix/auth/jAuth.class.php
r839 r935 303 303 304 304 $_SESSION[$config['session_name']] = $user; 305 jEvent::notify ('AuthLogin', array('login'=>$login));305 $persistenceEnabled = ($persistant && isset($config['persistant_enable']) && $config['persistant_enable']); 306 306 307 307 // Add a cookie for session persistance, if enabled 308 if($persist ant && isset($config['persistant_enable']) && $config['persistant_enable']) {308 if($persistenceEnabled) { 309 309 if(!isset($config['persistant_crypt_key']) || !isset($config['persistant_cookie_name'])){ 310 310 throw new jException('jelix~auth.error.persistant.incorrectconfig','persistant_cookie_name, persistant_crypt_key'); 311 311 } 312 $cookieDuration=24*3600; 312 313 313 if(isset($config['persistant_duration'])) 314 314 $cookieDuration=$config['persistant_duration']*86400; 315 else 316 $cookieDuration=86400; // 24h 315 317 $cookieDuration+=time(); 316 318 $encryptedPassword=jCrypt::encrypt($password,$config['persistant_crypt_key']); … … 318 320 setcookie($config['persistant_cookie_name'].'[passwd]', $encryptedPassword, $cookieDuration, $config['persistant_cookie_path']); 319 321 } 322 323 jEvent::notify ('AuthLogin', array('login'=>$login, 'persistenceEnabled'=>$persistenceEnabled)); 320 324 return true; 321 325 }else trunk/lib/jelix/auth/jAuth.class.php
r839 r935 303 303 304 304 $_SESSION[$config['session_name']] = $user; 305 jEvent::notify ('AuthLogin', array('login'=>$login));305 $persistenceEnabled = ($persistant && isset($config['persistant_enable']) && $config['persistant_enable']); 306 306 307 307 // Add a cookie for session persistance, if enabled 308 if($persist ant && isset($config['persistant_enable']) && $config['persistant_enable']) {308 if($persistenceEnabled) { 309 309 if(!isset($config['persistant_crypt_key']) || !isset($config['persistant_cookie_name'])){ 310 310 throw new jException('jelix~auth.error.persistant.incorrectconfig','persistant_cookie_name, persistant_crypt_key'); 311 311 } 312 $cookieDuration=24*3600; 312 313 313 if(isset($config['persistant_duration'])) 314 314 $cookieDuration=$config['persistant_duration']*86400; 315 else 316 $cookieDuration=86400; // 24h 315 317 $cookieDuration+=time(); 316 318 $encryptedPassword=jCrypt::encrypt($password,$config['persistant_crypt_key']); … … 318 320 setcookie($config['persistant_cookie_name'].'[passwd]', $encryptedPassword, $cookieDuration, $config['persistant_cookie_path']); 319 321 } 322 323 jEvent::notify ('AuthLogin', array('login'=>$login, 'persistenceEnabled'=>$persistenceEnabled)); 320 324 return true; 321 325 }else trunk/lib/jelix/auth/jAuth.class.php
r839 r935 303 303 304 304 $_SESSION[$config['session_name']] = $user; 305 jEvent::notify ('AuthLogin', array('login'=>$login));305 $persistenceEnabled = ($persistant && isset($config['persistant_enable']) && $config['persistant_enable']); 306 306 307 307 // Add a cookie for session persistance, if enabled 308 if($persist ant && isset($config['persistant_enable']) && $config['persistant_enable']) {308 if($persistenceEnabled) { 309 309 if(!isset($config['persistant_crypt_key']) || !isset($config['persistant_cookie_name'])){ 310 310 throw new jException('jelix~auth.error.persistant.incorrectconfig','persistant_cookie_name, persistant_crypt_key'); 311 311 } 312 $cookieDuration=24*3600; 312 313 313 if(isset($config['persistant_duration'])) 314 314 $cookieDuration=$config['persistant_duration']*86400; 315 else 316 $cookieDuration=86400; // 24h 315 317 $cookieDuration+=time(); 316 318 $encryptedPassword=jCrypt::encrypt($password,$config['persistant_crypt_key']); … … 318 320 setcookie($config['persistant_cookie_name'].'[passwd]', $encryptedPassword, $cookieDuration, $config['persistant_cookie_path']); 319 321 } 322 323 jEvent::notify ('AuthLogin', array('login'=>$login, 'persistenceEnabled'=>$persistenceEnabled)); 320 324 return true; 321 325 }else
