From 16856ebc2b7c05f26af60c4490ea8ada34e12cc1 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Mon, 12 Feb 2001 13:43:37 +0000 Subject: [PATCH] reverted my changes at appsession() --- phpgwapi/inc/class.sessions.inc.php | 61 +++++++++++++++-------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index b9900190e7..bb63db6806 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -296,19 +296,20 @@ $this->hooks = $phpgw->hooks->read(); } - function save_repositories() - { - global $phpgw, $phpgw_info; - $phpgw_info_temp = $phpgw_info; - $phpgw_info_temp['user']['kp3'] = ''; - $phpgw_info_temp['flags'] = array(); + function save_repositories() + { + global $phpgw, $phpgw_info; + + $phpgw_info_temp = $phpgw_info; + $phpgw_info_temp['user']['kp3'] = ''; + $phpgw_info_temp['flags'] = array(); + + if ($phpgw_info['server']['cache_phpgw_info']) { + $this->appsession('phpgw_info_cache','phpgwapi',$phpgw_info_temp); + } + } - if ($phpgw_info['server']['cache_phpgw_info']) { - $this->appsession('phpgw_info_cache','phpgwapi',$phpgw_info_temp); - } - } - - function appsession($data = '##NOTHING##', $location = 'default', $appname = '') + function appsession($location = "default", $appname = "", $data = "##NOTHING##") { global $phpgw_info, $phpgw; @@ -316,38 +317,38 @@ $appname = $phpgw_info['flags']['currentapp']; } - /* This allows the user to put '' as the value. */ - if ($data == '##NOTHING##') { + /* This allows the user to put "" as the value. */ + if ($data == "##NOTHING##") { $query = 'select content from phpgw_app_sessions where' - ." sessionid = '".$this->sessionid."' and loginid = '".$this->account_id."'" - ." and app = '".$appname."' and location = '".$location."'"; + .' sessionid = "'.$this->sessionid.'" and loginid = "'.$this->account_id.'"' + .' and app = "'.$appname.'" and location = "'.$location.'"'; $phpgw->db->query($query,__LINE__,__FILE__); $phpgw->db->next_record(); - $data = $phpgw->db->f('content'); + $data = $phpgw->db->f("content"); #$data = $phpgw->common->decrypt($data); return $data; } else { $phpgw->db->query('select content from phpgw_app_sessions where ' - . "sessionid = '".$this->sessionid."' and loginid = '".$this->account_id."' " - . "and app = '".$appname."' and location = '".$location."'",__LINE__,__FILE__); + . 'sessionid = "'.$this->sessionid.'" and loginid = "'.$this->account_id.'" ' + . 'and app = "'.$appname.'" and location = "'.$location.'"',__LINE__,__FILE__); if ($phpgw->db->num_rows()==0) { # some how the next line is not working correctly! knecke # $data = addslashes($phpgw->crypto->encrypt(serialize($data))); $data = addslashes(serialize($data)); $phpgw->db->query('INSERT INTO phpgw_app_sessions (sessionid,loginid,app,location,content) ' - . "VALUES ('".$this->sessionid."','".$this->account_id."','".$appname - . "','".$location."','".$data."')",__LINE__,__FILE__); + . 'VALUES ("'.$this->sessionid.'","'.$this->account_id.'","'.$appname + . '","'.$location.'","'.$data.'")',__LINE__,__FILE__); } else { # some how the next line is not working correctly! knecke # $data = addslashes($phpgw->crypto->encrypt(serialize($data))); $data = addslashes(serialize($data)); - $phpgw->db->query("update phpgw_app_sessions set content = '".$data."' " - . "where sessionid = '".$this->sessionid."' " - . "and loginid = '".$this->account_id."' and app = '".$appname."' " - . "and location = '".$location."'",__LINE__,__FILE__); + $phpgw->db->query('update phpgw_app_sessions set content = "'.$data.'" ' + . 'where sessionid = "'.$this->sessionid.'" ' + . 'and loginid = "'.$this->account_id.'" and app = "'.$appname.'" ' + . 'and location = "'.$location.'"',__LINE__,__FILE__); } return $data; @@ -368,7 +369,7 @@ { global $$key; $$key = $value; - $this->variableNames[$key]='registered'; + $this->variableNames[$key]="registered"; #print "restored: ".$key.", $value
"; } } @@ -461,14 +462,14 @@ $phpgw_info['server']['usecookies']) { if ($extravars) { $url .= "?$extravars"; } } else { - $url .= '?sessionid=' . $phpgw_info['user']['sessionid']; - $url .= '&kp3=' . $kp3; - $url .= '&domain=' . $phpgw_info['user']['domain']; + $url .= "?sessionid=" . $phpgw_info['user']['sessionid']; + $url .= "&kp3=" . $kp3; + $url .= "&domain=" . $phpgw_info['user']['domain']; // This doesn't belong in the API. // Its up to the app to pass this value. (jengo) // Putting it into the app requires a massive number of updates in email app. // Until that happens this needs to stay here (seek3r) - if ($phpgw_info['flags']['newsmode']) { $url .= '&newsmode=on'; } + if ($phpgw_info['flags']['newsmode']) { $url .= "&newsmode=on"; } if ($extravars) { $url .= "&$extravars"; } }