[Mapbender-commits] r4538 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 28 08:22:15 EDT 2009


Author: christoph
Date: 2009-08-28 08:22:15 -0400 (Fri, 28 Aug 2009)
New Revision: 4538

Modified:
   trunk/mapbender/lib/class_Mapbender_session.php
Log:
http://trac.osgeo.org/mapbender/ticket/518

added methods "delete" and "exists"

Modified: trunk/mapbender/lib/class_Mapbender_session.php
===================================================================
--- trunk/mapbender/lib/class_Mapbender_session.php	2009-08-28 11:28:33 UTC (rev 4537)
+++ trunk/mapbender/lib/class_Mapbender_session.php	2009-08-28 12:22:15 UTC (rev 4538)
@@ -35,6 +35,17 @@
  		session_write_close(); 
  	}
  	
+	/**
+	 * Unsets a session variable
+	 * @param String name name of the session variable
+	 */
+	public function delete ($name) {
+ 		$this->start();
+ 		unset($_SESSION[$name]);
+ 		new mb_notice("session.setSessionVariable.unset: " . $name);
+ 		session_write_close(); 
+	}
+	
  	/* pushs the array of the session-variable  
 	 * @param String name the name of the session-variable
 	 * @param Mixed value the new value of the session-variable
@@ -61,6 +72,22 @@
  	}
  	
  	/**
+	 * checks if a session variable is set
+	 * @param String name the name of the session variable
+	 */
+ 	public function exists ($name){
+ 		$this->start();
+ 		if(isset($_SESSION[$name])){
+ 			return true;
+ 		}
+ 		else{
+ 			new mb_exception("exists(): The session variable: ".$name." is not set!'");
+ 			return false;
+ 		}
+ 		session_write_close();
+ 	}
+ 	
+ 	/**
 	 * sets a new session-id   
 	 * @param String id the new id of the session
 	 */



More information about the Mapbender_commits mailing list