Changeset 7485


Ignore:
Timestamp:
May 17, 2018, 8:50:51 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2119: Geolocation should not be used for internal logins

We now check that the AuthenticationMethod used in the session is not INTERNAL (or null).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.12-stable/src/core/net/sf/basedb/core/SessionControl.java

    r7452 r7485  
    350350  }
    351351 
    352   GeoLocation getLocation()
    353   {
    354     if (!locationLoaded)
     352  GeoLocation getLocation(AuthenticationMethod authMeth)
     353  {
     354    if (!locationLoaded && authMeth != null && authMeth != AuthenticationMethod.INTERNAL)
    355355    {
    356356      locationLoaded = true;
     
    895895    device.setLastUsed(now);
    896896    device.setLastRemoteId(getRemoteId());
    897     GeoLocation loc = getLocation();
     897    GeoLocation loc = getLocation(authUser.getAuthenticationMethod());
    898898    if (loc == null) loc = new GeoLocation(); // To force 'null' on the location fields
    899899    device.setLocation(loc.toString());
     
    10841084    sessionData.setLoginComment(comment);
    10851085    sessionData.setRemoteId(getRemoteId());
    1086     GeoLocation loc = getLocation();
     1086    GeoLocation loc = getLocation(authenticationMethod);
    10871087    if (loc != null)
    10881088    {
Note: See TracChangeset for help on using the changeset viewer.