Created
May 5, 2010 05:18
-
-
Save maiha/390409 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def login_required(email: String, password: String) { | |
| User.find("byEmail", email).first match { | |
| case u:User if u.password == password => | |
| session.put("user", u.email) | |
| Application.index | |
| case u:User => render("reminder", u.email) | |
| case _ => access_denied | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def login_required | |
| user = User.first(:email=>params[:email]) | |
| if user and user.password == params[:password] | |
| return true | |
| elsif user | |
| render :partial=>"reminder", :locals=>{:email=>params[:email]} | |
| return false | |
| else | |
| access_denied | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment