[1040] | 1 | <?php |
---|
[2364] | 2 | |
---|
| 3 | /*************************************************************************** |
---|
| 4 | * Expresso Livre * |
---|
| 5 | * http://www.expressolivre.org * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/ |
---|
[2335] | 12 | if ( isset( $_COOKIE[ 'sessionid' ] ) ) |
---|
| 13 | session_id( $_COOKIE[ 'sessionid' ] ); |
---|
| 14 | |
---|
[1061] | 15 | session_start( ); |
---|
| 16 | $sess = $_SESSION[ 'phpgw_session' ]; |
---|
[2329] | 17 | $connection_id = "{$sess['session_id']}{$sess['session_ip']}".substr($_SERVER[ 'HTTP_USER_AGENT' ],0,199); |
---|
| 18 | |
---|
| 19 | if ( empty($_SESSION['phpgw_session']['session_id']) || |
---|
| 20 | ($_SESSION['connection_db_info']['user_auth'] && implode('',$_SESSION['connection_db_info']['user_auth']) !== $connection_id) |
---|
| 21 | ) |
---|
| 22 | { |
---|
| 23 | if($_SESSION['connection_db_info']['user_auth'] && !strstr($_SERVER['SCRIPT_URL'],"/controller.php")) |
---|
| 24 | error_log( '[ INVALID SESSION ] >>>>' . implode('',$_SESSION['connection_db_info']['user_auth']) . '<<<< - >>>>' . $connection_id . '<<<<', 0 ); |
---|
[1040] | 25 | |
---|
[1161] | 26 | setcookie("PHPSESSID","",0); |
---|
[2065] | 27 | setcookie ("sessionid","",0); |
---|
[2329] | 28 | unset($_SESSION); |
---|
[2332] | 29 | // From ExpressoAjax response "nosession" |
---|
[2329] | 30 | if(strstr($_SERVER['SCRIPT_URL'],"/controller.php")){ |
---|
| 31 | echo serialize(array("nosession" => true)); |
---|
| 32 | exit; |
---|
| 33 | } |
---|
[1040] | 34 | } |
---|
[2329] | 35 | else{ |
---|
[2332] | 36 | // From ExpressoAjax update session_dla (datetime last access). |
---|
| 37 | if(strstr($_SERVER['SCRIPT_URL'],"/controller.php")) |
---|
| 38 | $_SESSION['phpgw_session']['session_dla'] = time(); |
---|
[2329] | 39 | } |
---|
| 40 | ?> |
---|