diff --git a/.gitattributes b/.gitattributes index e6f2aa66..54381ef2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -356,6 +356,7 @@ bureau/admin/styles/style-bluedesktop10.css -text bureau/admin/styles/style-empty.css -text bureau/admin/styles/style-hw.css -text bureau/admin/styles/style.css -text +bureau/admin/tempovars.php -text bureau/admin/trash_dateselect.php -text bureau/admin/webmail-redirect.php -text bureau/class/config.php -text diff --git a/bureau/admin/js/alternc.js b/bureau/admin/js/alternc.js index 7031738e..0b0dc755 100644 --- a/bureau/admin/js/alternc.js +++ b/bureau/admin/js/alternc.js @@ -202,6 +202,16 @@ function is_valid_mail(arg) { function menu_toggle(id) { $("#"+id).toggle(); + +/* Pour quand on voudra enregistrer l'etat du menu ;) + var tmp = {}; + if( $('#'+id).is(':visible') ) { + tmp[''+id] = 'visible'; + } else { + tmp[''+id] = 'hidden'; + } + $.post('tempovars.php', { 'key' : 'menu_toggle', 'val' : tmp }) +*/ } function false_if_empty(id,err_msg) { diff --git a/bureau/admin/tempovars.php b/bureau/admin/tempovars.php new file mode 100644 index 00000000..d3314771 --- /dev/null +++ b/bureau/admin/tempovars.php @@ -0,0 +1,29 @@ + voir commentaire en bas de la classe m_mem + +require_once("../class/config.php"); + +// Don't uset getfields because we could have serialised object + +if ( empty($_POST['key']) || empty($_POST['val']) ) { + die('1'); +} + +$key=$_POST['key']; +$val=$_POST['val']; + +if (empty($val)) { + die('2'); +} + +if ( $mem->session_tempo_params_set($key, $val) ) { + die('0'); +} +die('3'); + + +?> diff --git a/bureau/class/m_debug_alternc.php b/bureau/class/m_debug_alternc.php index bdeb2dc4..15601ac4 100644 --- a/bureau/class/m_debug_alternc.php +++ b/bureau/class/m_debug_alternc.php @@ -72,6 +72,8 @@ class m_debug_alternc { print_r($_GET); echo "\n\n--- POST ---\n"; print_r($_POST); + echo "\n\n--- SESSION ---\n"; + @print_r($_SESSION); echo "\n\n--- COOKIE ---\n"; print_r($_COOKIE); echo "\n\n--- SERVER ---\n"; diff --git a/bureau/class/m_mem.php b/bureau/class/m_mem.php index 40f1538b..624f6460 100644 --- a/bureau/class/m_mem.php +++ b/bureau/class/m_mem.php @@ -582,8 +582,38 @@ Cordially. return $str; } +/* + // Embryon pour stocker une variable "le temps d'une session". + // Mis en pause car il faudrait faire session_start pour avoir $_SESSION + // Donc peux y avoir des effets de bords... fun... + function session_tempo_params_get($v) { + $sid=$_COOKIE['session']; + if ( empty($_SESSION[$sid]) ) { // si pas de session de params tempo + return false; + } + $j=$_SESSION[$sid]; + $j=unserialize($j); + if ( ! empty( $j[$v] ) ) { // si on a bien qque chose a retourner :) + return $j[$v]; + } + return false; + } + function session_tempo_params_set($k, $v, $ecrase=false) { + $sid=$_COOKIE['session']; + $p=Array(); + if ( ! empty($_SESSION[$sid]) ) { + $p = unserialize($_SESSION[$sid]); + } + if (! $ecrase && (isset($p[$k]) && is_array($p[$k])) && is_array($v) ) { + $v=array_merge($p[$k], $v); // overwrite entry with the same name + } + $p[$k]=$v; + $_SESSION[$sid]=serialize($p); + return true; + } +*/ } /* Classe Membre */