From be5bf789a6f1ddd1536b1a82ee2c212368cdb60f Mon Sep 17 00:00:00 2001 From: Jon Huang Date: Fri, 24 Apr 2015 13:43:41 -0400 Subject: [PATCH] Changed create user method to include permissions --- bin/.gitignore | 8 ++------ bin/InputOutput/InputOutput.class | Bin 3249 -> 3249 bytes bin/testing/Networking_Test.class | Bin 479 -> 479 bytes bin/testing/TestforIO.class | Bin 327 -> 327 bytes bin/testing/ThermostatTest.class | Bin 2988 -> 2988 bytes bin/thermostat/Sensorable.class | Bin 294 -> 294 bytes bin/thermostat/TemperatureSensor.class | Bin 1244 -> 1244 bytes bin/thermostat/ThermostatDevice.class | Bin 3407 -> 3426 bytes src/InputOutput/Database.java | 3 ++- src/InputOutput/Thermostatable.java | 2 +- src/server/server.java | 6 +++--- src/testing/DataStructureTest.java | 2 +- src/testing/DatabaseTest.java | 5 +++-- 13 files changed, 12 insertions(+), 14 deletions(-) diff --git a/bin/.gitignore b/bin/.gitignore index 1efcc2d..7038338 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,10 +1,6 @@ -/InputOutput/ -/UML.cld -/Use_Cases.ucd -/interface_xml_files/ -/main/ /networking/ /server/ -/testing/ /thermostat/ /user_interface/ +/InputOutput/ +/testing/ diff --git a/bin/InputOutput/InputOutput.class b/bin/InputOutput/InputOutput.class index aab24998fc7d46ffe07b51ce81748702b5dccfba..a41adec1494baa0dc3c57b2afa4ffe72e3e29586 100644 GIT binary patch delta 17 Zcmdlexlxki)W2Q(7#J9gH*&1x0RTZ127Ukl delta 17 Zcmdlexlxki)W2Q(7#J8#Hgc@w0RTZ627dqm diff --git a/bin/testing/Networking_Test.class b/bin/testing/Networking_Test.class index 7263198dafb400362112b39b4a18f2301029705c..c8e8db675d9eb5ea07abdfeca4526df8282bb3ac 100644 GIT binary patch delta 17 Zcmcc5e4m-))W2Q(7#J9gH*#EO1OP;l2GIZj delta 17 Zcmcc5e4m-))W2Q(7#J8#Hga5N1OP;q2GRfk diff --git a/bin/testing/TestforIO.class b/bin/testing/TestforIO.class index 6e069f9113045fe5e8add129ac28d1779b874ac4..e26a3a5941ef99d7c13b65a2ac4d081dd82fa1ae 100644 GIT binary patch delta 17 ZcmX@kbexIf)W2Q(7#J9gH*(lB0sufm1_uBD delta 17 ZcmX@kbexIf)W2Q(7#J8#HgecA0sufr1_%HE diff --git a/bin/testing/ThermostatTest.class b/bin/testing/ThermostatTest.class index 4e6ea8b846391069248b72243a1df65f455b5f6d..d941866e6088f04aea01b796f67ee44c5c8746bc 100644 GIT binary patch delta 17 ZcmZ1@zDAtm)W2Q(7#J9gH*zfD1^_@U25JBR delta 17 ZcmZ1@zDAtm)W2Q(7#J8#HgYWC1^_@Z25SHS diff --git a/bin/thermostat/Sensorable.class b/bin/thermostat/Sensorable.class index 73d50017f730ceb00ba8740d58d8f7754b19ebaf..23d63f9c35caf531860864d86458925e9ce7da8c 100644 GIT binary patch delta 17 ZcmZ3+w2X=4)W2Q(7#J9gH*&}^0suSV1*8A~ delta 17 ZcmZ3+w2X=4)W2Q(7#J8#Hgd=@0suSa1*HH0 diff --git a/bin/thermostat/TemperatureSensor.class b/bin/thermostat/TemperatureSensor.class index bdb0ed8c166251162f22fbf541bf9874311b5008..bc2781ec280180fa9b0dbe352add7cd48a417976 100644 GIT binary patch delta 17 Zcmcb^d54qZ)W2Q(7#J9gH*#EI0RTke2G;-p delta 17 Zcmcb^d54qZ)W2Q(7#J8#Hga5H0RTkj2G{@q diff --git a/bin/thermostat/ThermostatDevice.class b/bin/thermostat/ThermostatDevice.class index 9c8c7d71896c3d67c4a1e3fcd3acc27414c0c8ff..a603d5f578e71a6e497afa3828e59da24aa3dd54 100644 GIT binary patch delta 1594 zcmY+ES$9)a6vuxj3As1vg|-2Sqz!EWJEYXu!7`&Dr36~2whTcOLyZt9ElmRyMB{|0 z42oApa8|Tx5iO93uI1v{7e9e7Jh}V~F6+KG(&EZm=j^lR{r~Tq-vf68-rxSY{VUMQ zl=1>P*fSrWu7I~7(7sv78}fGo|l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 zlvaCNYwi0Y*WzZzf_IqbfXjgwI*Du6hRN zJytUu2o1GQ1cJwnu#5(V!d*r%I998T&S(>%!1#orc{{W~WV@!I4vz|$TN(1J_2cg!+rt#0B^IEmH6?rghLDuu4NKQR2;@L{IpHmGr*7|Y}1~| z6j9^p4~!aN1v&;L9J^ynGwThR#*h(KaU2FUO?~axgA=6E5WNbHU`Ui5=6~7T*&`~l zkS#8QDn?Oqy)r{)<+FHB!fB$@95%wEV-Zs~Jw78884K&jf`*DSi1NMm>gWp$xxL1e zmbPh~lSarC138O12`}9r-=Uj&-?0&6ka{|Uml^V^s=L<)o;EcrconZpcMJ}~}EV?Y@1M*?nkFQiL;A?(c zuCQOlcM`tkf6LCi?*$H9$e1=WF^eBn{Dcx->?o73;+l%ioG| z5@>YaKy@73;%JHEu?1xJ)W*@V09l+~_cFTu3G~L$x2Eo)kiKR3{O)K1`;s_l!2z-! z@z=z0G{^eKFqJ>Y1 zDQ%LpDY83ZT_HRc2~48JCDBQ5(rz1tOk*a^CN5BjV6&kniDwyl?vnOAkw)CScnf-z z8eYOHtMs|kt_jR9Qee8t+!VHYNZ3N~8%Q>$Fl*`LtC$;b5pPjx`aFT-Z9@7E-oNe1cEONu~JDXc{cVw+!|#RAQT+ z&+)~b8t3Q~bE_2ll*E?|y$e{kDT!|wZeg~kHi;h?=>HSr9R1PiLh9Z{2!4jN{|2m diff --git a/src/InputOutput/Database.java b/src/InputOutput/Database.java index ea7c60e..8ad7575 100644 --- a/src/InputOutput/Database.java +++ b/src/InputOutput/Database.java @@ -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; } diff --git a/src/InputOutput/Thermostatable.java b/src/InputOutput/Thermostatable.java index e4717af..3a555d4 100644 --- a/src/InputOutput/Thermostatable.java +++ b/src/InputOutput/Thermostatable.java @@ -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); diff --git a/src/server/server.java b/src/server/server.java index 67ca602..d9d89bf 100644 --- a/src/server/server.java +++ b/src/server/server.java @@ -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; } diff --git a/src/testing/DataStructureTest.java b/src/testing/DataStructureTest.java index 2cb7b55..0386299 100644 --- a/src/testing/DataStructureTest.java +++ b/src/testing/DataStructureTest.java @@ -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; } diff --git a/src/testing/DatabaseTest.java b/src/testing/DatabaseTest.java index faa7066..df4af24 100644 --- a/src/testing/DatabaseTest.java +++ b/src/testing/DatabaseTest.java @@ -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 testuser = testbase.getUserFromEmail("herp@derp.com"); if(testuser.get("email").equals("herp@derp.com")){ @@ -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; }