123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- .pragma library
- // backend.js
- /*
- Validate the input credential
- Return values are..
- 0 - Success
- 1 - credentials are empty
- */
- function validateUserCredentials(uname, pword) {
- var ret
- if (uname === "" || pword === "") {
- ret = 1
- } else {
- ret = 0
- }
- return ret
- }
- /*
- Validate the input credential to register
- Return values are..
- 0 - Success
- 1 - credentials are empty
- 2 - passwords does not match
- */
- function validateRegisterCredentials(uname, pword, pword2, hint) {
- var ret
- if (uname === "" || pword === "" || pword2 === "" || hint === "") {
- ret = 1
- return ret
- } else if (pword !== pword2) {
- ret = 2
- } else {
- ret = 0
- }
- return ret
- }
- function dot(loadingCount) {
- var str = ""
- for (var i = 0; i < loadingCount; i++) {
- str += "."
- }
- return str
- }
|