Changeset 136
- Timestamp:
- 06/27/07 13:46:19 (2 years ago)
- Files:
-
- trunk/Framework/Auth/Vpopmail.php (modified) (1 diff)
- trunk/Framework/Module/Login.php (modified) (2 diffs)
- trunk/Framework/Module/Logout (deleted)
- trunk/Framework/Module/Logout.php (deleted)
- trunk/Framework/Site/Default/config.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Framework/Auth/Vpopmail.php
r129 r136 7 7 public function authenticate() 8 8 { 9 // Check timeout 10 $time = time(); 11 $lastActionTime = $this->session->__get('lastActionTime'); 12 $timeLimit = (int)Framework::$site->config->inactiveTimeout; 13 if($this->user->debug == 1); 14 $this->log->log("timeout info: time: $time, lastActionTime: $lastActionTime, timeLimit: $timeLimit"); 15 if(($time - $lastActionTime) > $timeLimit) { 16 header('Location: ./?module=Login&event=logoutInactive'); 17 return false; 18 } 19 20 // Authenticate 9 21 $encryptedPass = $this->session->__get('password'); 10 22 $plainPass = Framework_User_passEncryption::decryptPass($encryptedPass, (string)Framework::$site->config->mcryptKey); 11 23 if(!PEAR::isError($this->user->authenticate($this->session->__get('email'), $plainPass))) { 24 $this->session->__set('lastActionTime', $time); 12 25 $this->setData('logged_in_as', $this->session->__get('email')); 13 26 $this->setData('LANG_logged_in_as', _('logged in as')); trunk/Framework/Module/Login.php
r129 r136 41 41 if(!PEAR::isError($result)) { 42 42 $emailArray = explode('@', $_POST['email']); 43 $this->session->user = $emailArray[0]; 44 $this->session->domain = $emailArray[1]; 45 $this->session->email = $_POST['email']; 46 $this->session->password = Framework_User_passEncryption::encryptPass($_POST['password'], 47 (string)Framework::$site->config->mcryptKey); 43 $this->session->__set('user', $emailArray[0]); 44 $this->session->__set('domain', $emailArray[1]); 45 $this->session->__set('email', $_POST['email']); 46 $this->session->__set('password', Framework_User_passEncryption::encryptPass($_POST['password'], 47 (string)Framework::$site->config->mcryptKey)); 48 $this->session->__set('lastActionTime', time()); 48 49 header("Location: ./index.php?module=Domains"); 49 50 } else { 50 51 $this->setData('loginError', $result->getMessage()); 51 52 $this->setData('QF_Form', $form->toHtml()); 52 $this->session-> email = null;53 $this->session-> password = null;53 $this->session->__set('email', null); 54 $this->session->__set('password', null); 54 55 return; 55 56 } … … 76 77 } 77 78 79 function logoutNow() { 80 $this->session->destroy(); 81 $this->setData('message', _('Logged out successfully')); 82 return $this->__default(); 83 } 84 85 function logoutInactive() { 86 $this->session->destroy(); 87 $this->setData('message', _('You have been logged out automatically for inactivity')); 88 return $this->__default(); 89 } 90 78 91 } 79 92 trunk/Framework/Site/Default/config.xml
r130 r136 1 1 <?xml version="1.0" ?> 2 2 <framework> 3 <!-- set to 1 to send debug info to logFile --> 4 <debug>0</debug> 3 5 <vpopmaildHost>home.shupp.org</vpopmaildHost> 4 6 <vpopmaildPort>89</vpopmaildPort> 5 <debug>0</debug> 7 <!-- inactivity timeout - in seconds --> 8 <inactiveTimeout>300</inactiveTimeout> 6 9 <mcryptKey>My Secret Key</mcryptKey> 7 10 <maxPerPage>10</maxPerPage>
