Class: QuoVadis::ConfirmationsController

Inherits:
QuoVadisController show all
Defined in:
app/controllers/quo_vadis/confirmations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

send new confirmation email form submits here



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

def create
   = QuoVadis. params

  unless 
    redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.identifier') and return
  end

  request_confirmation .model
  redirect_to confirmations_path
end

#editObject

emailed confirmation link points here



31
32
33
34
35
36
37
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 31

def edit
   = AccountConfirmationToken. params[:token]

  unless   # expired or already confirmed
    redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return
  end
end

#edit_emailObject



58
59
60
61
62
63
64
65
66
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 58

def edit_email
   = 

  unless 
    redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return
  end

  @email = .model.email
end

#indexObject

holding page



7
8
9
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 7

def index
  @account = 
end

#newObject

form for requesting new confirmation email



13
14
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 13

def new
end

#resendObject



83
84
85
86
87
88
89
90
91
92
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 83

def resend
   = 

  unless 
    redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return
  end

  request_confirmation .model
  redirect_to confirmations_path
end

#updateObject

confirm the account (and login)



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 41

def update
   = AccountConfirmationToken. params[:token]

  unless   # expired or already confirmed
    redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return
  end

  .confirmed!
  qv.log , Log::ACCOUNT_CONFIRMATION

  session.delete :account_pending_confirmation

   .model, true
  redirect_to qv., notice: QuoVadis.translate('flash.confirmation.confirmed')
end

#update_emailObject



69
70
71
72
73
74
75
76
77
78
79
80
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 69

def update_email
   = 

  unless 
    redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return
  end

  .model.update email: params[:email]

  request_confirmation .model
  redirect_to confirmations_path
end