diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index 90b6612..047fa0b 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -20,9 +20,9 @@ class AccountController < PublicController cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } end go_to_user_initial_page if redirect? - flash[:notice] = _("Logged in successfully") + flash[:notice] = _("Logged in successfully") if redirect? else - flash[:notice] = _('Incorrect username or password') + flash[:notice] = _('Incorrect username or password') if redirect? redirect_to :back if redirect? end end @@ -182,7 +182,14 @@ class AccountController < PublicController if activation && user activation.requestor = user activation.finish - redirect_to :controller => 'profile_editor', :action => 'index', :profile => @enterprise.identifier + redirect_to :action => 'welcome', :enterprise => @enterprise.id + end + end + + def welcome + @enterprise = Enterprise.find(params[:enterprise]) + unless @enterprise.enabled? && logged_in? + redirect_to :action => 'index' end end diff --git a/app/views/account/_login_form.rhtml b/app/views/account/_login_form.rhtml index 1d960be..7234f5e 100644 --- a/app/views/account/_login_form.rhtml +++ b/app/views/account/_login_form.rhtml @@ -1,5 +1,5 @@ <% labelled_form_for :user, @user, - :url => { :controller => 'account', :action => 'login' }, + :url => { :controller => 'account', :action => (params[:enterprise_code] ? 'activate_enterprise' : 'login') }, :html => { :help => _('If you are a registered user, enter your username and password to be authenticated.')+'
'+_('To join on this environment, click on "I want to be an user!".')+''+_('If you forgot your password, click on "I forgot my password!" link.') } do |f| %> <%= f.text_field :login, diff --git a/app/views/account/welcome.rhtml b/app/views/account/welcome.rhtml new file mode 100644 index 0000000..21956a8 --- /dev/null +++ b/app/views/account/welcome.rhtml @@ -0,0 +1,10 @@ +<% if @enterprise && logged_in? %> +