Skip to content

Commit ac5b26c

Browse files
committed
Dodałem możliwość logowania do systemu za pomocą WCF-a oraz sprawdzanie statusu użytkownika, przy tworzeniu obiektu opcje są automatycznie pobierane. Zmieniłem minimalną wersję Javy z 1.5 na 1.6.
Signed-off-by: Lukas Redynk <[email protected]>
1 parent 6e5e379 commit ac5b26c

9 files changed

+394
-184
lines changed

.settings/org.eclipse.jdt.core.prefs

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
#Tue Nov 29 13:56:38 CET 2011
1+
#Tue Jan 10 12:51:16 CET 2012
22
eclipse.preferences.version=1
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4-
org.eclipse.jdt.core.compiler.compliance=1.5
5-
org.eclipse.jdt.core.compiler.source=1.5
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6

default.properties

-11
This file was deleted.

src/pl/pg/mif/androVote/WCFConnector/BadLoginException.java

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package pl.pg.mif.androVote.WCFConnector.Exceptions;
2+
3+
public class BadLoginException extends Exception {
4+
5+
private static final long serialVersionUID = 6529362787997138797L;
6+
public String message;;
7+
8+
public BadLoginException() {
9+
message = "Zły login lub hasło!";
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package pl.pg.mif.androVote.WCFConnector.Exceptions;
2+
3+
public class IOSettingsException extends Exception {
4+
5+
private static final long serialVersionUID = -5172242273940798841L;
6+
public String message;
7+
8+
public IOSettingsException()
9+
{
10+
message = "Nie można załadować ustawień, błąd wejścia/wyjścia.";
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package pl.pg.mif.androVote.WCFConnector.Exceptions;
2+
3+
public class ServerConnectionException extends Exception {
4+
5+
private static final long serialVersionUID = -4358669880778239777L;
6+
public String message;
7+
8+
public ServerConnectionException()
9+
{
10+
message = "Błąd podczas połączenia z serwerem. Sprawdź swoje łącze oraz ustawienia adresu i portu serwera";
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package pl.pg.mif.androVote.WCFConnector;
2+
3+
/**
4+
* Class represents user in system.
5+
* @author Erdk
6+
*
7+
*/
8+
public class UserInfo {
9+
public int getId() {
10+
return id;
11+
}
12+
public void setId(int id) {
13+
this.id = id;
14+
}
15+
public String getUsername() {
16+
return username;
17+
}
18+
public void setUsername(String username) {
19+
this.username = username;
20+
}
21+
public String getPassword() {
22+
return password;
23+
}
24+
public void setPassword(String password) {
25+
this.password = password;
26+
}
27+
public boolean getIsAdmin() {
28+
return isAdmin;
29+
}
30+
31+
public String getUserFirstAndLastName() {
32+
return userFirstAndLastName;
33+
}
34+
public void setUserFirstAndLastName(String userFirstAndLastName) {
35+
this.userFirstAndLastName = userFirstAndLastName;
36+
}
37+
public void setAdmin(boolean isAdmin) {
38+
this.isAdmin = isAdmin;
39+
}
40+
41+
/**
42+
* User id in database, used in voting!
43+
*/
44+
int id;
45+
46+
/**
47+
* User username used at login time.
48+
*/
49+
String username;
50+
51+
/**
52+
* User's password.
53+
*/
54+
String password;
55+
56+
/**
57+
* IMPORTANT! Determines wheater user is admin.
58+
*/
59+
boolean isAdmin;
60+
61+
62+
public boolean isLogged() {
63+
return isLogged;
64+
}
65+
public void setLogged(boolean isLogged) {
66+
this.isLogged = isLogged;
67+
}
68+
69+
boolean isLogged;
70+
71+
/**
72+
* Real first and lastname from database
73+
*/
74+
String userFirstAndLastName;
75+
}

src/pl/pg/mif/androVote/WCFConnector/VoteInfo.java

+9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ public void setAnswers(String[] answers) {
5959
this.answers = answers;
6060
}
6161

62+
public int getUserId() {
63+
return userId;
64+
}
65+
66+
public void setUserId(int userId) {
67+
this.userId = userId;
68+
}
69+
6270
private int id;
71+
private int userId;
6372
private String name;
6473
private String beginDate;
6574
private String endDate;

0 commit comments

Comments
 (0)