Created
May 7, 2014 16:15
-
-
Save gpickin/7d98f35a8c268a1b0e7c 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) 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; | |
} |
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment