Skip to content

Instantly share code, notes, and snippets.

@gpickin
Created May 7, 2014 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpickin/ffada89b27fd596d31ea to your computer and use it in GitHub Desktop.
Save gpickin/ffada89b27fd596d31ea to your computer and use it in GitHub Desktop.
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;
}
}
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