$hostobject = get_record('mnet_host','id', $CFG->mnet_localhost_id);
if(is_object($hostobject)) {
$temparr = get_object_vars($hostobject);
- foreach(get_object_vars($temparr) as $key => $value) {
+ foreach($temparr as $key => $value) {
$this->$key = $value;
}
unset($hostobject, $temparr);
if (!empty($keypair)) {
// Explode/Implode is faster than Unserialize/Serialize
- $this->keypair = explode('@@@@@@@@', $keypair);
+ list($this->keypair['certificate'], $this->keypair['keypair_PEM']) = explode('@@@@@@@@', $keypair);
}
if ($this->public_key_expires > time()) {
$details = openssl_x509_parse($this->public_key);
$this->public_key_expires = $details['validTo_time_t'];
- set_config('openssl', implode('@@@@@@@@', $this->keypair);
+ set_config('openssl', implode('@@@@@@@@', $this->keypair), 'mnet');
update_record('mnet_host', $this);
}