From 49e45b13c88aaed391d1dae9e60ae7eac1a57b44 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 29 Nov 2014 14:06:15 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20fonction=20logout=20si=20d=C3=A9connect?= =?UTF-8?q?=C3=A9=20en=20ajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/js/scripts.js | 16 +++++++++++++++- include/ac_common.php | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/html/js/scripts.js b/html/js/scripts.js index 3b4c4c45d..7f2d2ae62 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -1958,7 +1958,8 @@ function display_task(p_id) }} ); $(p_id).style.top = posY+'px'; - $(p_id).style.left = posX+'px'; + $(p_id).style.left = "10%"; + $(p_id).style.width= "80%"; $(p_id).style.display = 'block'; } @@ -2634,4 +2635,17 @@ function unselect_other_tab(p_tab) } catch(e) { if ( console ) console.log(e.message); } +} +/** + * logout function call from ajax + * @see ajax_disconnected + * @returns {undefined} + */ +function logout() +{ + var tmp_place = window.location.href + var tmp_b=tmp_place.split('/') + var tmp_last=tmp_b.length-1 + var place_logout=tmp_place.replace(tmp_b[tmp_last],'logout.php'); + window.location.href=place_logout; } \ No newline at end of file diff --git a/include/ac_common.php b/include/ac_common.php index 55eb551e0..200f0db88 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -784,8 +784,8 @@ function ajax_disconnected($div) $html.=h2(_('Données non disponibles'), 'class="title" style="width:auto"'); $html.=h2(_('Veuillez vous reconnecter'), 'class="error"'); $html.=alert(_("Déconnecté"), true); + $html.=""; $html = escape_xml($html); - header('Content-type: text/xml; charset=UTF-8'); echo <<