1 package authentication
;
3 import java
.sql
.ResultSet
;
6 public class Authenticator
extends AbstractAuthenticator
{
8 public Credential
[] getEmptyCredentials() throws Exception
10 Credential credentials
[] = new Credential
[3];
12 credentials
[0] = new Credential("Project", false);
13 credentials
[1] = new Credential("User", false);
14 credentials
[2] = new Credential("Password", true);
19 protected boolean checkCredentials(String session_id
, Credential
[] credentials
) throws Exception
22 String checkSQL
= "select 1 from user u, project p, user_project up " +
23 "where u.login='" + credentials
[1].getValue() + "' " +
24 "and u.password=md5('" + credentials
[2].getValue() + "') " +
25 "and p.name='" + credentials
[0].getValue() + "' " +
26 "and up.user_id=u.id " +
27 "and up.project_id=p.id";
30 sql
= new SQLHelper();
32 return sql
.retrieve(checkSQL
).next();