Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2998 → Rev 3000

/web/acc/manager/htdocs/user_by_email.php
52,9 → 52,9
$l_email_password = "Mot de passe";
$l_email_password_confirm = "Confirmez le mot de passe";
$l_mail_service = "Choisissez le service de messagerie";
$l_mail_server_ip = "Adresse IP du serveur SMTP";
$l_mail_smtp_ip = "Adresse IP ou nom du du serveur SMTP";
$l_admin_log = "Avertissement de l'administratateur";
$l_admin_mail = "Adresse Email de l'administrateur";
$l_admin_address = "Adresse Email de l'administrateur";
$l_whitelist_domain = "Noms de domaine autorisés (whitelist)";
$l_mail_YES = "OUI";
$l_mail_NO = "NON";
70,9 → 70,9
$l_email_password = "Password";
$l_email_password_confirm = "Confirm password";
$l_mail_service = "Choose the mail service";
$l_mail_server_ip = "IP address of mail server";
$l_mail_smtp_ip = "IP address or name of mail server";
$l_admin_log = "Administrator's warning";
$l_admin_mail = "Administrator Email address";
$l_admin_address = "Administrator Email address";
$l_whitelist_domain = "Authorized domain names (whitelist)";
$l_mail_YES = "YES";
$l_mail_NO = "NO";
82,11 → 82,10
// Mail configuration params
$mail_status = $mail_conf['MAIL'];
$mail_type = $mail_conf['MAIL_TYPE'];
$mail_address_mail = $mail_conf['MAIL_ADDR'];
$mail_address = $mail_conf['MAIL_ADDR'];
$mail_smtp = $mail_conf['MAIL_SMTP'];
$mail_port = $mail_conf['MAIL_PORT'];
$mail_address_ip = $mail_conf['MAIL_SMTP_IP'];
$mail_server = "";
$mail_smtp_ip = $mail_conf['MAIL_SMTP_IP'];
$mail_password_mail = "";
$mail_password_mail_2 = "";
$admin_address = $mail_conf['MAIL_ADMIN'];
98,7 → 97,6
$mail_type = $_POST['mail_type'];
$mail_address = $_POST['mail_address'];
$mail_server = $_POST['mail_server'];
$mail_ip = $_POST['mail_ip'];
$mail_mdp = $_POST['mail_mdp'];
$mail_mdp2 = $_POST['mail_mdp2'];
$admin_enable = $_POST['admin_enable'];
116,10 → 114,10
break;
case '2':
if(isset($mail_admin)){
exec("sudo /usr/local/bin/alcasar-mail-install.sh -2 -s $mail_smtp -p $mail_port -r $mail_ip -a $admin_address -w $mail_whitelist");
exec("sudo /usr/local/bin/alcasar-mail-install.sh -2 -s $mail_smtp_ip -p $mail_port -r $mail_ip -a $admin_address -w $mail_whitelist");
}
else {
exec("sudo /usr/local/bin/alcasar-mail-install.sh -2 -s $mail_smtp -p $mail_port -r $mail_ip -w $mail_whitelist");
exec("sudo /usr/local/bin/alcasar-mail-install.sh -2 -s $mail_smtp_ip -p $mail_port -r $mail_ip -w $mail_whitelist");
}
break;
case '3':
126,35 → 124,35
if ($mail_mdp == $mail_mdp2) {
switch ($mail_server) {
case '1':
$mail_smtp = "smtp.orange.fr";
$mail_smtp_ip = "smtp.orange.fr";
$mail_port = 465;
break;
case '2':
$mail_smtp = "smtp.live.com";
$mail_smtp_ip = "smtp.live.com";
$mail_port = 587;
break;
case '3':
$mail_smtp = "smtp.office365.com";
$mail_smtp_ip = "smtp.office365.com";
$mail_port = 587;
break;
case '4':
$mail_smtp = "smtp.sfr.fr";
$mail_smtp_ip = "smtp.sfr.fr";
$mail_port = 465;
break;
case '5':
$mail_smtp = "smtp.free.fr";
$mail_smtp_ip = "smtp.free.fr";
$mail_port = 465;
break;
case '6':
$mail_smtp = "smtp.gmail.com";
$mail_smtp_ip = "smtp.gmail.com";
$mail_port = 587;
break;
case '7':
$mail_smtp = "smtp.laposte.net";
$mail_smtp_ip = "smtp.laposte.net";
$mail_port = 465;
break;
case '8':
$mail_smtp = "smtp.bbox.fr";
$mail_smtp_ip = "smtp.bbox.fr";
$mail_port = 587;
break;
default:
162,10 → 160,10
break;
}
if(isset($mail_admin)){
exec("sudo /usr/local/bin/alcasar-mail-install.sh -3 -s $mail_smtp -p $mail_port -m $mail_address -o $mail_mdp -a $admin_address -w $mail_whitelist");
exec("sudo /usr/local/bin/alcasar-mail-install.sh -3 -s $mail_smtp_ip -p $mail_port -m $mail_address -o $mail_mdp -a $admin_address -w $mail_whitelist");
}
else {
exec("sudo /usr/local/bin/alcasar-mail-install.sh -3 -s $mail_smtp -p $mail_port -m $mail_address -o $mail_mdp -w $mail_whitelist");
exec("sudo /usr/local/bin/alcasar-mail-install.sh -3 -s $mail_smtp_ip -p $mail_port -m $mail_address -o $mail_mdp -w $mail_whitelist");
}
}
else { // password are not the same
195,7 → 193,7
<script>
function onMailStatusChange() {
var listToDisables1 = ['mail_type','admin_enable','admin_address','mail_whitelist'];
var listToDisables2 = ['mail_server','mail_type','admin_enable','admin_address','mail_whitelist','mail_ip'];
var listToDisables2 = ['mail_server','mail_type','admin_enable','admin_address','mail_whitelist','mail_smtp_ip'];
var listToDisables3 = ['mail_server','mail_mdp2','mail_mdp','mail_address','mail_type','admin_enable','admin_address','mail_whitelist'];
var formSubmit = document.querySelector('form input[type="submit"]');
var btn_checkConf = document.getElementById('btn-checkconf');
305,7 → 303,7
<label for="mail_address"><?= $l_email_address ?></label><br>
</dt>
<dd>
<input type="text" id="mail_address" size="40" name="mail_address" value="<?= $mail_address_mail ?>" oninput="onMailStatusChange();">
<input type="text" id="mail_address" size="40" name="mail_address" value="<?= $mail_address ?>" oninput="onMailStatusChange();">
</dd>
</dl>
<dl>
330,24 → 328,24
</dt>
<dd>
<select id="mail_server" name="mail_server" onchange="onMailStatusChange();">
<option value=1>Orange/Wanadoo</option>
<option value=2>Hotmail</option>
<option value=3>Outlook</option>
<option value=4>SFR</option>
<option value=5>Free</option>
<option value=6>Gmail</option>
<option value=7>Laposte</option>
<option value=8>Bouygues</option>
<option value=9>Personnalisé</option>
<option value="1"<?= ($mail_smtp_ip == 'smtp.orange.fr') ? ' selected="selected"' : '' ?>>Orange/Wanadoo</option>
<option value="2"<?= ($mail_smtp_ip == 'smtp.live.com') ? ' selected="selected"' : '' ?>>Hotmail</option>
<option value="3"<?= ($mail_smtp_ip == 'smtp.office365.com') ? ' selected="selected"' : '' ?>>Outlook</option>
<option value="4"<?= ($mail_smtp_ip == 'smtp.sfr.fr') ? ' selected="selected"' : '' ?>>SFR</option>
<option value="5"<?= ($mail_smtp_ip == 'smtp.free.fr') ? ' selected="selected"' : '' ?>>Free</option>
<option value="6"<?= ($mail_smtp_ip == 'smtp.gmail.com') ? ' selected="selected"' : '' ?>>Gmail</option>
<option value="7"<?= ($mail_smtp_ip == 'smtp.laposte.net') ? ' selected="selected"' : '' ?>>Laposte</option>
<option value="8"<?= ($mail_smtp_ip == 'smtp.bbox.fr') ? ' selected="selected"' : '' ?>>Bouygues</option>
<option value="9">Personnalisé</option>
</select>
</dd>
</dl>
<dl>
<dt>
<label for="mail_ip"><?= $l_mail_server_ip ?></label><br>
<label for="mail_smtp_ip"><?= $l_mail_smtp_ip ?></label><br>
</dt>
<dd>
<input type="text" id="mail_ip" size="40" name="mail_ip" value="<?= $mail_address_ip ?>" oninput="onMailStatusChange();">
<input type="text" id="mail_smtp_ip" size="40" name="mail_smtp_ip" value="<?= $mail_smtp_ip ?>" oninput="onMailStatusChange();">
</dd>
</dl>
<dl>
356,14 → 354,14
</dt>
<dd>
<select id="admin_enable" name="admin_enable" onchange="onMailStatusChange();">
<option value="1"<?= ($mail_address != '') ? ' selected="selected"' : '' ?>><?= $l_mail_YES ?></option>
<option value="0"<?= ($mail_address == '') ? ' selected="selected"' : '' ?>><?= $l_mail_NO ?></option>
<option value="1"<?= ($admin_address != '') ? ' selected="selected"' : '' ?>><?= $l_mail_YES ?></option>
<option value="0"<?= ($admin_address == '') ? ' selected="selected"' : '' ?>><?= $l_mail_NO ?></option>
</select>
</dd>
</dl>
<dl>
<dt>
<label for="admin_address"><?= $l_admin_mail ?></label><br>
<label for="admin_address"><?= $l_admin_address ?></label><br>
</dt>
<dd>
<input type="text" id="admin_address" size="40" name="admin_address" value="<?= $admin_address ?>" oninput="onMailStatusChange();">