From 6694dca315e9fd727607a31191569e52298ca0f2 Mon Sep 17 00:00:00 2001 From: skeeter Date: Mon, 12 Feb 2001 12:22:29 +0000 Subject: [PATCH] fix for pgsql not liking the " instead of \' --- phpgwapi/inc/class.sessions.inc.php | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index bb59608b45..b9900190e7 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -308,7 +308,7 @@ } } - function appsession($data = "##NOTHING##", $location = "default", $appname = "") + function appsession($data = '##NOTHING##', $location = 'default', $appname = '') { global $phpgw_info, $phpgw; @@ -316,38 +316,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 +368,7 @@ { global $$key; $$key = $value; - $this->variableNames[$key]="registered"; + $this->variableNames[$key]='registered'; #print "restored: ".$key.", $value
"; } } @@ -461,14 +461,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"; } }