diff --git a/html/main.php b/html/main.php index 9433a3decf31039179aebd3eaccc2990ac0d8b25..9c40400d954e56ec333af36dc18dfc45520d51d7 100644 --- a/html/main.php +++ b/html/main.php @@ -331,23 +331,6 @@ $focus .= '</script>'; $smarty->assign('focus', $focus); $smarty->assign('CSRFtoken', CSRFProtection::getToken()); -/* Set channel if needed */ -//TODO: * move all global session calls to global_ -// * create a new channel where needed (mostly management dialogues) -// * remove regulary created channels when not needed anymore -// * take a look at external php calls (i.e. get fax, ldif, etc.) -// * handle aborted sessions (by pressing anachors i.e. Main, Menu, etc.) -// * check lock removals, is "dn" global or not in this case? -// * last page request -> global or not? -// * check that filters are still global -// * maxC global? -if (isset($_POST['_channel_'])) { - echo "DEBUG - current channel: ".$_POST['_channel_']; - $smarty->assign("channel", $_POST['_channel_']); -} else { - $smarty->assign("channel", ""); -} - if (class_available('Game')) { $smarty->assign('game_screen', Game::run()); } else { diff --git a/ihtml/themes/breezy/framework.tpl b/ihtml/themes/breezy/framework.tpl index 67a78dd235146dc71ecef2d79bf5f282d78cbf89..0904b2072d7e8a6733dd754b725bc55c110ffeec 100644 --- a/ihtml/themes/breezy/framework.tpl +++ b/ihtml/themes/breezy/framework.tpl @@ -44,9 +44,6 @@ <div class="plugin-window"> {$contents} </div> - {if $channel != ""} - <input type="hidden" name="_channel_" value="{$channel}"/> - {/if} </td> </tr> </tbody> diff --git a/include/class_session.inc b/include/class_session.inc index 7367f1e81fd3113eeae09952cc17517f74f377aa..2e3f6623865e8c9d52afe6a3e5e8f299a6a3c4b8 100644 --- a/include/class_session.inc +++ b/include/class_session.inc @@ -2,7 +2,7 @@ /* This code is part of FusionDirectory (http://www.fusiondirectory.org/) Copyright (C) 2003-2010 Cajus Pollmeier - Copyright (C) 2011-2018 FusionDirectory + Copyright (C) 2011-2019 FusionDirectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,34 +35,15 @@ class session { */ public static function is_set($name) { - $channel = ""; - if (isset($_POST['_channel_'])) { - $channel = $_POST['_channel_']; - } - - /* Global fallback if not set */ - if ($channel == "") { - return isset($_SESSION[$name]); - } - - /* Sanity check */ - if (!session::channel_exists($channel)) { - msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG); - exit; - } - - $channel = "gch_".$channel; - return isset($_SESSION[$channel][$name]); + return isset($_SESSION[$name]); } /*! - * \brief Check if a session is defined - * - * \param string $name Name of the session + * \brief Deprecated */ public static function global_is_set($name) { - return isset($_SESSION[$name]); + return static::is_set($name); } /*! @@ -74,34 +55,15 @@ class session { */ public static function set($name, $value) { - $channel = ""; - if (isset($_POST['_channel_'])) { - $channel = $_POST['_channel_']; - } - - /* Global fallback if not set */ - if ($channel == "") { - $_SESSION[$name] = $value; - } else { - /* Sanity check */ - if (!session::channel_exists($channel)) { - msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG); - exit; - } - $_SESSION[$channel][$name] = $value; - } + $_SESSION[$name] = $value; } /*! - * \brief Set a value in a session - * - * \param string $name Name of the session - * - * \param $value The new value + * \brief Deprecated */ public static function global_set($name, $value) { - $_SESSION[$name] = $value; + static::set($name, $value); } /*! @@ -111,26 +73,7 @@ class session { */ public static function &get($name) { - $channel = ""; - if (isset($_POST['_channel_'])) { - $channel = $_POST['_channel_']; - } - - /* Global fallback if not set */ - if ($channel == "") { - $ret = &$_SESSION[$name]; - return $ret; - } - - /* Sanity check */ - if (!session::channel_exists($channel)) { - msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG); - exit; - } - - $channel = "gch_".$channel; - $ret = &$_SESSION[$channel][$name]; - return $ret; + return $_SESSION[$name]; } /*! @@ -165,33 +108,17 @@ class session { */ public static function delete($name) { - $channel = ""; - if (isset($_POST['_channel_'])) { - $channel = $_POST['_channel_']; - } - - /* Global fallback if not set */ - if ($channel == "") { - if (isset($_SESSION[$name])) { - unset($_SESSION[$name]); - } - } else { - if (isset($_SESSION[$channel][$name])) { - unset($_SESSION[$channel][$name]); - } + if (isset($_SESSION[$name])) { + unset($_SESSION[$name]); } } /*! - * \brief Delete a session - * - * \param string $name Name of the session to delete + * \brief Deprecated */ public static function global_delete($name) { - if (isset($_SESSION[$name])) { - unset($_SESSION[$name]); - } + static::delete($name); } /*! @@ -201,7 +128,7 @@ class session { */ public static function un_set($name) { - return session::delete($name); + return static::delete($name); } /*! @@ -211,7 +138,7 @@ class session { */ public static function global_un_set($name) { - return session::global_delete($name); + return static::global_delete($name); } /*!