Changeset 10245


Ignore:
Timestamp:
Feb 26, 2007 3:39:56 PM (13 years ago)
Author:
saraj
Message:

inactive user able to login through thunderbird plugin - fixed. Fixes #3084

Location:
vtigercrm/branches/5.0.3/soap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vtigercrm/branches/5.0.3/soap/thunderbirdplugin.php

    r10187 r10245  
    491491  require_once('modules/Users/Users.php'); 
    492492        $objuser = new Users(); 
    493   if($password != "" && $user_name != '') 
    494         { 
    495                 $objuser->column_fields['user_name'] = $user_name; 
    496                 $encrypted_password = $objuser->encrypt_password($password); 
    497                 $query = "select id from vtiger_users where user_name='$user_name' and user_password='$encrypted_password'"; 
    498                 $result = $adb->query($query); 
    499                 if($adb->num_rows($result) > 0) 
     493        if($password != "" && $user_name != '') 
     494        { 
     495                if($objuser->is_authenticated()) 
    500496                { 
    501                         $return_access = 'success'; 
    502                         $log->debug("Logged in sucessfully from thunderbirdplugin"); 
    503                 }else 
     497                        $objuser->column_fields['user_name'] = $user_name; 
     498                        $encrypted_password = $objuser->encrypt_password($password); 
     499                        $query = "select id from vtiger_users where user_name='$user_name' and user_password='$encrypted_password'"; 
     500                        $result = $adb->query($query); 
     501                        if($adb->num_rows($result) > 0) 
     502                        { 
     503                                $return_access = 'success'; 
     504                                $log->debug("Logged in sucessfully from thunderbirdplugin"); 
     505                        }else 
     506                        { 
     507                                $return_access = 'failure'; 
     508                                $log->debug("Logged in failure from thunderbirdplugin"); 
     509                        } 
     510                } 
     511                else 
    504512                { 
    505513                        $return_access = 'failure'; 
    506                         $log->debug("Logged in failure from thunderbirdplugin"); 
    507514                } 
    508515        }else 
  • vtigercrm/branches/5.0.3/soap/wordplugin.php

    r9762 r10245  
    328328        if($password != "" && $user_name != '') 
    329329        { 
    330                 $objuser->column_fields['user_name'] = $user_name; 
    331                 $encrypted_password = $objuser->encrypt_password($password); 
    332                 $query = "select id from vtiger_users where user_name='$user_name' and user_password='$encrypted_password'"; 
    333                 $result = $adb->query($query); 
    334                 if($adb->num_rows($result) > 0) 
     330                if($objuser->is_authenticated()) 
    335331                { 
    336                         $return_access = "TempSessionID"; 
    337                         $log->debug("Logged in sucessfully from wordplugin"); 
    338                 }else 
     332                        $objuser->column_fields['user_name'] = $user_name; 
     333                        $encrypted_password = $objuser->encrypt_password($password); 
     334                        $query = "select id from vtiger_users where user_name='$user_name' and user_password='$encrypted_password'"; 
     335                        $result = $adb->query($query); 
     336                        if($adb->num_rows($result) > 0) 
     337                        { 
     338                                $return_access = "TempSessionID"; 
     339                                $log->debug("Logged in sucessfully from wordplugin"); 
     340                        }else 
     341                        { 
     342                                $return_access = "false"; 
     343                                $log->debug("Logged in failure from wordplugin"); 
     344                        } 
     345                } 
     346                else 
    339347                { 
    340348                        $return_access = "false"; 
    341                         $log->debug("Logged in failure from wordplugin"); 
     349                        $log->debug("Logged in failure from wordplugin when the user is not authenticated"); 
    342350                } 
    343351        }else 
Note: See TracChangeset for help on using the changeset viewer.