From: Janis Streib Date: Sun, 24 Aug 2014 09:31:32 +0000 (+0200) Subject: ADD: Get infomation about user's directory listing options X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=44420bae8ce64dc0e03427bdd821c89fc24cd18b ADD: Get infomation about user's directory listing options --- diff --git a/src/org/cacert/gigi/User.java b/src/org/cacert/gigi/User.java index ca1c8ff8..22f76c4c 100644 --- a/src/org/cacert/gigi/User.java +++ b/src/org/cacert/gigi/User.java @@ -7,8 +7,8 @@ import java.sql.SQLException; import java.util.Calendar; import org.cacert.gigi.database.DatabaseConnection; -import org.cacert.gigi.util.Notary; import org.cacert.gigi.localisation.Language; +import org.cacert.gigi.util.Notary; import org.cacert.gigi.util.PasswordHash; import org.cacert.gigi.util.PasswordStrengthChecker; @@ -450,4 +450,20 @@ public class User { public Language getPrefferedLanguage() { return Language.getInstance("de"); } + + public boolean wantsDirectoryListing() throws SQLException { + PreparedStatement get = DatabaseConnection.getInstance().prepare("SELECT listme FROM users WHERE id=?"); + get.setInt(1, getId()); + ResultSet exec = get.executeQuery(); + exec.next(); + return exec.getBoolean("listme"); + } + + public String getContactInformation() throws SQLException { + PreparedStatement get = DatabaseConnection.getInstance().prepare("SELECT contactinfo FROM users WHERE id=?"); + get.setInt(1, getId()); + ResultSet exec = get.executeQuery(); + exec.next(); + return exec.getString("contactinfo"); + } }