-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuthentication.java
More file actions
56 lines (38 loc) · 992 Bytes
/
Authentication.java
File metadata and controls
56 lines (38 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package MemoryGrid;
import java.io.*;
public class Authentication {
public String description="The autentication module is used to authenticate the username and password in the database";
protected int result=0;
protected void validate_username(String username) throws IOException
{
String names[]=DB_Accessor.getusername();
for(int i=0;i<GameSystem.no_of_users;i++)
{
if (username.equals(names[i]))
{
this.result=i;
System.out.println("Authentication over");
return;
}
}
this.result=-1;
System.out.println("Authentication over");
return;
}
protected void validate_password(String password) throws IOException
{
String pass[]=DB_Accessor.getpassword();
for(int i=0;i<GameSystem.no_of_users;i++)
{
if (password.equals(pass[i]))
{
this.result=i;
System.out.println("Authentication over");
return;
}
}
this.result=-1;
System.out.println("Authentication over");
return;
}
}