]> WPIA git - gigi.git/commitdiff
ADD: Set user's contact information
authorJanis Streib <janis@dogcraft.de>
Sun, 24 Aug 2014 09:42:11 +0000 (11:42 +0200)
committerJanis Streib <janis@dogcraft.de>
Sun, 24 Aug 2014 09:43:55 +0000 (11:43 +0200)
src/org/cacert/gigi/User.java

index 22f76c4c5f8347e968e6d6c65b54948d8e9e3c8b..be8a6ec6202de813442dc7752dcc80405feeec59 100644 (file)
@@ -466,4 +466,18 @@ public class User {
         exec.next();
         return exec.getString("contactinfo");
     }
+
+    public void setDirectoryListing(boolean on) throws SQLException {
+        PreparedStatement update = DatabaseConnection.getInstance().prepare("UPDATE users SET listme = ? WHERE id = ?");
+        update.setBoolean(1, on);
+        update.setInt(2, getId());
+        update.executeUpdate();
+    }
+
+    public void setContactInformation(String contactInfo) throws SQLException {
+        PreparedStatement update = DatabaseConnection.getInstance().prepare("UPDATE users SET contactinfo = ? WHERE id = ?");
+        update.setString(1, contactInfo);
+        update.setInt(2, getId());
+        update.executeUpdate();
+    }
 }