Skip to content
Snippets Groups Projects
Commit 9c7cbdf8 authored by Damien's avatar Damien
Browse files

FIX #5536 Unset session after attachment modal

parent 3f5a0e58
No related branches found
No related tags found
No related merge requests found
......@@ -102,7 +102,6 @@ if(isset($_GET['created']) && $_GET['created'] <> ''){
?>
<script type="text/javascript">
set_new_contact_address("<?php echo $_SESSION['config']['businessappurl'] . 'index.php?display=false&dir=my_contacts&page=get_last_contact_address';?>", "<?php functions::xecho($createContactDiv);?>", "true", "<?php echo $_SESSION['transmissionInput'];?>");
simpleAjax("<?php echo $_SESSION['config']['businessappurl'].'index.php?display=true&page=unsetAttachmentContact' ;?>");
</script>
<?php
}
......
......@@ -29,16 +29,18 @@
* @ingroup apps
*/
$core = new core_tools();
$core->test_user();
$core = new core_tools();
$core->test_user();
$db = new Database();
$db = new Database();
if ($_REQUEST['mode'] == 'add') {
$tableName = "res_attachments";
} else if($_REQUEST['mode'] == 'edit'){
$tableName = "res_version_attachments";
}
if ($_REQUEST['mode'] == 'add') {
$tableName = "res_attachments";
} else if($_REQUEST['mode'] == 'edit'){
$tableName = "res_version_attachments";
}
$db->query("DELETE FROM ".$tableName." WHERE res_id_master = ? and status = 'TMP' and typist = ?", [$_SESSION['doc_id'], $_SESSION['user']['UserId']]);
unset($_SESSION['attachmentInfo']);
$db->query("DELETE FROM ".$tableName." WHERE res_id_master = ? and status = 'TMP' and typist = ?", [$_SESSION['doc_id'], $_SESSION['user']['UserId']]);
unset($_SESSION['attachmentInfo']);
unset($_SESSION['AttachmentContact']);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment