-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.cfm
234 lines (218 loc) · 7.21 KB
/
install.cfm
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!---
Creating Co. : Hostek.com
Programmed by: Kaleb L.
Creation Date: 11/15/2014
--->
<link href='http://fonts.googleapis.com/css?family=Lobster|Titillium+Web:400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<style type="text/css">
.logo {
font-size: 60px;
padding: 0px;
margin: 0px 0px 10px 0px;
font-style: oblique;
color: #FF890A;
text-shadow: 2px 2px #5c5c5c;
font-family: 'Lobster', cursive;
}
.installFrame {
margin: 5% auto auto auto;
z-index: 1;
width: 70%;
min-width: 275px;
padding: 10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: outset;
box-shadow: 10px 10px 5px #555;
box-sizing: initial;
font-family: Titillium Web;
font-weight: 700;
}
.data {
width: 40%;
font-family: Titillium Web;
}
td {
padding: 10px;
}
.center {
text-align: center;
}
</style>
<div class="well well-sm installFrame">
<h1 class="logo center">SatyrMailer</h1>
<form action="" method="post" >
<table>
<tr>
<td class="data" rowspan="2">
This will be the unique username used to login to the mailer control panel. <em><strong>*NOTE: I would suggest using something BESIDES <code>admin</code></strong></em>.
</td>
<td>
<h3>Username</h3>
</td>
</tr>
<td>
<input type="text" name="FirstUser" class="form-control" />
</td>
<tr>
</tr>
<tr>
<td class="data" rowspan="2">
Please use a secure password. Strong passwords consist of <em><strong>a lowercase letter</strong></em>, <em><strong>an uppercase character</strong></em>, <em><strong>a number</strong></em>, and <strong><em>a special character</strong></em>.
</td>
<td>
<h3>Password<h3>
</td>
</tr>
<tr>
<td>
<input type="password" name="FirstPass" class="form-control" />
</td>
</tr>
<tr>
<td class="data" rowspan="2">
Please re-type your password to ensure that there are no misspellings or missing characters.
</td>
<td>
<h3>Re-type Password<h3>
</td>
</tr>
<tr>
<td>
<input type="password" name="FirstPassCheck" class="form-control" />
</td>
</tr>
<tr>
<td class="data" rowspan="2">
Add your the DNS for the database you wish for SatyrMail to use. <em><strong>*Note: This could erase any data that is currently in that database</strong></em>.
</td>
<td>
<h3>DSN<h3>
</td>
</tr>
<tr>
<td>
<input type="text" name="FirstDSN" class="form-control" />
</td>
</tr>
<tr>
<td colspan="2" class="center">
<input type="submit" name="install" value="Install" class="btn btn-primary">
</td>
</tr>
</table>
</form>
<p class="center">
<cfif StructKeyExists(Form, "FirstUser")>
<cfif len(Form.FirstUser)>
<cfif len(Form.FirstPass)>
<cfif trim(Form.FirstPass) EQ trim(Form.FirstPassCheck)>
<cfif len(Form.FirstDSN)>
<cfset rnd="">
<cfset i=0>
<!--- Create string --->
<cfloop index="i" from="1" to="25">
<!--- Random character in range A-Z --->
<cfset rnd=rnd&Chr(RandRange(65, 90))>
</cfloop>
<!--- Data for the config.cfm file --->
<cfsavecontent variable="configCode">
<%!---
Creating Co. : SatyrCast Softwares
Programmed by: Kaleb L.
Creation Date: 11/15/2014
---%>
<%!--- Set the DSN of the mailer ---%>
<%cfset Application.DSN = "<cfoutput>#Form.FirstDSN#</cfoutput>"%>
<%!--- Security key of all requests ---%>
<%cfset SecurityKey = "<cfoutput>#rnd#</cfoutput>"%>
<%cfset Application.key = #Hash(SecurityKey , "SHA-512")#%>
</cfsavecontent>
<cfset configCode = reReplace(configCode, "<%", "<", "all" ) >
<cfset configCode = reReplace(configCode, "%>", ">", "all" ) >
<cffile action="write" file="./config.cfm" output="#configCode#" >
<cfquery datasource="#Form.FirstDSN#">
CREATE TABLE IF NOT EXISTS `mailersettings` (
`SMTPHost` varchar(125) NOT NULL,
`SMTPPort` int(10) NOT NULL,
`SMTPAddress` varchar(125) NOT NULL,
`SMTPPassword` varchar(125) NOT NULL
)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
INSERT INTO `mailersettings` (`SMTPHost`, `SMTPPort`, `SMTPAddress`, `SMTPPassword`) VALUES (' ', 25, ' ', ' ');
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
CREATE TABLE IF NOT EXISTS `mailerstats` (
`SentMessages` int(11) NOT NULL,
`TemplateNumber` int(11) NOT NULL,
`ContactNumber` int(11) NOT NULL
)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
INSERT INTO `mailerstats` (`SentMessages`, `TemplateNumber`, `ContactNumber`) VALUES (0, 0, 0)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
CREATE TABLE IF NOT EXISTS `mailersubscribers` (
`ID` int(11) NOT NULL,
`Email` varchar(125) NOT NULL
) AUTO_INCREMENT=4
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
ALTER TABLE `mailersubscribers`
ADD PRIMARY KEY (`ID`)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
ALTER TABLE `mailersubscribers`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
CREATE TABLE IF NOT EXISTS `mailertemplates` (
`ID` int(11) NOT NULL,
`Subject` varchar(250) NOT NULL,
`Body` mediumtext NOT NULL,
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) AUTO_INCREMENT=8
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
ALTER TABLE `mailertemplates`
ADD PRIMARY KEY (`ID`)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
ALTER TABLE `mailertemplates`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
CREATE TABLE IF NOT EXISTS `mailerusers` (
`user` varchar(100) NOT NULL,
`pass` varchar(200) NOT NULL,
`perms` int(11) NOT NULL
)
</cfquery>
<cfquery datasource="#Form.FirstDSN#">
INSERT INTO `mailerusers` (`user`, `pass`, `perms`) VALUES ('<cfoutput>#Form.FirstUser#</cfoutput>', '<cfoutput >#Hash(Form.FirstPass, "SHA-512" )#</cfoutput>', 1);
</cfquery>
<cfoutput>
<cfset SecurityKey = "#rnd#">
<cfset Application.key = #Hash(SecurityKey , "SHA-512")#>
<cfset Application.DSN = "#Form.FirstDSN#">
</cfoutput>
<cffile action="delete" file="./install.cfm" >
<cflocation url="./access.cfm" >
<cfelse>
<div class="alert alert-danger center" role="alert">You have not defined a <em>DSN</em>. Please do so.</div>
</cfif>
<cfelse>
<div class="alert alert-danger center" role="alert">The re-typed password did not match the first password.</div>
</cfif>
<cfelse>
<div class="alert alert-danger center" role="alert">You have not defined a <em>Password</em>. Please do so.</div>
</cfif>
<cfelse>
<div class="alert alert-danger center" role="alert">You have not defined a <em>Username</em>. Please do so.</div>
</cfif>
</cfif>
</p>
</div>