Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/24/10 00:23:16 (14 years ago)
Author:
hmayr
Message:

following changes (#1046):

  • extended DatabaseUtil.cs
  • extended HeuristicLabUser.cs
  • created HeuristicLabUserTest.cs
  • created AbstractHeuristicLabTest.cs
  • implemented a demo method in HeuristicLabMembershipProvider.cs to show usage of HeuristicLabUser.cs and DatabaseUtil.cs
Location:
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabMembershipProvider.cs

    r3939 r3943  
    11using System;
    2 using System.Collections.Generic;
    32using System.Linq;
    4 using System.Text;
    53using System.Web.Security;
     4using Persistence;
    65
    76namespace Service.Provider {
     
    1716
    1817    public override bool ChangePassword(string username, string oldPassword, string newPassword) {
    19       throw new NotImplementedException();
     18      DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext();
     19      if (db == null) {
     20        return false;
     21      }
     22      try {
     23        HeuristicLabUser u = db.HeuristicLabUsers.Single(x => x.UserName == username);
     24        if (u.ChangePassword(oldPassword, newPassword)) {
     25          db.SubmitChanges();
     26          return true;
     27        } else {
     28          return false;
     29        }
     30      }
     31      catch (Exception) {
     32        return false;
     33      }
    2034    }
    2135
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs

    r3939 r3943  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    52using System.Web.Security;
     3using Persistence;
    64
    75namespace Service.Provider {
Note: See TracChangeset for help on using the changeset viewer.