- try {
- PreparedStatement q1 = DatabaseConnection.getInstance().prepare("select * from `emails` where `email`=? and `deleted`=0");
- PreparedStatement q2 = DatabaseConnection.getInstance().prepare("select * from `users` where `email`=? and `deleted`=0");
- q1.setString(1, buildup.getEmail());
- q2.setString(1, buildup.getEmail());
- ResultSet r1 = q1.executeQuery();
- ResultSet r2 = q2.executeQuery();
- if (r1.next() || r2.next()) {
- outputError(out, req, "This email address is currently valid in the system.");
- failed = true;
- }
- r1.close();
- r2.close();
- PreparedStatement q3 = DatabaseConnection.getInstance().prepare("select `domain` from `baddomains` where `domain`=RIGHT(?, LENGTH(`domain`))");
- q3.setString(1, buildup.getEmail());
-
- ResultSet r3 = q3.executeQuery();
- if (r3.next()) {
- String domain = r3.getString(1);
- out.print("<div>");
- out.print(String.format(Page.translate(req, "We don't allow signups from people using email addresses from %s"), domain));
- out.println("</div>");
- failed = true;
- }
- r3.close();
- } catch (SQLException e) {
- e.printStackTrace();
- failed = true;
- }
+ GigiPreparedStatement q1 = DatabaseConnection.getInstance().prepare("select * from `emails` where `email`=? and `deleted` IS NULL");
+ GigiPreparedStatement q2 = DatabaseConnection.getInstance().prepare("select * from certOwners inner join users on users.id=certOwners.id where `email`=? and `deleted` IS NULL");
+ q1.setString(1, buildup.getEmail());
+ q2.setString(1, buildup.getEmail());
+ GigiResultSet r1 = q1.executeQuery();
+ GigiResultSet r2 = q2.executeQuery();
+ if (r1.next() || r2.next()) {
+ outputError(out, req, "This email address is currently valid in the system.");
+ }
+ r1.close();
+ r2.close();
+ GigiPreparedStatement q3 = DatabaseConnection.getInstance().prepare("select `domain` from `baddomains` where `domain`=RIGHT(?, LENGTH(`domain`))");
+ q3.setString(1, buildup.getEmail());
+
+ GigiResultSet r3 = q3.executeQuery();
+ if (r3.next()) {
+ String domain = r3.getString(1);
+ outputError(out, req, "We don't allow signups from people using email addresses from %s", domain);
+ }
+ r3.close();