Sistema di Login teoricamente completo. Nel main la classe LoginData si occupa di fare tutto. Per richiamare chi è loggato basta chiamare il metodo .getUserName. Per richiamre il tipo di account .getType. Per stamapre le info di chi è loggato .getUserDataInfo

This commit is contained in:
2013-12-17 02:12:22 +01:00
parent 148676ba75
commit d2cb67f169
5 changed files with 173 additions and 16 deletions

View File

@@ -0,0 +1,49 @@
package it.unisa.info13d.Login;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* Created with MONSTER.
* User: xgiovio
* Date: 17/12/13
* Time: 1.47
*/
public class LoginData {
public LoginData () throws FileNotFoundException,IOException,ClassNotFoundException{
LoggedUser logged_user = new LoggedUser();
boolean AccountType = true;
AccountType = Access.get_access(logged_user);
type = convert_type (AccountType);
username = logged_user.logged_user;
}
protected String convert_type (boolean value){
if (value == false)
return "Admin";
return "Client";
}
public String getUsername() {
return username;
}
public String getType() {
return type;
}
public void getUserDataInfo (){
System.out.println("***************************************");
System.out.println("Utente Loggato : " + username);
System.out.println("AccoutType : " + type );
System.out.println("***************************************");
}
private String username;
private String type;
}