-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsmtp.php
executable file
·159 lines (154 loc) · 7.38 KB
/
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
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
<?php
require_once("pre.php");
require_once("auth.php");
require_once("../fonctions/divers.php");
if (!est_autorise("acces_configuration"))
exit;
$request = Symfony\Component\HttpFoundation\Request::createFromGlobals();
$smtp = new SMTPAdmin();
try
{
if($request->request->get("action") == 'edit')
$smtp->edit($request);
} catch(TheliaAdminException $e) {
$errorCode = $e->getCode();
switch ($errorCode)
{
case TheliaAdminException::SMTP_EDIT_ERROR:
$editError = 1;
$errorData = $e->getData();
break;
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php require_once("title.php"); ?>
</head>
<body>
<?php
ActionsAdminModules::instance()->inclure_module_admin("smtp_top");
$menu = "configuration";
$breadcrumbs = Breadcrumb::getInstance()->getConfigurationList(trad('Gestion_mail', 'admin'));
require_once("entete.php");
?>
<div class="row-fluid">
<div class="span12">
<h3><?php echo trad('LISTE_VARIABLES', 'admin'); ?></h3>
<?php
ActionsAdminModules::instance()->inclure_module_admin("smtp");
?>
<form method="POST" action="smtp.php">
<input type="hidden" name="action" value="edit" />
<p>
<button class="btn btn-large btn-block btn-primary" type="submit"><?php echo trad('VALIDER_LES_MODIFICATIONS', 'admin'); ?></button>
</p>
<table class="table table-striped">
<thead>
<tr>
<th class="span3"><?php echo trad('Nom2', 'admin'); ?></th>
<th class="span7"><?php echo trad('Valeur', 'admin'); ?></th>
<th class="span2"></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo trad('Serveur', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="text" name="serveur" valeur-original="<?php echo htmlentities($smtp->serveur, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="1" id="js_edit_1" value="<?php echo htmlentities($smtp->serveur, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="1" id="js_cancel_edit_1"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
<tr>
<td><?php echo trad('Port', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="text" name="port" valeur-original="<?php echo htmlentities($smtp->port, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="2" id="js_edit_2" value="<?php echo htmlentities($smtp->port, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="2" id="js_cancel_edit_2"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
<tr>
<td><?php echo trad('Nom_utilisateur', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="text" name="username" valeur-original="<?php echo htmlentities($smtp->username, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="3" id="js_edit_3" value="<?php echo htmlentities($smtp->username, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="3" id="js_cancel_edit_3"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
<tr>
<td><?php echo trad('Mdp', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="password" name="password" valeur-original="<?php echo htmlentities($smtp->password, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="4" id="js_edit_4" value="<?php echo htmlentities($smtp->password, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="4" id="js_cancel_edit_4"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
<tr>
<td><?php echo trad('Protocole_securise', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="text" name="secure" valeur-original="<?php echo htmlentities($smtp->secure, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="5" id="js_edit_5" value="<?php echo htmlentities($smtp->secure, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="5" id="js_cancel_edit_5"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
<tr>
<td><?php echo trad('Actif', 'admin'); ?></td>
<td>
<input class="span12 js-edit" type="text" name="active" valeur-original="<?php echo htmlentities($smtp->active, ENT_QUOTES, 'UTF-8'); ?>" ligne-id="6" id="js_edit_6" value="<?php echo htmlentities($smtp->active, ENT_QUOTES, 'UTF-8'); ?>" />
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini js-cancel-edit" title="<?php echo trad('undo_changes', 'admin'); ?>" ligne-id="6" id="js_cancel_edit_6"><i class="icon-remove"></i></a>
</div>
</td>
</tr>
</tbody>
</table>
<p>
<button class="btn btn-large btn-block btn-primary" type="submit"><?php echo trad('VALIDER_LES_MODIFICATIONS', 'admin'); ?></button>
</p>
</form>
</div>
</div>
<?php
ActionsAdminModules::instance()->inclure_module_admin("smtp_bottom");
?>
<?php require_once("pied.php"); ?>
<script type="text/javascript">
jQuery(function($)
{
/*cancel edit*/
$('.js-cancel-edit')
.addClass('disabled')
.click(function()
{
if(!$(this).is('.disabled'))
{
$(this).addClass('disabled')
$('#js_edit_' + $(this).attr('ligne-id')).val($('#js_edit_' + $(this).attr('ligne-id')).attr('valeur-original'));
}
});
$('.js-edit').keyup(function(){
$('#js_cancel_edit_' + $(this).attr('ligne-id')).removeClass('disabled');
});
});
</script>
</body>
</html>