Skip to content

Commit

Permalink
Changed create user method to include permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
jyh09001 committed Apr 24, 2015
1 parent bb69314 commit be5bf78
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 14 deletions.
8 changes: 2 additions & 6 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/InputOutput/
/UML.cld
/Use_Cases.ucd
/interface_xml_files/
/main/
/networking/
/server/
/testing/
/thermostat/
/user_interface/
/InputOutput/
/testing/
Binary file modified bin/InputOutput/InputOutput.class
Binary file not shown.
Binary file modified bin/testing/Networking_Test.class
Binary file not shown.
Binary file modified bin/testing/TestforIO.class
Binary file not shown.
Binary file modified bin/testing/ThermostatTest.class
Binary file not shown.
Binary file modified bin/thermostat/Sensorable.class
Binary file not shown.
Binary file modified bin/thermostat/TemperatureSensor.class
Binary file not shown.
Binary file modified bin/thermostat/ThermostatDevice.class
Binary file not shown.
3 changes: 2 additions & 1 deletion src/InputOutput/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ public Database(Thermostatable owner){

}

public boolean createUser(String email, String password, String ip){
public boolean createUser(String email, String password, String ip, String serialpermission){
this.updateTable("UserTable", email, "email", email);
this.updateTable("UserTable", email, "password", password);
this.updateTable("UserTable", email, "ipaddress", ip);
this.updateTable("UserTable", email, "devices", serialpermission);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/InputOutput/Thermostatable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//Methods for calling thermostat information

public interface Thermostatable {
public boolean createUser(String email, String password, String ip);
public boolean createUser(String email, String password, String ip, String serialpermission);

public boolean createThermostat(String serial, String name, String desiredTemp);

Expand Down
6 changes: 3 additions & 3 deletions src/server/server.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public server() {
String ip = "127.0.0.1";
String email = "admin@uconn.edu";
Database dataStorage = new Database(this);
dataStorage.createUser(email, adminpassword, ip);
dataStorage.createUser(email, adminpassword, ip, null);
}

public void receiveCurrentTemp() throws Exception {
super.receiveCurrentTemp(receiveCurrentTempPORT);
}

public boolean createUser(String email, String password, String ip) {
dataStorage.createUser(email, password, ip);
public boolean createUser(String email, String password, String ip, String serialpermission) {
dataStorage.createUser(email, password, ip, null);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/testing/DataStructureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void main(String[] args){
}

@Override
public boolean createUser(String email, String password, String ip) {
public boolean createUser(String email, String password, String ip, String serialpermission) {
// TODO Auto-generated method stub
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions src/testing/DatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DatabaseTest implements Thermostatable, Serializable{
public DatabaseTest(){
Database testbase =new Database(this);

testbase.createUser("herp@derp.com", "herpderp", "123456789.0");
testbase.createUser("herp@derp.com", "herpderp", "123456789.0", null);
Hashtable<String, String> testuser = testbase.getUserFromEmail("herp@derp.com");

if(testuser.get("email").equals("herp@derp.com")){
Expand All @@ -29,10 +29,11 @@ public DatabaseTest(){
System.out.println("ip pass");
}

if(testuser.get()))
}

@Override
public boolean createUser(String email, String password, String ip) {
public boolean createUser(String email, String password, String ip, String serialpermission) {
// TODO Auto-generated method stub
return false;
}
Expand Down

0 comments on commit be5bf78

Please sign in to comment.