Renew Phrasea Session after collection creation

This commit is contained in:
Romain Neutron
2012-04-04 15:01:43 +02:00
parent 1719adadc5
commit 545ea1f75a
2 changed files with 21 additions and 0 deletions

View File

@@ -315,6 +315,25 @@ class Session_Handler
return isset($_COOKIE[$name]); return isset($_COOKIE[$name]);
} }
public function renew_phrasea_session()
{
if (!$this->phrasea_session instanceof Session_Phrasea)
throw new \Exception('No phrasea session available');
$this->phrasea_session->close();
$user = \User_Adapter::getInstance($this->get_usr_id(), $this->appbox);
$this->phrasea_session = new Session_Phrasea($this->appbox, $user);
$this->phrasea_session->create(\Browser::getInstance());
$this->phrasea_session->open();
$ses_id = $this->phrasea_session->get_id();
$this->storage()->set('usr_id', $user->get_id());
$this->storage()->set('ses_id', $ses_id);
}
/** /**
* Open the phrasea session * Open the phrasea session
* *

View File

@@ -551,6 +551,8 @@ class collection implements cache_cacheableInterface
phrasea::reset_baseDatas(); phrasea::reset_baseDatas();
self::set_admin($new_bas, $user); self::set_admin($new_bas, $user);
$appbox->get_session()->renew_phrasea_session();
return self::get_from_coll_id($databox, $new_id); return self::get_from_coll_id($databox, $new_id);
} }