Skip to content

Instantly share code, notes, and snippets.

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