|
|
@ -4,7 +4,7 @@ |
|
|
|
bool employeesAccess(char* employeesAccessCode) |
|
|
|
{ |
|
|
|
|
|
|
|
if(strcmp(employeesAccessCode,accessKey) == 0) |
|
|
|
if(strcmp(employeesAccessCode,employeeAccessKey) == 0) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
@ -55,6 +55,43 @@ extern int checkEmployeeCredentials(char *inputUsername, char *inputPassword) |
|
|
|
free(inputPassword); |
|
|
|
} |
|
|
|
|
|
|
|
void inputEmployeeAccessCode() |
|
|
|
{ |
|
|
|
char accessKey[10]; |
|
|
|
|
|
|
|
int remainingAttempts = 10; |
|
|
|
|
|
|
|
|
|
|
|
printf("\n\nPlease enter the Access key : "); |
|
|
|
// scanf("%s",accessKey); |
|
|
|
|
|
|
|
while(remainingAttempts>0) |
|
|
|
{ |
|
|
|
scanf("%s",accessKey); |
|
|
|
|
|
|
|
if(employeesAccess(accessKey)==true) |
|
|
|
{ |
|
|
|
printf("\n\nAccess granted!\n\n"); |
|
|
|
|
|
|
|
loginAsEmployee(); |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
--remainingAttempts; |
|
|
|
printf("\n\nAccess key didnt match! try again !\n\n"); |
|
|
|
|
|
|
|
} |
|
|
|
if(remainingAttempts == 0) |
|
|
|
{ |
|
|
|
printf("you've reached the maximum number of tries!\nplease contact an employee of a high clearance(2 or higher) \n\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void employeeCredentials(char* inputUsername,char* inputPassword) |
|
|
|
{ |
|
|
|
printf("Enter username: "); |
|
|
|