|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| package org.objectledge.authentication; |
|
30 |
| |
|
31 |
| import java.security.Principal; |
|
32 |
| import java.util.Map; |
|
33 |
| |
|
34 |
| import javax.naming.NamingException; |
|
35 |
| import javax.naming.directory.DirContext; |
|
36 |
| import javax.naming.directory.SearchControls; |
|
37 |
| |
|
38 |
| import org.jcontainer.dna.Logger; |
|
39 |
| import org.objectledge.naming.ContextHelper; |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| public class DummyUserManager extends UserManager |
|
47 |
| { |
|
48 |
| |
|
49 |
| |
|
50 |
| |
|
51 |
0
| public DummyUserManager()
|
|
52 |
| { |
|
53 |
| } |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
0
| public boolean userExists(String dn)
|
|
59 |
| { |
|
60 |
0
| return true;
|
|
61 |
| } |
|
62 |
| |
|
63 |
| |
|
64 |
| |
|
65 |
| |
|
66 |
0
| public Principal createAccount(String login, String dn, String password)
|
|
67 |
| throws AuthenticationException |
|
68 |
| { |
|
69 |
0
| throw new UnsupportedOperationException("Dummy manager cannot create new account");
|
|
70 |
| } |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
| |
|
75 |
0
| public void removeAccount(Principal account) throws AuthenticationException
|
|
76 |
| { |
|
77 |
0
| throw new UnsupportedOperationException("Dummy manager cannot create new account");
|
|
78 |
| } |
|
79 |
| |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
0
| public Principal getUserByName(String dn) throws AuthenticationException
|
|
84 |
| { |
|
85 |
0
| return new DefaultPrincipal(dn);
|
|
86 |
| } |
|
87 |
| |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
0
| public Principal getUserByLogin(String login) throws AuthenticationException
|
|
92 |
| { |
|
93 |
0
| return new DefaultPrincipal(login);
|
|
94 |
| } |
|
95 |
| |
|
96 |
| |
|
97 |
| |
|
98 |
| |
|
99 |
0
| public Principal getAnonymousAccount() throws AuthenticationException
|
|
100 |
| { |
|
101 |
0
| return new DefaultPrincipal("anonymous");
|
|
102 |
| } |
|
103 |
| |
|
104 |
| |
|
105 |
| |
|
106 |
| |
|
107 |
0
| public Principal getSuperuserAccount() throws AuthenticationException
|
|
108 |
| { |
|
109 |
0
| return null;
|
|
110 |
| } |
|
111 |
| |
|
112 |
| |
|
113 |
| |
|
114 |
| |
|
115 |
0
| public void changeUserPassword(Principal account, String password)
|
|
116 |
| throws AuthenticationException |
|
117 |
| { |
|
118 |
0
| throw new UnsupportedOperationException("Dummy manager cannot change user password");
|
|
119 |
| } |
|
120 |
| |
|
121 |
| |
|
122 |
| |
|
123 |
| |
|
124 |
0
| public boolean checkUserPassword(Principal account, String password)
|
|
125 |
| throws AuthenticationException |
|
126 |
| { |
|
127 |
0
| return true;
|
|
128 |
| } |
|
129 |
| |
|
130 |
| |
|
131 |
| |
|
132 |
| |
|
133 |
0
| public DirContext getPersonalData(Principal account) throws AuthenticationException
|
|
134 |
| { |
|
135 |
0
| return null;
|
|
136 |
| } |
|
137 |
| |
|
138 |
| |
|
139 |
| |
|
140 |
| |
|
141 |
0
| public Principal[] lookupAccounts(String attribute, String value) throws NamingException
|
|
142 |
| { |
|
143 |
0
| throw new UnsupportedOperationException("Dummy manager cannot lookup accounts");
|
|
144 |
| } |
|
145 |
| |
|
146 |
| |
|
147 |
| |
|
148 |
| |
|
149 |
0
| public Principal[] lookupAccounts(String query) throws NamingException
|
|
150 |
| { |
|
151 |
0
| throw new UnsupportedOperationException("Dummy manager cannot lookup accounts");
|
|
152 |
| } |
|
153 |
| } |