Class: DomainController

Inherits:
ApplicationController show all
Includes:
DomainSystem
Defined in:
app/controllers/domain_controller.rb

Instance Method Summary collapse

Instance Method Details

#loginObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/domain_controller.rb', line 4

def 
    case request.method
    when :post
        if session[:domain] = Domain.authenticate(params[:domain_name], params[:domain_password])

            flash['notice']  = "Login successful"
            redirect_back_or_default :action => "welcome"
        else
            flash.now['notice']  = "Login unsuccessful"

            @login = params[:domain_login]
        end
    end
end

#logoutObject



29
30
31
# File 'app/controllers/domain_controller.rb', line 29

def logout
    session[:domain] = nil
end

#signupObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/domain_controller.rb', line 19

def 
    @domain = Domain.new(params[:domain])

    if request.post? and @domain.save
        session[:domain] = Domain.authenticate(@domain.name, params[:domain][:password])
        flash['notice']  = "Signup successful"
        redirect_back_or_default :action => "welcome"
    end      
end

#welcomeObject



33
34
# File 'app/controllers/domain_controller.rb', line 33

def welcome
end