]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/Organisation.java
fix: correct validation of minimum and maximum ages
[gigi.git] / src / club / wpia / gigi / dbObjects / Organisation.java
index c47a7837ba3cbda87d7cb83390bd2d73194faf92..7029929388a9854eb46618307def03f87bfa71d9 100644 (file)
@@ -145,6 +145,9 @@ public class Organisation extends CertificateOwner {
     }
 
     public synchronized void addAdmin(User admin, User actor, boolean master) throws GigiApiException {
+        if (actor == admin) {
+            throw new GigiApiException("You may not add yourself as Organisation Admin. Ask another Organisation Agent to do so.");
+        }
         if ( !admin.canVerify()) {
             throw new GigiApiException("Cannot add person who is not RA Agent.");
         }
@@ -195,7 +198,7 @@ public class Organisation extends CertificateOwner {
     }
 
     public static Organisation[] getOrganisations(int offset, int count) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT `certOwners`.`id` FROM `organisations` INNER JOIN `certOwners` ON `certOwners`.`id`=`organisations`.`id` WHERE `certOwners`.`deleted` IS NULL OFFSET ? LIMIT ?", true)) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT `certOwners`.`id` FROM `organisations` INNER JOIN `certOwners` ON `certOwners`.`id`=`organisations`.`id` WHERE `certOwners`.`deleted` IS NULL OFFSET ?::INTEGER LIMIT ?::INTEGER", true)) {
             ps.setInt(1, offset);
             ps.setInt(2, count);
             GigiResultSet res = ps.executeQuery();