removed cvs conflicts

This commit is contained in:
Lars Kneschke 2001-02-12 09:06:25 +00:00
parent b84e51fc39
commit c2c5993f1a

View File

@ -308,13 +308,61 @@
} }
} }
function appsession($location = 'default', $appname = '', $data = '##NOTHING##') function appsession($data = "##NOTHING##", $location = "default", $appname = "")
{ {
global $phpgw_info, $phpgw; global $phpgw_info, $phpgw;
if (! $appname) { if (! $appname) {
$appname = $phpgw_info['flags']['currentapp']; $appname = $phpgw_info['flags']['currentapp'];
}
/* 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.'"';
$phpgw->db->query($query,__LINE__,__FILE__);
$phpgw->db->next_record();
$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__);
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__);
} 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__);
} }
<<<<<<< class.sessions.inc.php
return $data;
}
}
function restore()
{
global $phpgw;
$serializedData = $phpgw->common->appsession();
$sessionData = unserialize($serializedData);
if (is_array($sessionData))
=======
/* This allows the user to put "" as the value. */ /* This allows the user to put "" as the value. */
if ($data == '##NOTHING##') { if ($data == '##NOTHING##') {
@ -347,14 +395,17 @@
} }
function restore() function restore()
>>>>>>> 1.33
{ {
global $phpgw; reset($sessionData);
while(list($key,$value) = each($sessionData))
$serializedData = $phpgw->common->appsession();
$sessionData = unserialize($serializedData);
if (is_array($sessionData))
{ {
<<<<<<< class.sessions.inc.php
global $$key;
$$key = $value;
$this->variableNames[$key]="registered";
#print "restored: ".$key.", $value<br>";
=======
reset($sessionData); reset($sessionData);
while(list($key,$value) = each($sessionData)) while(list($key,$value) = each($sessionData))
{ {
@ -363,8 +414,10 @@
$this->variableNames[$key]='registered'; $this->variableNames[$key]='registered';
#print 'restored: '.$key.', '.$value.'<br>'; #print 'restored: '.$key.', '.$value.'<br>';
} }
>>>>>>> 1.33
} }
} }
}
// save the current values of the variables // save the current values of the variables
function save() function save()
@ -382,8 +435,7 @@
$sessionData[$key] = $$key; $sessionData[$key] = $$key;
} }
} }
$serializedData = addslashes(serialize($sessionData)); $phpgw->common->appsession($sessionData);
$phpgw->common->appsession($serializedData);
} }
} }