@ -137,28 +137,35 @@ void getNewEmployeeCredentials()
passwordVerfication [ strlen ( employeePassword ) ] = ' \0 ' ;
if ( verifyPassword ( passwordVerfication , employeePassword ) )
if ( verifyPassword ( passwordVerfication , employeePassword ) & & isValidPassword ( employeePassword , minPasswordLength ) & & isValidEmployeeID ( employeeId , maxLength ) )
{
printf ( " \n \n please enter your first name \n " ) ;
scanf ( " %s " , data - > firstName ) ;
printf ( " \n \n please enter your last name \n " ) ;
scanf ( " %s " , data - > lastName ) ;
printf ( " \n \n please enter your adress \n " ) ;
scanf ( " %s " , data - > adress ) ;
printf ( " \n \n please enter your Phone number \n " ) ;
scanf ( " %s " , data - > phoneNumber ) ;
if ( isValidEmployeeID ( employeeId , maxLength ) & & isValidPassword ( employeePassword , minPasswordLength ) )
{
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 , maxLength ) & & ! isValidPassword ( employeePassword , minPasswordLength ) )
{
printf ( " Error : the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 symbol! " ) ;
}
else
{
printf ( " Error : the entered ID should contain a maximum of 20 letters " ) ;
}
storeEmployeeData ( data - > firstName , data - > lastName , data - > adress , data - > phoneNumber ) ;
}
else
{
printf ( " the Verification password and the entered password dont match " ) ;
printf ( " \n \n Error! one of these conditions is not met in your input \n \n " ) ;
printf ( " \n -the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 symbol! \n " ) ;
printf ( " \n -the entered ID should contain a maximum of 20 letters! \n " ) ;
printf ( " \n -the verification password should match with the entered password. \n " ) ;
}
}