Newer
Older
<?php
/*
* Copyright 2008-2012 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief class of install tools
*
* @file
* @author Arnaud Veber
* @date $date$
* @version $Revision$
* @ingroup install
*/
?>
<script>
function envoiMailTestSmtp(url, type, smtpHost, smtpType, smtpPort, smtpUser, smtpPassword, smtpAuth, smtpMailTo, smtpDomains, smtpMailFrom) {
$(document).ready(function() {
var oneIsEmpty = false;
if (smtpHost.length < 1) {
var oneIsEmpty = true;
}
if (smtpType.length < 1) {
var oneIsEmpty = true;
}
if (smtpPort.length < 1) {
var oneIsEmpty = true;
}
if (smtpAuth.length < 1) {
var oneIsEmpty = true;
}
if (smtpMailTo.length < 1) {
var oneIsEmpty = true;
}
if (smtpMailFrom.length < 1) {
var oneIsEmpty = true;
}
if (oneIsEmpty) {
$('#ajaxReturn_testConnect_ko').html('<?php echo _ONE_FIELD_EMPTY;?>');
return;
$('#ajaxReturn_testConnect_ko').html('');
ajaxDB(
'testSmtp',
'type|' + type +
'|smtpHost|' + smtpHost +
'|smtpType|' + smtpType +
'|smtpPort|' + smtpPort +
'|smtpUser|' + smtpUser +
'|smtpPassword|' + smtpPassword +
'|smtpAuth|' + smtpAuth +
'|smtpMailTo|' + smtpMailTo +
'|smtpDomains|' + smtpDomains +
'|smtpMailFrom|' + smtpMailFrom,
'ajaxReturn_testConnect',
'false'
);

Henri Queneau
committed
$('#ajaxReturn_testConnect_ok').html('<?php echo "connexion ok";?>');

Henri Queneau
committed
return;
});
}
</script>
<div class="blockWrapper">
<div class="titleBlock">
<h2 onClick="slide('configNotificationSendmail');" style="cursor: pointer;">
</h2>
</div>
<div class="contentBlock" id="docservers">
<p>
<h6>
</h6>
<form>
<table>
<tr>
<td>
</td>
<td>
:
</td>
<td>
<input type="text" name="smtpHost" id="smtpHost" value="ssl://smtp.yourdomain.com" />
</td>
<td>
<FONT COLOR="#7F8FA6"><i>exemple: ssl://smtp.gmail.com; smtp2.example.com</i></FONT>
</td>
</tr>
<tr>
<td>:</td>
<SELECT name="smtpType" id="smtpType">
<OPTION selected>smtp
<OPTION>sendmail
<OPTION>mail
</SELECT>
</td>
<td>
<FONT COLOR="#7F8FA6"><i><?php echo _SENDER_TYPE ?></i></FONT>
</td>
</tr>
<tr>
<td>:</td>
<td><input type="text" name="smtpPort" id="smtpPort" value="465" /></td>
</tr>
<tr>
<td>:</td>
<td><input type="text" name="smtpUser" id="smtpUser" value="server@yourdomain.com" /></td>
<td>
<FONT COLOR="#7F8FA6"><i><?php echo _SMTP_USER_CONNECT;?></i></FONT>
</td>
</tr>
<tr>
<td>:</td>
<td><input type="password" name="smtpPassword" id="smtpPassword" value="password" /></td>
</tr>
<tr>
<td>:</td>
<td>
<SELECT name="smtpAuth" id="smtpAuth">
<OPTION selected>true
<OPTION>false
</SELECT>
</td>
</tr>
<td>:</td>
<td><input type="text" name="smtpDomains" id="smtpDomains" value="gmail" /></td>
<td>:</td>
<td><input type="text" name="smtpMailFrom" id="smtpMailFrom" value="notifications@maarch.fr" /></td>
<tr>
<td>:</td>
<td><input type="text" name="smtpMailTo" id="smtpMailTo" value="example@domain.com" /></td>
<td>
<FONT COLOR="#7F8FA6"><i><?php echo _SMTP_MAILTO_BOX;?></i></FONT>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<input type="button" id="ajaxReturn_testConnect_button" onClick="$('.wait').css('display','block');envoiMailTestSmtp( 'testSmtp','test', $('#smtpHost').val(), $('#smtpType').val(), $('#smtpPort').val(), $('#smtpUser').val(), $('#smtpPassword').val(), $('#smtpAuth').val(), $('#smtpMailTo').val(), $('#smtpDomains').val(), $('#smtpMailFrom').val());" value="<?php echo _VERIF_SMTP;?>" />
</td>
</tr>
</table>
</form>
<br />
<div id="ajaxReturn_testConnect_ko"></div>
<img src="img/wait.gif" width="100" class="wait" style="display: none; background-color: rgba(0, 0, 0, 0.2);" />

Henri Queneau
committed
<div id="ajaxReturn_testConnect_ok"></div>
</p>
</div>
</div>
<br />
<div class="blockWrapper">
<div class="contentBlock" id="docservers">
<p>
<div id="buttons">
<div style="float: right;" class="nextButton" id="next">
<a href="#" onClick="envoiMailTestSmtp( 'testSmtp','add', $('#smtpHost').val(), $('#smtpType').val(), $('#smtpPort').val(), $('#smtpUser').val(), $('#smtpPassword').val(), $('#smtpAuth').val(), $('#smtpMailTo').val(), $('#smtpDomains').val(), $('#smtpMailFrom').val());goTo('index.php?step=password');">
<?php echo _NEXT_INSTALL;?>
</a>
</div>
</div>
<br />
<br />
</p>
</div>