forked from extern/egroupware
reverted my changes at appsession()
This commit is contained in:
parent
6694dca315
commit
16856ebc2b
@ -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<br>";
|
||||
}
|
||||
}
|
||||
@ -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"; }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user