/[libdata]/branches/pear-db/admin/include/accessClass.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/pear-db/admin/include/accessClass.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49 by dpavlin, Fri Mar 5 13:42:57 2004 UTC revision 50 by dpavlin, Fri Mar 5 22:38:33 2004 UTC
# Line 17  var $staff_id; Line 17  var $staff_id;
17    
18    
19  // Database variables  // Database variables
20  var $db_ac = "libdata";  #var $access_dsn = 'mysql://libdata:libdatapw@localhost/libdata';
21  var $db_ac_srv = "localhost";  var $access_dsn = 'pgsql://dpavlin@/libdata';
 var $db_ac_usr = "libdata";  
 var $db_ac_pwd = "libdatapw";  
22    
23  /**********************************************************  /**********************************************************
24  Constructor Method: accessClass  Constructor Method: accessClass
# Line 33  Sets the properties. Line 31  Sets the properties.
31  function accessClass($sessionClass) {  function accessClass($sessionClass) {
32                    
33          // Set the database connection variables                  // Set the database connection variables        
34          $this->con_ac = @mysql_connect ( $this->db_ac_srv, $this->db_ac_usr, $this->db_ac_pwd )          global $dsn_options;
35                  or die ( "ERROR: Could not connect to database server!" );          $this->con_ac =& DB::connect($this->access_dsn, $dsn_options);
36          $this->result_ac = mysql_select_db ( $this->db_ac, $this->con_ac )          if (DB::isError($db)) {
37                  or die ( "ERROR: Could not connect to database!" );                  # XXX remove this!
38                            print $db->getDebugInfo();
39                    
40                    die($db->getMessage());
41            }
42                    
43          // Initialize for security purposes          // Initialize for security purposes
44          $valid = 0;          $valid = 0;
# Line 63  function accessClass($sessionClass) { Line 64  function accessClass($sessionClass) {
64                          FROM staff s, access a WHERE s.access_id = a.access_id AND s.staff_account = '"                          FROM staff s, access a WHERE s.access_id = a.access_id AND s.staff_account = '"
65                          . $staff_account                          . $staff_account
66                          . "'";                                            . "'";                  
67                  $rs = mysql_query($sql, $this->con_ac);                          $rs = xx_query($sql, $this->con_ac);            
68                  $row = mysql_fetch_array ($rs);                  $row = xx_fetch_array ($rs);
69                  $access_level = $row["access_level"];                  $access_level = $row["access_level"];
70                  $access = $row["access"];                  $access = $row["access"];
71                  $first_name = $row["first_name"];                  $first_name = $row["first_name"];

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26