public class Notary {
- public static void writeUserAgreement(int memid, String document, String method, String comment, boolean active, int secmemid) {
- GigiPreparedStatement q = DatabaseConnection.getInstance().prepare("insert into `user_agreements` set `memid`=?, `secmemid`=?," + " `document`=?,`date`=NOW(), `active`=?,`method`=?,`comment`=?");
- q.setInt(1, memid);
+ public static void writeUserAgreement(User member, String document, String method, String comment, boolean active, int secmemid) {
+ GigiPreparedStatement q = DatabaseConnection.getInstance().prepare("INSERT INTO `user_agreements` SET `memid`=?, `secmemid`=?," + " `document`=?,`date`=NOW(), `active`=?,`method`=?,`comment`=?");
+ q.setInt(1, member.getId());
q.setInt(2, secmemid);
q.setString(3, document);
- q.setInt(4, active ? 1 : 0);
+ q.setBoolean(4, active);
q.setString(5, method);
q.setString(6, comment);
q.execute();
if (assurer.getId() == target.getId()) {
throw new GigiApiException("You cannot assure yourself.");
}
- GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT 1 FROM `notary` where `to`=? and `from`=? AND `deleted`=0");
+ GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT 1 FROM `notary` where `to`=? and `from`=? AND `deleted` IS NULL");
ps.setInt(1, target.getId());
ps.setInt(2, assurer.getId());
GigiResultSet rs = ps.executeQuery();
gae.mergeInto(e);
}
- if ( !assuree.getName().equals(assureeName) || !assuree.getDob().equals(dob)) {
+ if ( !assuree.getName().equals(assureeName) || !assuree.getDoB().equals(dob)) {
gae.mergeInto(new GigiApiException("The person you are assuring changed his personal details."));
}
if (awarded > assurer.getMaxAssurePoints() || awarded < 0) {