mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Renew Phrasea Session after collection creation
This commit is contained in:
@@ -315,6 +315,25 @@ class Session_Handler
|
||||
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
|
||||
*
|
||||
|
@@ -551,6 +551,8 @@ class collection implements cache_cacheableInterface
|
||||
phrasea::reset_baseDatas();
|
||||
self::set_admin($new_bas, $user);
|
||||
|
||||
$appbox->get_session()->renew_phrasea_session();
|
||||
|
||||
return self::get_from_coll_id($databox, $new_id);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user