svn commit: r220 - trunk/mapbender/http/php/mb_validatePermission.php
uli at osgeo.org
uli at osgeo.org
Wed May 10 09:52:05 EDT 2006
Author: uli
Date: 2006-05-10 13:52:05+0000
New Revision: 220
Added:
trunk/mapbender/http/php/mb_validatePermission.php (contents, props changed)
Log:
new modul to check the permission to use a module
Added: trunk/mapbender/http/php/mb_validatePermission.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_validatePermission.php?view=auto&rev=220
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_validatePermission.php 2006-05-10 13:52:05+0000
@@ -0,0 +1,42 @@
+<?php
+# $Id$
+#
+# Copyright (C) 2002 CCGIS
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+include_once("../../conf/mapbender.conf");
+include_once("../classes/class_administration.php");
+if(!isset($_SESSION["mb_user_id"]) || !isset($_SESSION["mb_user_ip"]) || $_SESSION['mb_user_ip'] != $_SERVER['REMOTE_ADDR']){
+ header("Location: ".LOGIN);
+ exit;
+ die();
+}
+if(isset($_REQUEST["gui_id"])){
+ if( !in_array($_REQUEST["gui_id"],$_SESSION["mb_user_guis"])){
+ header("Location: ".LOGIN);
+ exit;
+ die();
+ }
+}
+$n = new administration();
+$m = $n->getModulPermission($_SESSION["mb_user_id"],$_REQUEST["guiID"],$_REQUEST["elementID"]);
+if($m == false){
+ header("Location: ".LOGIN);
+ exit;
+ die();
+}
+?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list