String fromname, String errorsto, boolean extra) throws IOException {
boolean sent = false;
while (!sent) {
- if (client == null || client.isClosed()) {
- client = servs.accept();
- out = new DataOutputStream(client.getOutputStream());
- in = new DataInputStream(client.getInputStream());
- }
+ assureLocalConnection();
try {
out.writeUTF("mail");
write(to);
}
}
}
+ private void assureLocalConnection() throws IOException {
+ if (client == null || client.isClosed()) {
+ client = servs.accept();
+ out = new DataOutputStream(client.getOutputStream());
+ in = new DataInputStream(client.getInputStream());
+ }
+ }
@Override
public String checkEmailServer(int forUid, String address)
throws IOException {
+ assureLocalConnection();
out.writeUTF("challengeAddrBox");
out.writeUTF(address);
return in.readUTF();
String un = req.getParameter("username");
String pw = req.getParameter("password");
try {
- PreparedStatement ps = DatabaseConnection.getInstance().prepare(
- "SELECT `password`, `id` FROM `users` WHERE `email`=?");
+ PreparedStatement ps = DatabaseConnection
+ .getInstance()
+ .prepare(
+ "SELECT `password`, `id` FROM `users` WHERE `email`=? AND locked='0' AND verified='1'");
ps.setString(1, un);
ResultSet rs = ps.executeQuery();
if (rs.next()) {