Allow user to be logged-inot several password-protected webs simultaneously.
This commit is contained in:
parent
c358389f25
commit
5536e6e79e
|
@ -76,7 +76,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def password_check(password)
|
||||
if password == @web.password
|
||||
cookies['web_address'] = password
|
||||
cookies[CGI.escape(@web_name)] = password
|
||||
true
|
||||
else
|
||||
false
|
||||
|
@ -188,7 +188,7 @@ class ApplicationController < ActionController::Base
|
|||
def authorized?
|
||||
@web.nil? or
|
||||
@web.password.nil? or
|
||||
cookies['web_address'] == @web.password or
|
||||
cookies[CGI.escape(@web_name)] == @web.password or
|
||||
password_check(@params['password'])
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue