-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_interfaces.php
More file actions
executable file
·401 lines (361 loc) · 12.3 KB
/
Copy pathconfig_interfaces.php
File metadata and controls
executable file
·401 lines (361 loc) · 12.3 KB
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<?php
// ==============================================================
// Copyright (C) 2014 Mark Vejvoda
// Under GNU GPL v3.0
// ==============================================================
// ----------------------------------------------------------------------
class EmailAccount
{
// Indicates whether the email host should be checked for email triggers
public $EMAIL_HOST_ENABLED;
// The From email address that is allowed to trigger a callout.
// Two formats are allowed:
// 1. Full email address
// donotreply@mysite.ca
// 2. Domain name (all emails from domain)
// focc.mycity.ca
public $EMAIL_FROM_TRIGGER;
// Email provider connection string to check for email triggers
public $EMAIL_HOST_CONNECTION_STRING;
// Email address that will receive callout information
public $EMAIL_HOST_USERNAME;
// Email address password that will receive callout information
public $EMAIL_HOST_PASSWORD;
// Email should be deleted after it is received and processed.
public $EMAIL_DELETE_PROCESSED;
// Only examine unread emails
public $PROCESS_UNREAD_ONLY;
// Outbound Email Settings
public $ENABLE_OUTBOUND_SMTP ;
public $ENABLE_OUTBOUND_SENDMAIL;
public $OUTBOUND_HOST;
public $OUTBOUND_PORT;
public $OUTBOUND_ENCRYPT;
public $OUTBOUND_AUTH;
public $OUTBOUND_USERNAME;
public $OUTBOUND_PASSWORD;
public $OUTBOUND_FROM_ADDRESS;
public $OUTBOUND_FROM_NAME;
public function __construct($host_enabled=false, $from_trigger=null,
$host_conn_str=null, $host_username=null, $host_password=null,
$host_delete_processed=true,$unread_only=true) {
$this->EMAIL_HOST_ENABLED = $host_enabled;
$this->EMAIL_FROM_TRIGGER = $from_trigger;
$this->EMAIL_HOST_CONNECTION_STRING = $host_conn_str;
$this->EMAIL_HOST_USERNAME = $host_username;
$this->EMAIL_HOST_PASSWORD = $host_password;
$this->EMAIL_DELETE_PROCESSED = $host_delete_processed;
$this->PROCESS_UNREAD_ONLY = $unread_only;
}
public function __toString() {
return $this->toString();
}
public function toString() {
$result = "Email Settings:" .
"\nhost enabled: " . var_export($this->EMAIL_HOST_ENABLED, true) .
"\nfrom trigger: " . $this->EMAIL_FROM_TRIGGER .
"\nconnection string: " . $this->EMAIL_HOST_CONNECTION_STRING .
"\nusername: " . $this->EMAIL_HOST_USERNAME .
"\ndelete processed emails: " . var_export($this->EMAIL_DELETE_PROCESSED, true) .
"\nonly examine unread emails: " . var_export($this->PROCESS_UNREAD_ONLY, true) .
"\nenable outbound mail SMTP: " . var_export($this->ENABLE_OUTBOUND_SMTP, true) .
"\nenable outbound mail SENDMAIL: " . var_export($this->ENABLE_OUTBOUND_SENDMAIL, true) .
"\noutbound mail host: " . $this->OUTBOUND_HOST .
"\noutbound mail port: " . $this->OUTBOUND_PORT .
"\noutbound mail encrypt: " . $this->OUTBOUND_ENCRYPT .
"\noutbound mail auth: " . var_export($this->OUTBOUND_AUTH,true) .
"\noutbound mail user: " . $this->OUTBOUND_USERNAME .
"\noutbound mail password: " . $this->OUTBOUND_PASSWORD .
"\noutbound mail from address: " . $this->OUTBOUND_FROM_ADDRESS .
"\noutbound mail from name: " . $this->OUTBOUND_FROM_NAME;
return $result;
}
public function setHostEnabled($host_enabled) {
$this->EMAIL_HOST_ENABLED = $host_enabled;
}
public function setFromTrigger($from_trigger) {
$this->EMAIL_FROM_TRIGGER = $from_trigger;
}
public function setConnectionString($host_conn_str) {
$this->EMAIL_HOST_CONNECTION_STRING = $host_conn_str;
}
public function setUserName($host_username) {
$this->EMAIL_HOST_USERNAME = $host_username;
}
public function setPassword($host_password) {
$this->EMAIL_HOST_PASSWORD = $host_password;
}
public function setDeleteOnProcessed($host_delete_processed) {
$this->EMAIL_DELETE_PROCESSED = $host_delete_processed;
}
public function setProcessUnreadOnly($unread_only) {
$this->PROCESS_UNREAD_ONLY = $unread_only;
}
public function setEnableOutboundSMTP($value) {
$this->ENABLE_OUTBOUND_SMTP= $value;
}
public function setEnableOutboundSendmail($value) {
$this->ENABLE_OUTBOUND_SENDMAIL= $value;
}
public function setOutboundHost($value) {
$this->OUTBOUND_HOST= $value;
}
public function setOutboundPort($value) {
$this->OUTBOUND_PORT= $value;
}
public function setOutboundEncrypt($value) {
$this->OUTBOUND_ENCRYPT= $value;
}
public function setOutboundAuth($value) {
$this->OUTBOUND_AUTH= $value;
}
public function setOutboundUsername($value) {
$this->OUTBOUND_USERNAME= $value;
}
public function setOutboundPassword($value) {
$this->OUTBOUND_PASSWORD= $value;
}
public function setOutboundFromAddress($value) {
$this->OUTBOUND_FROM_ADDRESS= $value;
}
public function setOutboundFromName($value) {
$this->OUTBOUND_FROM_NAME= $value;
}
}
// ----------------------------------------------------------------------
class Website
{
// The display name
public $NAME;
// The timezone where the site is located
public $TIMEZONE;
// The Base URL where you installed rip runner example: http://mywebsite.com/riprunner/
public $WEBSITE_ROOT_URL;
// Maximum number of invalid login attempts before user is locked out
public $MAX_INVALID_LOGIN_ATTEMPTS;
public function __construct($name=null, $root_url=null, $tz=null,$max_logins=3) {
$this->NAME = $name;
$this->WEBSITE_ROOT_URL = $root_url;
$this->TIMEZONE = $tz;
$this->MAX_INVALID_LOGIN_ATTEMPTS = $max_logins;
}
public function __toString() {
return $this->toString();
}
public function toString() {
$result = "Website Settings:" .
"\nSite name: " . $this->NAME .
"\nSite timezone: " . $this->TIMEZONE .
"\nBase URL: " . $this->WEBSITE_ROOT_URL .
"\nMaximum login attempts: " . $this->MAX_INVALID_LOGIN_ATTEMPTS;
;
return $result;
}
public function setName($name) {
$this->NAME = $name;
}
public function setTimezone($tz) {
$this->TIMEZONE = $tz;
}
public function setRootURL($root_url) {
$this->WEBSITE_ROOT_URL = $root_url;
}
public function setMaxLoginAttempts($max_logins) {
$this->MAX_INVALID_LOGIN_ATTEMPTS = $max_logins;
}
}
// ----------------------------------------------------------------------
class PDFSettings
{
// Indicates whether PDF should be used
public $ENABLED;
// Indicates the path for output files
public $OUTPUTPATH;
// The PDF membership input file
public $MEMBERSHIP_FILE;
// The PDF waiver input file
public $WAIVER_FILE;
// The name of the members email field on the webform
public $WEBFORM_EMAILFIELD;
// The path on the server to PDFTK
public $PDFTK_PATH;
// The setting (true/false) to enable emailing the pdf to the member
public $EMAILPDF_TO_MEMBER;
// The list of directors to email the filled out forms
public $EMAILPDF_TO_DIRECTORS;
// The date range that the forms are active
public $FORMS_DATE_RANGE;
// The membership email template view
public $MEMBERSHIP_FILE_EMAIL_VIEW_TEMPLATE;
// The waiver email template view
public $WAIVER_FILE_EMAIL_VIEW_TEMPLATE;
public function __construct($enabled=false, $outputpath=null, $membership_file=null, $waiver_file=null,
$webform_emailfield=null, $pdftk_path=null, $emailpdf_to_member=null, $emailpdf_to_directors=null,
$forms_date_range=null, $membership_file_email_view_template=null, $waiver_file_email_view_template=null) {
$this->ENABLED = $enabled;
$this->OUTPUTPATH = $outputpath;
$this->MEMBERSHIP_FILE = $membership_file;
$this->WAIVER_FILE = $waiver_file;
$this->WEBFORM_EMAILFIELD = $webform_emailfield;
$this->PDFTK_PATH = $pdftk_path;
$this->EMAILPDF_TO_MEMBER = $emailpdf_to_member;
$this->EMAILPDF_TO_DIRECTORS = $emailpdf_to_directors;
$this->FORMS_DATE_RANGE = $forms_date_range;
$this->MEMBERSHIP_FILE_EMAIL_VIEW_TEMPLATE = $membership_file_email_view_template;
$this->WAIVER_FILE_EMAIL_VIEW_TEMPLATE = $waiver_file_email_view_template;
}
public function __toString() {
return $this->toString();
}
public function toString() {
$result = "PDF Settings:" .
"\nenabled: " . var_export($this->ENABLED, true) .
"\noutput path: " . $this->OUTPUTPATH .
"\nmembership file: " . $this->MEMBERSHIP_FILE .
"\nwaiver file: " . $this->WAIVER_FILE .
"\nwebform email field: " . $this->WEBFORM_EMAILFIELD .
"\nPDFTK path: " . $this->PDFTK_PATH .
"\nemail pdf to member: " . var_export($this->EMAILPDF_TO_MEMBER, true) .
"\nemail pdf to directors: " . $this->EMAILPDF_TO_DIRECTORS .
"\npdf forms active date range: " . $this->FORMS_DATE_RANGE.
"\nmembership file email view template: " . $this->MEMBERSHIP_FILE_EMAIL_VIEW_TEMPLATE .
"\nwaiver file email view template: " . $this->WAIVER_FILE_EMAIL_VIEW_TEMPLATE;
return $result;
}
public function setEnabled($enabled) {
$this->ENABLED = $enabled;
}
public function setOutputPath($value) {
$this->OUTPUTPATH = $value;
}
public function setMembershipfile($value) {
$this->MEMBERSHIP_FILE = $value;
}
public function setWaiverfile($value) {
$this->WAIVER_FILE = $value;
}
public function setWebformEmailField($value) {
$this->WEBFORM_EMAILFIELD = $value;
}
public function setPDFTKPath($value) {
$this->PDFTK_PATH = $value;
}
public function setEmailPDFToMember($value) {
$this->EMAILPDF_TO_MEMBER = $value;
}
public function setEmailPDFToDirectors($value) {
$this->EMAILPDF_TO_DIRECTORS = $value;
}
public function setFormsDateRange($value) {
$this->FORMS_DATE_RANGE = $value;
}
public function setMembershipfileEmailViewTemplate($value) {
$this->MEMBERSHIP_FILE_EMAIL_VIEW_TEMPLATE = $value;
}
public function setWaiverfileEmailViewTemplate($value) {
$this->WAIVER_FILE_EMAIL_VIEW_TEMPLATE = $value;
}
}
// ----------------------------------------------------------------------
class TwoFactor
{
// Indicates whether PDF should be used
public $ENABLED;
// Indicates the TOPT secret key
public $TOTP_KEY;
// The TOTP timeout
public $TOTP_TIMEOUT_SECONDS;
public function __construct($enabled=false, $totpkey=null, $totptimeout=null) {
$this->ENABLED = $enabled;
$this->TOTP_KEY = $totpkey;
$this->TOTP_TIMEOUT_SECONDS = $totptimeout;
}
public function __toString() {
return $this->toString();
}
public function toString() {
$result = "TwoFactor:" .
"\nenabled: " . var_export($this->ENABLED, true) .
"\ntotp key: " . $this->TOTP_KEY .
"\ntotp timeout seconds: " . $this->TOTP_TIMEOUT_SECONDS;
return $result;
}
public function setEnabled($enabled) {
$this->ENABLED = $enabled;
}
public function setTotpKey($value) {
$this->TOTP_KEY = $value;
}
public function setTotpTimeoutSeconds($value) {
$this->TOTP_TIMEOUT_SECONDS = $value;
}
}
// ----------------------------------------------------------------------
class SiteConfig
{
// Indicates whether the site is enabled or not
public $ENABLED;
// A unique ID to differentiate multiple sites
public $ID;
// The Email configuration
public $EMAIL;
// The Website configuration
public $WEBSITE;
// The PDF configuration
public $PDFSettings;
// The two factor settings
public $TWOFACTOR;
public function __construct($enabled=false, $id=null, $db=null,
$email=null, $website=null, $pdfcfg=null, $twofa=null) {
$this->ENABLED = $enabled;
$this->ID = $id;
$this->EMAIL = $email;
$this->WEBSITE = $website;
$this->PDFSettings = $pdfcfg;
$this->TWOFACTOR = $twofa;
}
public function __toString() {
return $this->toString();
}
public function toString() {
$result = "Site Settings:" .
"\nenabled: " . var_export($this->ENABLED, true) .
"\nSite ID: " . $this->ID .
"\n" . $this->EMAIL->toString() .
"\n" . $this->WEBSITE->toString() .
"\n" . $this->PDFSettings->toString() .
"\n" . $this->TWOFACTOR->toString();
return $result;
}
public function __get($name) {
if (property_exists($this, $name) === true) {
return $this->$name;
}
}
public function __isset($name) {
return isset($this->$name);
}
public function __set($name, $value) {
if (property_exists($this, $name) === true) {
$this->$name = $value;
}
}
public function setEnabled($enabled) {
$this->ENABLED = $enabled;
}
public function setId($id) {
$this->ID = $id;
}
public function setEmailSettings($email) {
$this->EMAIL = $email;
}
public function setWebsiteSettings($website) {
$this->WEBSITE = $website;
}
public function setPDF_Settings($cfg) {
$this->PDFSettings = $cfg;
}
public function setTwoFactor($cfg) {
$this->TWOFACTOR = $cfg;
}
}