Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 rodolico 1
<?php
20 rodolico 2
   include_once( 'DatabaseDefinition.php' );
1 rodolico 3
   global $LOGFILE;
4
   $LOGFILE='/tmp/camp.log';
5
   define( 'VERSION', '2.0b' );
6
   define( 'BUILD_DATE', '20130527');
7
 
8
   function insertValuesIntoQuery( $query, $values ) {
9
      foreach ( $values as $name => $value ) {
10
         $query = search_replace_string($query, "<$name>", $value );
11
      }
12
      return $query;
13
   }
14
 
15
   function search_replace_string($string, $searchFor, $replaceWith ) {
16
      $string = str_replace ( $searchFor, $replaceWith, $string );
17
      return $string;
18
   }
20 rodolico 19
 
20
   function killSession() {
21
      // http://php.net/manual/en/function.session-destroy.php
22
      // Initialize the session.
23
      // If you are using session_name("something"), don't forget it now!
24
      if ( ! isset( $_SESSION[ 'app directories' ] ) )
25
         session_start();
26
 
27
      // Unset all of the session variables.
28
      $_SESSION = array();
29
 
30
      //session_destroy();
31
 
32
      // If it's desired to kill the session, also delete the session cookie.
33
      // Note: This will destroy the session, and not just the session data!
34
      if (ini_get("session.use_cookies")) {
35
          $params = session_get_cookie_params();
36
          setcookie(session_name(), '', time() - 42000,
37
              $params["path"], $params["domain"],
38
              $params["secure"], $params["httponly"]
39
          );
40
      }
41
 
42
      // Finally, destroy the session.
43
      //session_destroy();
44
   }     
1 rodolico 45
 
46
?>