diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index c85fb54397..011e898e8f 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -762,6 +762,10 @@ class baseHelper register_shutdown_function('session_write_close'); } session_start(); + + global $app; + if(isset($_SESSION['user'])) $app->user = $_SESSION['user']; + if(!isset($_SESSION['user'])) unset($app->user); } /** diff --git a/module/file/control.php b/module/file/control.php index 2bd971a910..9497660a09 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -132,7 +132,6 @@ class file extends control */ public function download($fileID, $mouse = '') { - if(session_id() != $this->app->sessionID) helper::restartSession($this->app->sessionID); $file = $this->file->getById($fileID); if(empty($file)) { diff --git a/www/index.php b/www/index.php index 72b805298c..991e4ed3b4 100644 --- a/www/index.php +++ b/www/index.php @@ -74,4 +74,6 @@ if(!$app->setParams()) return; $common->checkPriv(); $common->checkIframe(); +if(session_id() != $app->sessionID) helper::restartSession($app->sessionID); + echo $app->outputPage();