Sha256: 6cc4fd129d2ec336115dffd41ee72652e5e63b6db7f4f8893c43c72a845bc6b6

Contents?: true

Size: 654 Bytes

Versions: 11

Compression:

Stored size: 654 Bytes

Contents

class ResetPasswordPortlet < Portlet

  def render
    flash[:reset_password] = {}
    
    unless params[:token]
      flash[:reset_password][:error] = "No password token given"
      return
    end

    @user = User.find_by_reset_token(params[:token])

    unless @user
      flash[:reset_password][:notice] = "Invalid password token"    
      return
    end

    if request.method == :post
      @user.password = params[:password]
      @user.password_confirmation = params[:password_confirmation]
      
      if @user.save
        flash[:reset_password][:notice] = 'Password has been reset'
      end
    end
  end

end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
browsercms-3.1.5 app/portlets/reset_password_portlet.rb
browsercms-3.1.4 app/portlets/reset_password_portlet.rb
browsercms-3.1.3 app/portlets/reset_password_portlet.rb
bf4-browsercms-3.1.0 app/portlets/reset_password_portlet.rb
drujensen-browsercms-3.2.0 app/portlets/reset_password_portlet.rb
browsercms-3.1.2 app/portlets/reset_password_portlet.rb
browsercms-3.1.1 app/portlets/reset_password_portlet.rb
browsercms-3.1.0 app/portlets/reset_password_portlet.rb
we5-browsercms-3.1.0 app/portlets/reset_password_portlet.rb
we5-browsercms-3.0.5.1 app/portlets/reset_password_portlet.rb
we5-browsercms-3.0.5 app/portlets/reset_password_portlet.rb