private String city;
- public Organisation(String name, String state, String province, String city, User creator) {
+ private String email;
+
+ public Organisation(String name, String state, String province, String city, String email, User creator) {
this.name = name;
this.state = state;
this.province = province;
this.city = city;
+ this.email = email;
int id = super.insert();
- GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO organisations SET id=?, name=?, state=?, province=?, city=?, creator=?");
+ GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO organisations SET id=?, name=?, state=?, province=?, city=?, contactEmail=?, creator=?");
ps.setInt(1, id);
ps.setString(2, name);
ps.setString(3, state);
ps.setString(4, province);
ps.setString(5, city);
- ps.setInt(6, creator.getId());
+ ps.setString(6, email);
+ ps.setInt(7, creator.getId());
synchronized (Organisation.class) {
ps.execute();
}
state = rs.getString("state");
province = rs.getString("province");
city = rs.getString("city");
+ city = rs.getString("contactEmail");
}
public String getName() {
return city;
}
+ public String getContactEmail() {
+ return email;
+ }
+
public static synchronized Organisation getById(int id) {
CertificateOwner co = CertificateOwner.getById(id);
if (co instanceof Organisation) {
}
public static Organisation[] getOrganisations(int offset, int count) {
- GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT id FROM organisations LIMIT ?,?");
+ GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT certOwners.id FROM organisations inner join certOwners on certOwners.id=organisations.id where certOwners.deleted is null LIMIT ?,?");
ps.setInt(1, offset);
ps.setInt(2, count);
GigiResultSet res = ps.executeQuery();
}
public void update(String o, String c, String st, String l) {
- for (Certificate cert : getCertificates()) {
+ for (Certificate cert : getCertificates(false)) {
if (cert.getStatus() == CertificateStatus.ISSUED) {
cert.revoke();
}