Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 1:
- String user;
- String pswd;
- do{
- System.out.print("AUTHENTICATION !");
- System.out.print("Enter UserName\n");
- user = input.next();
- System.out.print("Enter Password:\n");
- pswd = input.next();
- index = users.search(user);
- if (index<0){
- System.out.println("step1\n\n");
- index=teachers.search(user);
- if (index<0)
- try{
- System.out.println("Step3\n\n");
- if(teachers.getTeacher(index).Authenticate(user, pswd)){
- System.out.println("Authentification Successful!\n\n");
- }
- else
- throw new PassException();
- }catch(PassException ex){
- System.out.println(ex.getMessage());
- }
- // Authentification successful
- if(index>0){
- System.out.println("Teacher found");
- }
- }
- else {
- try{
- if(users.getUser(index).Authenticate(user, pswd)){
- System.out.println("Authentification Successful!\n\n");
- }
- else
- throw new PassException();
- }catch(PassException ex){
- System.out.println(ex.getMessage());
- }
- // Authentification successful
- }
- }while( index == -1);
Add Comment
Please, Sign In to add comment