mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-02 12:54:18 +01:00
Fixes to work with the new crypto class.
This commit is contained in:
parent
7e2334d9c7
commit
51e871070c
@ -388,7 +388,7 @@
|
|||||||
// Changed by Skeeter 2001 Mar 04 0400Z
|
// Changed by Skeeter 2001 Mar 04 0400Z
|
||||||
// This was not properly decoding structures saved into session data properly
|
// This was not properly decoding structures saved into session data properly
|
||||||
// $data = $phpgw->common->decrypt($data);
|
// $data = $phpgw->common->decrypt($data);
|
||||||
// $data = stripslashes($data);
|
// return stripslashes($data);
|
||||||
return $phpgw->crypto->decrypt($data);
|
return $phpgw->crypto->decrypt($data);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -396,25 +396,18 @@
|
|||||||
. "sessionid = '".$this->sessionid."' and loginid = '".$this->account_id."'"
|
. "sessionid = '".$this->sessionid."' and loginid = '".$this->account_id."'"
|
||||||
. "and app = '".$appname."' and location = '".$location."'",__LINE__,__FILE__);
|
. "and app = '".$appname."' and location = '".$location."'",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$encrypteddata = $phpgw->crypto->encrypt($data);
|
||||||
if ($phpgw->db->num_rows()==0) {
|
if ($phpgw->db->num_rows()==0) {
|
||||||
|
|
||||||
// I added these into seperate steps for easier debugging
|
|
||||||
$data = $phpgw->crypto->encrypt($data);
|
|
||||||
$data = addslashes($data);
|
|
||||||
|
|
||||||
$phpgw->db->query("INSERT INTO phpgw_app_sessions (sessionid,loginid,app,location,content,session_dla) "
|
$phpgw->db->query("INSERT INTO phpgw_app_sessions (sessionid,loginid,app,location,content,session_dla) "
|
||||||
. "VALUES ('".$this->sessionid."','".$this->account_id."','".$appname
|
. "VALUES ('".$this->sessionid."','".$this->account_id."','".$appname
|
||||||
. "','".$location."','".$data."','" . time() . "')",__LINE__,__FILE__);
|
. "','".$location."','".$encrypteddata."','" . time() . "')",__LINE__,__FILE__);
|
||||||
} else {
|
} else {
|
||||||
$data = $phpgw->crypto->encrypt($data);
|
$phpgw->db->query("update phpgw_app_sessions set content = '".$encrypteddata."'"
|
||||||
$data = addslashes($data);
|
|
||||||
$phpgw->db->query("update phpgw_app_sessions set content = '".$data."'"
|
|
||||||
. "where sessionid = '".$this->sessionid."'"
|
. "where sessionid = '".$this->sessionid."'"
|
||||||
. "and loginid = '".$this->account_id."' and app = '".$appname."'"
|
. "and loginid = '".$this->account_id."' and app = '".$appname."'"
|
||||||
. "and location = '".$location."'",__LINE__,__FILE__);
|
. "and location = '".$location."'",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
|
return $data;
|
||||||
return unserialize($data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user