|
@ -48,6 +48,24 @@ bool isValidPassword( char *password, int minimumLength) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool isValidName(char* name, int minimalLength) |
|
|
|
|
|
{ |
|
|
|
|
|
if(strlen(name) < minimalLength) |
|
|
|
|
|
{ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0;i<strlen(name);i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if(isdigit(name[i])||ispunct(name[i])||isspace(name[i])) |
|
|
|
|
|
{ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int StringLengthCounter(char* string) |
|
|
int StringLengthCounter(char* string) |
|
|
{ |
|
|
{ |
|
|
int characterCounter = 0; |
|
|
int characterCounter = 0; |
|
@ -112,6 +130,7 @@ void getNewEmployeeCredentials() |
|
|
const int maxLength = 21; |
|
|
const int maxLength = 21; |
|
|
char employeeId[maxLength]; |
|
|
char employeeId[maxLength]; |
|
|
const int minPasswordLength = 5; |
|
|
const int minPasswordLength = 5; |
|
|
|
|
|
const int minimumNameLength = 4; |
|
|
char employeePassword[maxLength]; |
|
|
char employeePassword[maxLength]; |
|
|
char passwordVerfication[maxLength]; |
|
|
char passwordVerfication[maxLength]; |
|
|
|
|
|
|
|
|