-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretrieve.asp
201 lines (182 loc) · 6.67 KB
/
retrieve.asp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!-- #include file = "../common/asp.inc" -->
<!-- #include file = "../common/db.inc" -->
<!-- #include file = "../common/mail.inc" -->
<%
Dim action, valfolder, email, pass, code, title, activity, fsize
Dim eid, rs, p, dist, path, fp, i, subj, ps, msg, sql, distribution
mainmenu = "RETRIEVE"
submenu = ""
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Language" content="en-us">
<title>SyncIT Express: Retrieve Delivery</title>
<link rel="StyleSheet" href="../common/syncit.css" type="text/css">
</head>
<script language="JavaScript">
<!--
// Validate Form
//~~~~~~~~~~~~~~
function checkit(f) {
if (f.email.value.indexOf('.') == -1 || f.email.value.indexOf('@') == -1) {
alert ("Please enter a valid E-mail address");
f.email.focus();
return false;
}
return true;
}
//-->
</script>
<body bgcolor="#FFFFFF" text="#000000" link="#3300CC" vlink="#990000" alink="#CC0099">
<!-- #include file = "../common/header.inc" -->
<table width="630" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="117" valign="top">
<!-- #include file = "emenu.inc" -->
</td>
<td width="513" valign="top">
<table width="513" border="0" cellspacing="0" cellpadding="0">
<!-- #include file = "ehead.inc" -->
<tr>
<td width="12"> </td>
<td width="491" valign="top">
<br><h2>Retrieve Your File Here</h2>
<%
if request.querystring("err") = "1" then
action=6
else
valfolder = "../"
action = 0
email = request.form("email")
if email = "" then
code = request.querystring("code")
eid = ndecrypt (code)
on error resume next
set rs = conn.execute ("Select distribution,fsize,filename,password from express where expressid=" & eid)
if err then dberror err.description & " [" & err.number & "]"
on error goto 0
if rs.eof then
action = 1
else
action = 2
distribution = rs("distribution")
fsize = rs("fsize")
fp = rs("filename")
do
I = Instr(fp,"\")
if i = 0 then exit do
fp = right(fp,len(fp)-i)
loop
pass=rs("password")
end if
rs.close
else
code = request.form("code")
eid = ndecrypt(code)
email = lcase(trim(request.form("email")))
p = trim(request.form("pass"))
on error resume next
set rs = conn.execute( "Select distribution,password,filename,sender_id,title,activity from express where expressid=" & eid)
if err then dberror err.description & " [" & err.number & "]"
on error goto 0
dist = lcase(rs("distribution"))
if Instr(dist,email) =< 0 then
action = 3
else
pass = rs("password")
if pass <> "" and p <> pass then
action = 4
else
path = rs("filename")
fp = path
do
I = Instr(fp,"\")
if i = 0 then exit do
fp = right(fp,len(fp)-i)
loop
subj = "SyncIT File Delivery Receipt"
on error resume next
set ps = conn.execute ("Select name,email from person where personid = " & rs("sender_id"))
if err then dberror err.description & " [" & err.number & "]"
on error goto 0
msg = ps("name") & "," & vbCrLf
msg = msg & "Your Delivery was retrieved: " & vbCrLf
msg = msg & " File: " & fp & vbCrLf
msg = msg & " Time: " & Now() & vbCrLf
msg = msg & " Recipient: " & email & vbCrLf
msg = msg & "-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._." & vbCrLf
msg = msg & "Please keep in touch to let us know what you think of our service." & vbCrLf & vbCrLf
msg = msg & "Your BookmarkSync support team." & vbCrLf
msg = msg & "[email protected]"
domail "[email protected]",ps("email"),subj,msg
title = rs("title")
activity = rs("activity") & "<br>Downloaded at " & Now() & " from " & email
sql = "update express set activity = '" & activity & "' where expressid=" & eid
'response.write (sql)
connexecute (sql)
ps.close
action = 5
rs.close
Session("syncitexpresspath") = path
end if
end if
end if
end if
if email = "" then email = Session("email")
if email = "" then email = request.cookies("email")
If action = 1 Then
If code <> "" Then
response.write "<h4><font color=""#FF0000"">No delivery available.</font></h4>" & vbCrLf
response.write "<p>The delivery might have been expired or the tracking number might be invalid.<br>" & vbCrLf
response.write "Please contact the original sender."
End If
ElseIf action = 2 Then
response.write "<h4>Please fill out the form to retrieve your delivery.</h4>" & vbCrLf
ElseIf action = 3 Then
response.write "<h4><b><font color=""#FF0000"">Your e-mail address does not match</font></b></h4>" & vbCrLf
ElseIf action = 4 Then
response.write "<h4><b><font color=""#FF0000"">Your password does not match</font></b></h4>" & vbCrLf
ElseIf action = 5 Then
response.write "<h3><b>Thank you for using SyncIT Express.</b></h3>" & vbCrLf
response.write "<p><b>Retrieve your document here: <a href=""download.asp"">"
response.write title
response.write "</a></p>" & vbCrLf
ElseIf action = 6 Then
response.write "<h4><b><font color=""#FF0000"">The delivery does not exist anymore</font></b></h4>" & vbCrLf
End If
if action < 5 then %>
<form method="post" action="retrieve.asp" name="frmupload" onsubmit="return checkit(this)">
<table border="0">
<tr>
<td class="menub" align="right">Tracking #</td>
<td class="register"><input type="text" name="code" size="30" class="register" value="<%= code %>"></td>
</tr>
<tr>
<td class="menub" align="right">Your E-mail</td>
<td class="register"><input type="text" name="email" size="30" class="register" value="<%= email %>"></td>
</tr>
<% if pass <> "" or action=1 then %>
<tr>
<td class="menub" align="right">Password</td>
<td class="register"><b><input type="password" name="pass" size="20" class="register"></b></td>
</tr>
<% end if %>
<tr>
<td> </td>
<td><input border="0" src="../images/btnok.gif" name="I1" type="image" width="62" height="16" alt="OK"></td>
</tr>
</table>
</form>
<% end if %>
</td>
<td width="10" valign="top"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- #include file = "../common/footer.inc" -->
</body>
</html>