Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1750


Ignore:
Timestamp:
05/07/09 13:56:08 (16 years ago)
Author:
svonolfe
Message:

Fixed authentication bug (#532)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Security.Core/3.2/PermissionManager.cs

    r1738 r1750  
    5050   /// <returns></returns>
    5151    public Guid Authenticate(String userName, String password) {
    52       lock (locker)
    53         if (currentSessions.Values.Contains(userName))
    54           return GetGuid(userName);
    5552      try {
    5653        session = factory.GetSessionForCurrentThread();
     
    6360        if (user != null &&
    6461            user.Password.Equals(password)) {
    65           Guid newSessionId = Guid.NewGuid();
    66           lock (locker)
    67             currentSessions.Add(newSessionId, userName);
    68           return newSessionId;
    69         } else return Guid.Empty;
     62          Guid sessionId;
     63
     64          lock (locker) {
     65            if (currentSessions.Values.Contains(userName)) {
     66              sessionId = Guid.NewGuid();
     67            } else {
     68              sessionId = GetGuid(userName);
     69              currentSessions.Add(sessionId, userName);
     70            }
     71          }
     72
     73          return sessionId;
     74        } else
     75          return Guid.Empty;
    7076      }
    7177      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
Note: See TracChangeset for help on using the changeset viewer.