import org.cacert.gigi.GigiApiException;
import org.cacert.gigi.database.DatabaseConnection;
import org.cacert.gigi.database.GigiPreparedStatement;
+import org.cacert.gigi.dbObjects.Certificate.CertificateStatus;
public class SupportedUser {
- private User target, supporter;
+ private User target;
+
+ private User supporter;
private String ticket;
public void revokeAllCertificates() throws GigiApiException {
writeSELog("SE Revoke certificates");
Certificate[] certs = target.getCertificates(false);
+ // TODO Check for open jobs!
for (int i = 0; i < certs.length; i++) {
- certs[i].revoke();
+ if (certs[i].getStatus() == CertificateStatus.ISSUED) {
+ certs[i].revoke();
+ }
}
}
if (ticket == null) {
throw new GigiApiException("No ticket set!");
}
- GigiPreparedStatement prep = DatabaseConnection.getInstance().prepare("INSERT INTO adminLog SET uid=?, admin=?, type=?, information=?");
+ GigiPreparedStatement prep = DatabaseConnection.getInstance().prepare("INSERT INTO `adminLog` SET uid=?, admin=?, type=?, information=?");
prep.setInt(1, target.getId());
prep.setInt(2, supporter.getId());
prep.setString(3, type);