Created
May 7, 2014 16:06
-
-
Save gpickin/ffada89b27fd596d31ea to your computer and use it in GitHub Desktop.
This file contains 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
if ( len(arguments.email) lte 5) { | |
// email too short | |
return 0; | |
} | |
else if ( len(arguments.password) eq 0 ) { | |
// empty password | |
return 0; | |
} | |
else { | |
var userDAO = uDAO; | |
var user = userDAO.getUserByLogin( arguments.email, arguments.password ); | |
if ( user.recordcount eq 0) { | |
// no user found with email and password | |
return 0; | |
} | |
else if ( user.deletedat neq "") { | |
// user has been deleted | |
return 0; | |
} | |
else { | |
//login successful | |
return user.id; | |
} | |
} |
This file contains 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
if ( len(arguments.email) lte 5) { | |
// email too short | |
thereturn = 0; | |
} | |
else if ( len(arguments.password) eq 0 ) { | |
// empty password | |
thereturn = 0; | |
} | |
else { | |
var userDAO = uDAO; | |
var user = userDAO.getUserByLogin( arguments.email, arguments.password ); | |
if ( user.recordcount eq 0) { | |
// no user found with email and password | |
thereturn = 0; | |
} | |
else if ( user.deletedat neq "") { | |
// user has been deleted | |
thereturn = 0; | |
} | |
else { | |
//login successful | |
thereturn = user.id; | |
} | |
} | |
return thereturn; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment