-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathajax_smtp.php
79 lines (59 loc) · 2.09 KB
/
ajax_smtp.php
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
<?php
@error_reporting(0);
define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
require (JIRAFEAU_ROOT . 'lib/config.original.php');
require (JIRAFEAU_ROOT . 'lib/settings.php');
require (JIRAFEAU_ROOT . 'lib/functions.php');
require (JIRAFEAU_ROOT . 'lib/lang.php');
/*
* * PREVENT Abuse
* */
if (!isset($_POST) || count($_POST) == 0) {
die("No POST data found...");
}
if (!validateToken()) {
die("CSRF detected...");
}
if(isset($_POST['smtp_host']) && !empty($_POST['smtp_host'])){ // Zip download and Plain download
$smtp_host = htmlspecialchars(trim($_POST['smtp_host']));
$cfg['smtp_host'] = $smtp_host;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_host'];
}
if(isset($_POST['smtp_user']) && !empty($_POST['smtp_user'])){ // Zip download and Plain download
$smtp_user = htmlspecialchars(trim($_POST['smtp_user']));
$cfg['smtp_user'] = $smtp_user;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_user'];
}
if(isset($_POST['smtp_pass']) && !empty($_POST['smtp_pass'])){ // Zip download and Plain download
$smtp_pass = htmlspecialchars(trim($_POST['smtp_pass']));
$cfg['smtp_pass'] = $smtp_pass;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_tls'];
}
if(isset($_POST['smtp_port']) && !empty($_POST['smtp_port'])){ // Zip download and Plain download
$smtp_port = htmlspecialchars(trim($_POST['smtp_port']));
$cfg['smtp_port'] = $smtp_port;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_port'];
}
if(isset($_POST['smtp_auth']) && is_numeric($_POST['smtp_auth'])){ // Zip download and Plain download
$cfg['smtp_auth'] = true;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_auth'];
}else{
$cfg['smtp_auth'] = false;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_auth'];
}
if(isset($_POST['smtp_tls']) && is_numeric($_POST['smtp_tls'])){ // Zip download and Plain download
$cfg['smtp_tls'] = true;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_tls'];
}else{
$cfg['smtp_tls'] = false;
jirafeau_export_cfg_custom($cfg);
echo $cfg['smtp_tls'];
}
?>