Skip to content

Commit

Permalink
fixed multiple missing globals causing regressions especially for ope…
Browse files Browse the repository at this point in the history
…ntogoogle access
  • Loading branch information
skodak committed Sep 17, 2010
1 parent 39f4aed commit 7c25ee0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/sessionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public function write_close() {
* @return void
*/
protected function check_user_initialised() {
global $CFG;

if (isset($_SESSION['USER']->id)) {
// already set up $USER
return;
Expand Down Expand Up @@ -362,6 +364,8 @@ protected function init_session_storage() {
* @return boolean true if session found.
*/
public function session_exists($sid){
global $CFG;

$sid = clean_param($sid, PARAM_FILE);
$sessionfile = "$CFG->dataroot/sessions/sess_$sid";
return file_exists($sessionfile);
Expand Down Expand Up @@ -531,6 +535,7 @@ public function handler_write($sid, $session_data) {
}

if (isset($this->record->id)) {
$record = new object();
$record->state = 0;
$record->sid = $sid; // might be regenerating sid
$this->record->sessdata = base64_encode($session_data); // there might be some binary mess :-(
Expand Down

0 comments on commit 7c25ee0

Please sign in to comment.