1 | using System;
|
---|
2 | using System.Linq;
|
---|
3 | using System.Web.Security;
|
---|
4 | using Persistence;
|
---|
5 |
|
---|
6 | namespace 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 | }
|
---|