diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index 3951a63..37b8452 100644 --- a/src/createEmployeeAccount.c +++ b/src/createEmployeeAccount.c @@ -105,14 +105,19 @@ void getNewEmployeeCredentials() employeePassword[strlen(employeePassword)] = '\0'; - if(isValidEmployeeID(employeeId,employeeIdLength)) + if(isValidEmployeeID(employeeId,employeeIdLength) && isValidPassword(employeePassword,minimumPasswordLength)) { createNewEmployee(employeeId,employeePassword) ? printf("\n\n Account created successfully !\n\n") : printf("\n\n Could not create the Account please contact an employee of clearance 1 !\n\n"); } + else if(isValidEmployeeID(employeeId,employeeIdLength) && !isValidPassword(employeePassword,minimumPasswordLength)) + { + printf("Error : the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 punctuation character!"); + } + else { - printf("Error : the entered ID either contains space or exceeds the maximum of 20 characters!"); + printf("Error : the entered ID should contain a maximum of 20 letters"); } }