Class: ClWiki::SessionsController
Instance Method Summary
collapse
#authorized, #current_owner, #current_user, #initialize_index, #logged_in?
Instance Method Details
#create ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/cl_wiki/sessions_controller.rb', line 12
def create
@user = User.find(params[:username])
password = params[:password]
if @user&.username == $wiki_conf.owner && @user&.authenticate(password)
session[:username] = @user.username
session[:encryption_key] = Base64.encode64(@user.derive_encryption_key(password))
redirect_to root_url
else
redirect_to login_url
end
end
|
#new ⇒ Object
9
10
|
# File 'app/controllers/cl_wiki/sessions_controller.rb', line 9
def new
end
|