mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 22:21:11 +00:00
Implements iChain authentication
This commit is contained in:
parent
15c6ed127f
commit
49d565def2
21 changed files with 269 additions and 126 deletions
30
app/controllers/users_controller.rb
Normal file
30
app/controllers/users_controller.rb
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
class UsersController < ApplicationController
|
||||
before_filter :verify_user
|
||||
load_and_authorize_resource
|
||||
|
||||
# GET /users/1
|
||||
def show
|
||||
@events = @user.events.where(state: :confirmed)
|
||||
end
|
||||
|
||||
# GET /users/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# PATCH/PUT /users/1
|
||||
def update
|
||||
if @user.update(user_params)
|
||||
redirect_to @user, notice: 'User was successfully updated.'
|
||||
else
|
||||
flash[:error] = "A error prohibited your Profile from being saved: #{@user.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def user_params
|
||||
params.require(:user).permit(:user_id, :name, :biography, :nickname, :affiliation)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue