class UzuUzu::Controller::Initialize
Public Instance Methods
index()
click to toggle source
# File lib/uzuuzu-cms/controller/initialize.rb, line 6 def index self.send("step#{info.step}") case(info.step) when 1 respond(render_page(info, render_file(__DIR__('view/initialize/step1.rhtml')))) when 2 respond(render_page(info, render_file(__DIR__('view/initialize/step2.rhtml')))) end end
Private Instance Methods
step1()
click to toggle source
# File lib/uzuuzu-cms/controller/initialize.rb, line 18 def step1 if session[:openid_identity].nil? return end UzuUzu.transaction do |tr| tr.begin info.step = 2 user = UzuUzu::User.new user.user_id = session[:openid_identity] user.domain = session[:openid_domain] user.name = 'admin' user.admin = true if info.save tr.commit else tr.rollback end end end
step2()
click to toggle source
# File lib/uzuuzu-cms/controller/initialize.rb, line 38 def step2 if session[:openid_identity].nil? redirect rf(::UzuUzu::Controller::Index) end login_user = ::UzuUzu::User.first(:user_id => session[:openid_identity]) login_user end