From e267e31bd045ff4a6bfa1489b0ad0eb5fcc7b31d Mon Sep 17 00:00:00 2001 From: neoraider Date: Mon, 10 Apr 2006 23:32:02 +0000 Subject: /code/links.inc.php /code/nav.inc.php: Links::ParseNavLink nach Nav::ParseLink verschoben. /code/pages.inc.php: Bug in HasAccess() gefixt. /handlers/default.inc.php /handlers/phpexec.inc.php: Globale Variablen wurden nicht in $GLOBALS gesetzt. --- code/links.inc.php | 25 ------------------------- code/nav.inc.php | 27 ++++++++++++++++++++++++++- code/pages.inc.php | 1 + 3 files changed, 27 insertions(+), 26 deletions(-) (limited to 'code') diff --git a/code/links.inc.php b/code/links.inc.php index 2eddb77..b5ae18e 100644 --- a/code/links.inc.php +++ b/code/links.inc.php @@ -34,31 +34,6 @@ return ''; } - - function ParseNavLink($text, $link) { - if(!$link) return $text; - - switch($link[0]) { - case ':': - $ret = $this->GetNeonLink(substr($link, 1)); - - if($ret) - return '' . $text . ''; - - return $text; - case '@': - return '' . $text . ''; - case '!': - $ret = $this->GetNavPage(substr($link, 1)); - - if($ret) - return $ret; - - return $text; - default: - return '' . $text . ''; - } - } } $GLOBALS['links'] = new Links; diff --git a/code/nav.inc.php b/code/nav.inc.php index e7617d1..06ce84d 100644 --- a/code/nav.inc.php +++ b/code/nav.inc.php @@ -29,6 +29,31 @@ return $ret; } + + function ParseLink($text, $link) { + if(!$link) return $text; + + switch($link[0]) { + case ':': + $ret = $GLOBALS['links']->GetNeonLink(substr($link, 1)); + + if($ret) + return '' . $text . ''; + + return $text; + case '@': + return '' . $text . ''; + case '!': + $ret = $GLOBALS['links']->GetNavPage(substr($link, 1)); + + if($ret) + return $ret; + + return $text; + default: + return '' . $text . ''; + } + } } class NavEntry { @@ -49,7 +74,7 @@ $ccount = 0; $ret = '
  • '; - $a = $GLOBALS['links']->ParseNavLink($this->text, $this->link); + $a = $GLOBALS['nav']->ParseLink($this->text, $this->link); $ret .= $a; diff --git a/code/pages.inc.php b/code/pages.inc.php index 50e45fe..3a84aa3 100644 --- a/code/pages.inc.php +++ b/code/pages.inc.php @@ -72,6 +72,7 @@ if($type) $res = $GLOBALS['db']->Execute('SELECT access FROM pages WHERE name = ? AND type = ?', array($page, $type)); else $res = $GLOBALS['db']->Execute('SELECT access FROM pages WHERE id = ?', $page); + if(!$res->RecordCount()) return false; return ($GLOBALS['user']->IsAdmin() || (ord($res->fields[0][$gid/8]) & (1 << ($gid%8))) != 0); } -- cgit v1.2.3