Changeset 2249

Show
Ignore:
Timestamp:
11/26/10 15:45:53 (18 months ago)
Author:
petsagouris
Message:

[Branch 1.5] Adding the logging of User IP.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/libs/UserAuth.php

    r2162 r2249  
    154154 
    155155        /** 
    156          * Update last login 
     156         * Update last login time and update user ip 
    157157         * 
    158158         * @return bool 
     
    161161        { 
    162162                if ($this->id != 0) { 
    163                         $sql = "UPDATE " . TABLE_USERS . " SET user_lastlogin = CURRENT_TIMESTAMP WHERE user_id = %d"; 
    164                         $h->db->query($h->db->prepare($sql, $this->id)); 
     163                        $ip = $h->cage->server->testIp('REMOTE_ADDR'); 
     164                        $sql = "UPDATE " . TABLE_USERS . " SET user_lastlogin = CURRENT_TIMESTAMP, user_ip = %s WHERE user_id = %d"; 
     165                        $h->db->query($h->db->prepare($sql, $ip, $this->id)); 
    165166                        return TRUE; 
    166167                } 
     
    430431                                $password_check_new2 = 1; 
    431432                        } 
    432                          
     433 
    433434                        if ($password_check_new != $password_check_new2) { 
    434435                                $h->messages[$h->lang['main_user_account_update_password_error_match']] = 'red';