Class: AuthSourceLdapsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/auth_source_ldaps_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#api_request?, #welcome

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


18
19
20
21
22
23
24
25
# File 'app/controllers/auth_source_ldaps_controller.rb', line 18

def create
  @auth_source_ldap = AuthSourceLdap.new(params[:auth_source_ldap])
  if @auth_source_ldap.save
    process_success
  else
    process_error
  end
end

#destroyObject


42
43
44
45
46
47
48
49
50
# File 'app/controllers/auth_source_ldaps_controller.rb', line 42

def destroy
  @auth_source_ldap = AuthSourceLdap.find(params[:id])
  if @auth_source_ldap.destroy
    process_success
  else
    process_error
  end

end

#editObject


27
28
29
# File 'app/controllers/auth_source_ldaps_controller.rb', line 27

def edit
  @auth_source_ldap = AuthSourceLdap.find(params[:id])
end

#indexObject


2
3
4
5
6
7
8
# File 'app/controllers/auth_source_ldaps_controller.rb', line 2

def index
  @auth_source_ldaps = AuthSourceLdap.all
  respond_to do |format|
    format.html { }
    format.json { render :json => @auth_source_ldaps }
  end
end

#newObject


14
15
16
# File 'app/controllers/auth_source_ldaps_controller.rb', line 14

def new
  @auth_source_ldap = AuthSourceLdap.new
end

#showObject


10
11
12
# File 'app/controllers/auth_source_ldaps_controller.rb', line 10

def show
  @auth_source_ldap = AuthSourceLdap.find(params[:id])
end

#updateObject


31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/auth_source_ldaps_controller.rb', line 31

def update
  @auth_source_ldap = AuthSourceLdap.find(params[:id])
  # remove from hash :account_password if blank?
  params[:auth_source_ldap].except!(:account_password) if params[:auth_source_ldap][:account_password].blank?
  if @auth_source_ldap.update_attributes(params[:auth_source_ldap])
    process_success
  else
    process_error
  end
end