mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 19:10:13 +01:00
Fixed folder re-read after adding/removing a folder
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
4d8be0ac99
commit
2b55fe00bc
@ -236,8 +236,8 @@ class ModelFolderFolder extends Model {
|
||||
$last_id = $this->db->getLastId();
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_FOLDER_USER . " (id, uid) VALUES(?,?)", array($last_id, $session->get("uid")));
|
||||
|
||||
$folders = $session->get("folders");
|
||||
if(!isset($folders[$last_id])) { array_push($folders, $last_id); $session->set("folders", $folders); }
|
||||
$folders = $this->get_folder_id_array_for_user($session->get("uid"), $session->get("admin_user"));
|
||||
$session->set("folders", $folders);
|
||||
}
|
||||
|
||||
return $this->db->countAffected();
|
||||
@ -253,8 +253,8 @@ class ModelFolderFolder extends Model {
|
||||
$query = $this->db->query("DELETE FROM " . TABLE_FOLDER . " WHERE id=?", array($id));
|
||||
$query = $this->db->query("DELETE FROM " . TABLE_FOLDER_USER . " WHERE id=? AND uid=?", array($id, $session->get("uid")));
|
||||
|
||||
$folders = $session->get("folders");
|
||||
if(isset($folders[$id])) { unset($folders[$id]); $session->set("folders", $folders); }
|
||||
$folders = $this->get_folder_id_array_for_user($session->get("uid"), $session->get("admin_user"));
|
||||
$session->set("folders", $folders);
|
||||
|
||||
// shall we delete the existing message - folder id assignments from folder_message?
|
||||
}
|
||||
@ -264,5 +264,3 @@ class ModelFolderFolder extends Model {
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user