1 package org.cacert.gigi.dbObjects;
5 import org.cacert.gigi.database.DatabaseConnection;
6 import org.cacert.gigi.database.GigiPreparedStatement;
8 public class SupportedUser {
10 private User target, supporter;
12 private String ticket;
14 public SupportedUser(User target, User supporter, String ticket) {
15 this.supporter = supporter;
20 public void setName(String fname, String mname, String lname, String suffix) {
21 writeSELog("SE Name change");
22 target.setName(new Name(fname, lname, mname, suffix));
25 public void setDob(Date dob) {
26 writeSELog("SE dob change");
30 public void revokeAllCertificates() {
31 writeSELog("SE Revoke certificates");
32 Certificate[] certs = target.getCertificates(false);
33 for (int i = 0; i < certs.length; i++) {
38 public void writeSELog(String type) {
39 GigiPreparedStatement prep = DatabaseConnection.getInstance().prepare("INSERT INTO adminLog SET uid=?, admin=?, type=?, information=?");
40 prep.setInt(1, target.getId());
41 prep.setInt(2, supporter.getId());
42 prep.setString(3, type);
43 prep.setString(4, ticket);
48 return target.getId();
51 public Certificate[] getCertificates(boolean includeRevoked) {
52 return target.getCertificates(includeRevoked);
55 public String getTicket() {