Changeset 4991 in subversion
- Timestamp:
- Jul 30, 2011 11:32:13 AM (23 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 4 edited
-
config/main.inc.php.dist (modified) (1 diff)
-
index.php (modified) (4 diffs)
-
program/include/rcube_session.php (modified) (4 diffs)
-
program/js/app.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/config/main.inc.php.dist
r4963 r4991 41 41 // Log successful logins to <log_dir>/userlogins or to syslog 42 42 $rcmail_config['log_logins'] = false; 43 44 // Log session authentication errors to <log_dir>/session or to syslog 45 $rcmail_config['log_session'] = false; 43 46 44 47 // Log SQL queries to <log_dir>/sql or to syslog -
trunk/roundcubemail/index.php
r4807 r4991 121 121 // allow plugins to control the redirect url after login success 122 122 $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail')); 123 unset($redir['abort'] );123 unset($redir['abort'], $redir['_err']); 124 124 125 125 // send redirect … … 148 148 else if ($RCMAIL->task != 'login' && $_SESSION['user_id'] && $RCMAIL->action != 'send') { 149 149 if (!$RCMAIL->session->check_auth()) { 150 $OUTPUT->show_message('sessionerror', 'error');151 150 $RCMAIL->kill_session(); 151 $session_error = true; 152 152 } 153 153 } … … 155 155 // not logged in -> show login page 156 156 if (empty($RCMAIL->user->ID)) { 157 // log session failures 158 if ($RCMAIL->task != 'login' && !$session_error && ($sess_id = $_COOKIE[ini_get('session.name')])) { 159 $RCMAIL->session->log("Aborted session " . $sess_id . "; no valid session data found"); 160 $session_error = true; 161 } 162 157 163 if ($OUTPUT->ajax_call) 158 $OUTPUT->redirect(array( ), 2000);164 $OUTPUT->redirect(array('_err' => 'session'), 2000); 159 165 160 166 if (!empty($_REQUEST['_framed'])) 161 $OUTPUT->command('redirect', '?');167 $OUTPUT->command('redirect', $RCMAIL->url(array('_err' => 'session'))); 162 168 163 169 // check if installer is still active … … 172 178 ); 173 179 } 180 181 if ($session_error || $_REQUEST['_err'] == 'session') 182 $OUTPUT->show_message('sessionerror', 'error', null, true, -1); 174 183 175 184 $RCMAIL->set_task('login'); -
trunk/roundcubemail/program/include/rcube_session.php
r4782 r4991 43 43 private $secret = ''; 44 44 private $ip_check = false; 45 private $logging = false; 45 46 private $keep_alive = 0; 46 47 private $memcache; … … 54 55 $this->start = microtime(true); 55 56 $this->ip = $_SERVER['REMOTE_ADDR']; 57 $this->logging = $config->get('log_session', false); 56 58 57 59 $lifetime = $config->get('session_lifetime', 1) * 60; … … 566 568 $result = $this->ip_check ? $_SERVER['REMOTE_ADDR'] == $this->ip : true; 567 569 570 if (!$result) 571 $this->log("IP check failed for " . $this->key . "; expected " . $this->ip . "; got " . $_SERVER['REMOTE_ADDR']); 572 568 573 if ($result && $this->_mkcookie($this->now) != $this->cookie) { 569 574 // Check if using id from previous time slot 570 if ($this->_mkcookie($this->prev) == $this->cookie) 575 if ($this->_mkcookie($this->prev) == $this->cookie) { 571 576 $this->set_auth_cookie(); 572 else 577 } 578 else { 573 579 $result = false; 580 $this->log("Session authentication failed for " . $this->key . "; invalid auth cookie sent"); 581 } 574 582 } 575 583 … … 599 607 return "S" . (function_exists('sha1') ? sha1($auth_string) : md5($auth_string)); 600 608 } 609 610 /** 611 * 612 */ 613 function log($line) 614 { 615 if ($this->logging) 616 write_log('session', $line); 617 } 601 618 602 619 } -
trunk/roundcubemail/program/js/app.js
r4990 r4991 5154 5154 } 5155 5155 5156 window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); 5156 if (timeout > 0) 5157 window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); 5157 5158 return id; 5158 5159 };
Note: See TracChangeset
for help on using the changeset viewer.
