]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/User.java
Convert strange flags to Groups.
[gigi.git] / src / org / cacert / gigi / dbObjects / User.java
index 6de799aeacb4e7a5461e1482b112ebf3bff59643..dc79fd960cf7514d8e41b65373bbff267d73d5f0 100644 (file)
@@ -112,10 +112,6 @@ public class User implements IdCachable {
         this.email = email;
     }
 
-    public void setId(int id) {
-        this.id = id;
-    }
-
     public void setFname(String fname) {
         this.name.fname = fname;
     }
@@ -128,7 +124,7 @@ public class User implements IdCachable {
         if (id != 0) {
             throw new Error("refusing to insert");
         }
-        GigiPreparedStatement query = DatabaseConnection.getInstance().prepare("insert into `users` set `email`=?, `password`=?, " + "`fname`=?, `mname`=?, `lname`=?, " + "`suffix`=?, `dob`=?, `created`=NOW(), locked=0, `language`=?");
+        GigiPreparedStatement query = DatabaseConnection.getInstance().prepare("insert into `users` set `email`=?, `password`=?, " + "`fname`=?, `mname`=?, `lname`=?, " + "`suffix`=?, `dob`=?, `created`=NOW(), `language`=?");
         query.setString(1, email);
         query.setString(2, PasswordHash.hash(password));
         query.setString(3, name.fname);
@@ -490,7 +486,7 @@ public class User implements IdCachable {
         return Collections.unmodifiableSet(groups);
     }
 
-    public void grantGroup(User granter, Group toGrant) throws GigiApiException {
+    public void grantGroup(User granter, Group toGrant) {
         groups.add(toGrant);
         GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO user_groups SET user=?, permission=?, grantedby=?");
         ps.setInt(1, getId());
@@ -499,7 +495,7 @@ public class User implements IdCachable {
         ps.execute();
     }
 
-    public void revokeGroup(User revoker, Group toRevoke) throws GigiApiException {
+    public void revokeGroup(User revoker, Group toRevoke) {
         groups.remove(toRevoke);
         GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE user_groups SET deleted=CURRENT_TIMESTAMP, revokedby=? WHERE deleted is NULL AND permission=? AND user=?");
         ps.setInt(1, revoker.getId());