From d4b146a774ffa5a51752cfc8e44efb1232089132 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Wed, 15 Dec 2004 15:18:16 +0000 Subject: [PATCH] last refactoring in include/ git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-96 --- include/xorg.plugin.inc.php | 9 +++------ include/xorg/page.inc.php | 12 ++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/xorg.plugin.inc.php b/include/xorg.plugin.inc.php index de80473..c6f3027 100644 --- a/include/xorg.plugin.inc.php +++ b/include/xorg.plugin.inc.php @@ -63,10 +63,7 @@ class XOrgPlugin */ function get_value($key) { - if (empty($_GET[$this->_prefix.$key])) { - return ''; - } - return $_GET[$this->_prefix.$key]; + return Get::get($this->_prefix.$key); } // }}} @@ -100,8 +97,8 @@ class XOrgPlugin if ($args[$key]) { $get[] = urlencode($key) . '=' . urlencode($args[$key]); } - } elseif (isset($_GET['key'])) { - $get[] = urlencode($key) . '=' . urlencode($_GET[$key]); + } elseif (Get::has('key')) { + $get[] = urlencode($key) . '=' . urlencode(Get::get($key)); } } diff --git a/include/xorg/page.inc.php b/include/xorg/page.inc.php index ce1e17d..4cd0b64 100644 --- a/include/xorg/page.inc.php +++ b/include/xorg/page.inc.php @@ -108,7 +108,7 @@ class XorgPage extends DiogenesCorePage if ($this->_page_type == NO_SKIN) { $this->display($this->_tpl); } else { - if (isset($_SESSION['suid'])) { + if (Session::has('suid')) { $this->caching=false; } $this->assign_by_ref('menu', $globals->menu->menu()); @@ -117,7 +117,7 @@ class XorgPage extends DiogenesCorePage $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl')); $this->assign('validate', urlencode($globals->baseurl.'/valid.html')); - $result = $this->fetch('skin/'.$_SESSION['skin'], $id); + $result = $this->fetch('skin/'.Session::get('skin'), $id); $total_time = sprintf('Temps total: %.02fs
', microtime_float() - $TIME_BEGIN); $fd = fopen($this->cache_dir."valid.html","w"); fwrite($fd, $result); @@ -138,7 +138,7 @@ class XorgPage extends DiogenesCorePage } } } else { - $this->display('skin/'.$_SESSION['skin'], $id); + $this->display('skin/'.Session::get('skin'), $id); } } exit; @@ -194,7 +194,7 @@ class XorgPage extends DiogenesCorePage if ($this->_page_type == NO_SKIN) { return parent::is_cached($this->_tpl); } else { - return parent::is_cached('skin/'.$_SESSION['skin'], $this->make_id($append_to_id)); + return parent::is_cached('skin/'.Session::get('skin'), $this->make_id($append_to_id)); } } @@ -213,8 +213,8 @@ class XorgPage extends DiogenesCorePage } $auth_trans = Array(AUTH_PUBLIC => 'public', AUTH_COOKIE => 'cookie', AUTH_MDP => 'passwd'); - $ret .= '-'.$auth_trans[empty($_SESSION['auth']) ? AUTH_PUBLIC : $_SESSION['auth']]; - $ret .= '-'.(empty($_SESSION['perms']) ? PERMS_EXT : $_SESSION['perms']); + $ret .= '-'.$auth_trans[Session::get('auth', AUTH_PUBLIC)]; + $ret .= '-'.Session::get('perms', PERMS_EXT); return $ret; } -- 2.1.4