summaryrefslogtreecommitdiff
path: root/includes/UserCVS.php
diff options
context:
space:
mode:
authorAngelo Cuccato <cuccato@web.de>2010-11-23 10:28:02 +0100
committerAngelo Cuccato <cuccato@web.de>2010-11-23 10:28:02 +0100
commit1e4779938497a580217cf0e082730c731282cd69 (patch)
treec39215b0c0beab7e099e276ffd6b0d6485d7075a /includes/UserCVS.php
parent3b6e2b24b10ac6230f4f722e015b2c03b49e5dbb (diff)
check link before show
Diffstat (limited to 'includes/UserCVS.php')
-rwxr-xr-xincludes/UserCVS.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/includes/UserCVS.php b/includes/UserCVS.php
index 4f606b7e..9210e446 100755
--- a/includes/UserCVS.php
+++ b/includes/UserCVS.php
@@ -50,4 +50,53 @@ if( $DEBUG )
}
+function funktion_isLinkAllowed( $PageName)
+{
+ global $_SESSION;
+
+ // separate page parameter
+ $ParameterPos = strpos( $PageName, ".php?");
+ if( $ParameterPos === FALSE)
+ {
+ $pName = $PageName;
+ }
+ else
+ {
+ $pName = substr( $PageName, 0, $ParameterPos + 4);
+ }
+
+ // check rights
+ if( (isset( $_SESSION['CVS'][ $pName ]) === TRUE) &&
+ ($_SESSION['CVS'][ $pName ] == "Y") )
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+function funktion_isLinkAllowed_addLink_OrLinkText( $PageName, $LinkText)
+{
+ global $url, $ENGEL_ROOT;
+
+ if( funktion_isLinkAllowed( $PageName) === TRUE)
+ {
+ return "<a href=\"". $url. $ENGEL_ROOT. $PageName. "\">". $LinkText. "</a>";
+ }
+
+ return $LinkText;
+}
+
+function funktion_isLinkAllowed_addLink_OrEmpty( $PageName, $LinkText)
+{
+ global $url, $ENGEL_ROOT;
+
+ if( funktion_isLinkAllowed( $PageName) === TRUE)
+ {
+ return "<a href=\"". $url. $ENGEL_ROOT. $PageName. "\">". $LinkText. "</a>";
+ }
+
+ return "";
+}
+
?>