Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabMembershipProvider.cs @ 3943

Last change on this file since 3943 was 3943, checked in by hmayr, 14 years ago

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
File size: 4.3 KB
Line 
1using System;
2using System.Linq;
3using System.Web.Security;
4using Persistence;
5
6namespace Service.Provider {
7  class HeuristicLabMembershipProvider : MembershipProvider {
8    public override string ApplicationName {
9      get {
10        throw new NotImplementedException();
11      }
12      set {
13        throw new NotImplementedException();
14      }
15    }
16
17    public override bool ChangePassword(string username, string oldPassword, string newPassword) {
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      }
34    }
35
36    public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer) {
37      throw new NotImplementedException();
38    }
39
40    public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status) {
41      throw new NotImplementedException();
42    }
43
44    public override bool DeleteUser(string username, bool deleteAllRelatedData) {
45      throw new NotImplementedException();
46    }
47
48    public override bool EnablePasswordReset {
49      get { throw new NotImplementedException(); }
50    }
51
52    public override bool EnablePasswordRetrieval {
53      get { throw new NotImplementedException(); }
54    }
55
56    public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords) {
57      throw new NotImplementedException();
58    }
59
60    public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords) {
61      throw new NotImplementedException();
62    }
63
64    public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords) {
65      throw new NotImplementedException();
66    }
67
68    public override int GetNumberOfUsersOnline() {
69      throw new NotImplementedException();
70    }
71
72    public override string GetPassword(string username, string answer) {
73      throw new NotImplementedException();
74    }
75
76    public override MembershipUser GetUser(string username, bool userIsOnline) {
77      throw new NotImplementedException();
78    }
79
80    public override MembershipUser GetUser(object providerUserKey, bool userIsOnline) {
81      throw new NotImplementedException();
82    }
83
84    public override string GetUserNameByEmail(string email) {
85      throw new NotImplementedException();
86    }
87
88    public override int MaxInvalidPasswordAttempts {
89      get { throw new NotImplementedException(); }
90    }
91
92    public override int MinRequiredNonAlphanumericCharacters {
93      get { throw new NotImplementedException(); }
94    }
95
96    public override int MinRequiredPasswordLength {
97      get { throw new NotImplementedException(); }
98    }
99
100    public override int PasswordAttemptWindow {
101      get { throw new NotImplementedException(); }
102    }
103
104    public override MembershipPasswordFormat PasswordFormat {
105      get { throw new NotImplementedException(); }
106    }
107
108    public override string PasswordStrengthRegularExpression {
109      get { throw new NotImplementedException(); }
110    }
111
112    public override bool RequiresQuestionAndAnswer {
113      get { throw new NotImplementedException(); }
114    }
115
116    public override bool RequiresUniqueEmail {
117      get { throw new NotImplementedException(); }
118    }
119
120    public override string ResetPassword(string username, string answer) {
121      throw new NotImplementedException();
122    }
123
124    public override bool UnlockUser(string userName) {
125      throw new NotImplementedException();
126    }
127
128    public override void UpdateUser(MembershipUser user) {
129      throw new NotImplementedException();
130    }
131
132    public override bool ValidateUser(string username, string password) {
133      throw new NotImplementedException();
134    }
135  }
136}
Note: See TracBrowser for help on using the repository browser.