-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch_secq.jsp
46 lines (34 loc) · 1005 Bytes
/
fetch_secq.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%@ page language="java" contentType="text/plain; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.io.*,java.math.*" %>
<%@ include file="init_db.jsp" %>
<%@ include file="init_generics.jsp" %>
<%
String output = "";
if(request.isSecure()) {
String mail = request.getParameter("mail");
if (mail == null || mail.equals("")) {
dataFault = true;
} else if (!mail.matches("^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$")) {
dataFault = true;
}
if (!dataFault) {
sql = "SELECT `sec_q` FROM `sopraplaner_users` WHERE `email` = '"+mail+"'";
dbs = dbcon.createStatement();
try {
dbrs = dbs.executeQuery(sql);
dbrs.next();
out.print(dbrs.getString("sec_q"));
dbrs.close();
} catch (SQLException e) {
dataFault = true;
}
}
if (dataFault) {
output = "Zunächst gültige E-Mail angeben";
}
} else {
output="ERROR! Insecure Connection!";
}
out.print(output);
%>