/[locfinder]/locfinder/functions/func_users.php
ViewVC logotype

Diff of /locfinder/functions/func_users.php

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

revision 1.2 by yob, Wed Jan 15 12:31:11 2003 UTC revision 1.3 by yob, Thu Jan 16 13:37:46 2003 UTC
# Line 54  if($in_locfinder) { Line 54  if($in_locfinder) {
54    
55              // select the correct password for the supplied              // select the correct password for the supplied
56              //  node from the DB              //  node from the DB
57              $sql = "SELECT password from users WHERE username='" . $username . "'";              $sql = "SELECT password, confirm from users WHERE username='" . $username . "'";
58    
59              $loc_db->query ( $sql );              $loc_db->query ( $sql );
60    
# Line 64  if($in_locfinder) { Line 64  if($in_locfinder) {
64                  // move to the record                  // move to the record
65                  $loc_db->next_record();                  $loc_db->next_record();
66    
67                    // if the user hasnt confirmed yet
68                    if (!$loc_db->f("confirm")) {
69    
70                        //user cant login yet
71                        return false;
72    
73                  // if the password from the DB matches the one supplied                  // if the password from the DB matches the one supplied
74                  if ($loc_db->f("password") == $password) {                  } elseif ($loc_db->f("password") == $password) {
75                                    
76                      // user is authenticated                      // user is authenticated
77                      return true;                      return true;
# Line 89  if($in_locfinder) { Line 95  if($in_locfinder) {
95    
96      } // end login()      } // end login()
97    
98    
99    function logout() {
100    
101        session_destroy();
102    
103    }
104    
105      /*      /*
106       * email_password()       * email_password()
107       *       *
# Line 152  if($in_locfinder) { Line 165  if($in_locfinder) {
165      } // end email_password()      } // end email_password()
166    
167  }  }
168    
169    function register_user($username, $full_name, $email, $notify_updates, $password) {
170    
171        // create DB class
172        $loc_db = new locDatabase;
173    
174        if ($notify_updates == "on") {
175    
176            $notify_updates = 1;
177    
178        } else {
179    
180            $notify_updates = 0;
181    
182        }
183    
184        $sql = "INSERT into users (username, name, email, notify_updates, password, confirm) VALUES('$username', '$fullname', '$email', $notify_updates, '" . md5($password) . "', 0)";
185        
186        $loc_db->query($sql);
187    
188        return true;
189    
190    }
191  ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26