Description:
allows local users
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r771:15215b7e2423 - - 1 file changed: 1 inserted, 1 deleted
@@ -51,35 +51,35 | |||
|
51 | 51 | end |
|
52 | 52 | if site==nil |
|
53 | 53 | flash[:notice] = 'Wrong site' |
|
54 | 54 | redirect_to :controller => 'main', :action => 'login' and return |
|
55 | 55 | end |
|
56 | 56 | if (site.password) and (site.password == params[:login][:password]) |
|
57 | 57 | session[:site_id] = site.id |
|
58 | 58 | redirect_to :controller => 'site', :action => 'index' |
|
59 | 59 | else |
|
60 | 60 | flash[:notice] = 'Wrong site password' |
|
61 | 61 | redirect_to :controller => 'site', :action => 'login' |
|
62 | 62 | end |
|
63 | 63 | end |
|
64 | 64 | |
|
65 | 65 | def self.add_authenticator(authenticator) |
|
66 | 66 | @@authenticators << authenticator |
|
67 | 67 | end |
|
68 | 68 | |
|
69 | 69 | protected |
|
70 | 70 | |
|
71 | 71 | def get_authenticated_user(login, password) |
|
72 | 72 | if @@authenticators.empty? |
|
73 | 73 | return User.authenticate(login, password) |
|
74 | 74 | else |
|
75 | - user = nil | |
|
75 | + user = User.authenticate(login, password) | |
|
76 | 76 | @@authenticators.each do |authenticator| |
|
77 | 77 | if not user |
|
78 | 78 | user = authenticator.authenticate(login, password) |
|
79 | 79 | end |
|
80 | 80 | end |
|
81 | 81 | return user |
|
82 | 82 | end |
|
83 | 83 | end |
|
84 | 84 | |
|
85 | 85 | end |
You need to be logged in to leave comments.
Login now