/[libdata]/trunk/admin/include/validate_mysql.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 /trunk/admin/include/validate_mysql.php

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

revision 71 by dpavlin, Thu Mar 4 22:43:50 2004 UTC revision 72 by dpavlin, Thu Mar 18 20:33:37 2004 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /**********************************************************  /**********************************************************
3  Function Library: validate_mysql.php  Function Library: validate_mysql.php
4  Original Author: Paul Bramscher <brams006@tc.umn.edu>  Original Author: Paul Bramscher <brams006@umn.edu>
5  Last Modified: 09.30.2003 by Paul Bramscher  Last Modified: 03.11.2004 by Paul Bramscher
6  ***********************************************************  ***********************************************************
7  Comments:  Comments:
8  This library handles initial login of the user to LibData.  This library handles initial login of the user to LibData.
# Line 10  Because it's especially sensitive from a Line 10  Because it's especially sensitive from a
10  it's been pulled out of other libraries.  it's been pulled out of other libraries.
11  ***********************************************************  ***********************************************************
12  Table of Contents:  Table of Contents:
   
13  validateUser  validateUser
   
14  **********************************************************/  **********************************************************/
15    
16    
17    
18  /**********************************************************  /**********************************************************
19  Function: validateUser($con, $pass, $user)  Function: validateUser($pass, $user)
20  Author: Paul Bramscher  Author: Paul Bramscher
21  Last Modified: 09.30.2003  Last Modified: 03.01.2004
22  ***********************************************************  ***********************************************************
23  Incoming:  Incoming:
24  $password                       Password, 6 char. minimum  $password                       Password, 6 char. minimum
# Line 40  protection against accounts which have n Line 38  protection against accounts which have n
38  can't be used.  can't be used.
39  **********************************************************/  **********************************************************/
40    
41  function validateUser($con, $pass, $user){  function validateUser($pass, $user){
42    
43          // Assume the user is not valid          // Assume the user is not valid
44          $validated = 0;          $validated = 0;
# Line 61  function validateUser($con, $pass, $user Line 59  function validateUser($con, $pass, $user
59                          . "')";                          . "')";
60    
61                  // Fetch the results                  // Fetch the results
62                  $rs = xx_query($sql, $con);                  $rs = xx_tryquery($sql);
63                  $row = xx_fetch_array ($rs);                  
64                    $row = xx_fetch_array ($rs, xx_ASSOC);
65                  $last_login = Trim($row["last_login"]);                  $last_login = Trim($row["last_login"]);
66                  $last_ip = Trim($row["last_ip"]);                  $last_ip = Trim($row["last_ip"]);
67                  $access_id = (int) $row["access_id"];                  $access_id = (int) $row["access_id"];
# Line 86  function validateUser($con, $pass, $user Line 85  function validateUser($con, $pass, $user
85                                  . "' WHERE staff.staff_account = '"                                  . "' WHERE staff.staff_account = '"
86                                  . $user                                  . $user
87                                  . "'";                                  . "'";
88                          if (!xx_query ($sql, $con)){                          xx_tryquery($sql);
                                 sql_err($sql);  
                                 xx_query ("UNLOCK TABLES", $con);  
                                 bailout();  
                         }  
                         else {  
                                 xx_query ("UNLOCK TABLES", $con);  
                         }  
89                  }                        }      
90    
91          } // password > 5 characters in length          } // password > 5 characters in length
92    
93          return $validated;          return $validated;
94  }  }
95  ?>  ?>

Legend:
Removed from v.71  
changed lines
  Added in v.72

  ViewVC Help
Powered by ViewVC 1.1.26