Subversion Repositories computer_asset_manager_v2

Rev

Rev 1 | Rev 22 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
   include_once( 'DatabaseDefinition.php' );
   global $LOGFILE;
   $LOGFILE='/tmp/camp.log';
   define( 'VERSION', '2.0b' );
   define( 'BUILD_DATE', '20130527');
   
   function insertValuesIntoQuery( $query, $values ) {
      foreach ( $values as $name => $value ) {
         $query = search_replace_string($query, "<$name>", $value );
      }
      return $query;
   }

   function search_replace_string($string, $searchFor, $replaceWith ) {
      $string = str_replace ( $searchFor, $replaceWith, $string );
      return $string;
   }

   function killSession() {
      // http://php.net/manual/en/function.session-destroy.php
      // Initialize the session.
      // If you are using session_name("something"), don't forget it now!
      if ( ! isset( $_SESSION[ 'app directories' ] ) )
         session_start();

      // Unset all of the session variables.
      $_SESSION = array();
      
      //session_destroy();

      // If it's desired to kill the session, also delete the session cookie.
      // Note: This will destroy the session, and not just the session data!
      if (ini_get("session.use_cookies")) {
          $params = session_get_cookie_params();
          setcookie(session_name(), '', time() - 42000,
              $params["path"], $params["domain"],
              $params["secure"], $params["httponly"]
          );
      }

      // Finally, destroy the session.
      //session_destroy();
   }     
   
?>