parent
331bd527a7
commit
9847912257
4 changed files with 37 additions and 16 deletions
|
@ -468,8 +468,8 @@ OC.addStyle.loaded=[];
|
|||
OC.addScript.loaded=[];
|
||||
|
||||
OC.msg={
|
||||
startSaving:function(selector, message){
|
||||
OC.msg.startAction(selector, t('settings', 'Saving...'));
|
||||
startSaving:function(selector){
|
||||
OC.msg.startAction(selector, t('core', 'Saving...'));
|
||||
},
|
||||
finishedSaving:function(selector, data){
|
||||
OC.msg.finishedAction(selector, data);
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
namespace OC\Settings\Admin;
|
||||
|
||||
class Controller {
|
||||
public static function setMailSettings($args) {
|
||||
/**
|
||||
* Set mail settings
|
||||
*/
|
||||
public static function setMailSettings() {
|
||||
\OC_Util::checkAdminUser();
|
||||
\OCP\JSON::callCheck();
|
||||
|
||||
|
@ -70,14 +73,21 @@ class Controller {
|
|||
\OC_JSON::success(array("data" => array( "message" => $l->t("Saved") )));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the field name to use it in error messages
|
||||
*
|
||||
* @param $setting string
|
||||
* @param $l \OC_L10N
|
||||
* @return string
|
||||
*/
|
||||
public static function getFieldname($setting, $l) {
|
||||
switch ($setting) {
|
||||
case 'mail_smtpmode':
|
||||
return $l->t( 'SMTP mode' );
|
||||
return $l->t( 'Send mode' );
|
||||
case 'mail_smtpsecure':
|
||||
return $l->t( 'Secure SMTP' );
|
||||
return $l->t( 'Encryption' );
|
||||
case 'mail_smtpauthtype':
|
||||
return $l->t( 'Authentification method for SMTP' );
|
||||
return $l->t( 'Authentification method' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ $(document).ready(function(){
|
|||
});
|
||||
|
||||
$('#mail_smtpmode').change(function() {
|
||||
if ($(this).val() != 'smtp') {
|
||||
if ($(this).val() !== 'smtp') {
|
||||
$('#setting_smtpauth').addClass('hidden');
|
||||
$('#setting_smtphost').addClass('hidden');
|
||||
$('#mail_smtpsecure_label').addClass('hidden');
|
||||
|
|
|
@ -288,8 +288,12 @@ if (!$_['internetconnectionworking']) {
|
|||
<?php endforeach;?>
|
||||
</select>
|
||||
|
||||
<label id="mail_smtpsecure_label" for="mail_smtpsecure"<?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>><?php p($l->t( 'Encryption' )); ?></label>
|
||||
<select name="mail_smtpsecure" id="mail_smtpsecure"<?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
<label id="mail_smtpsecure_label" for="mail_smtpsecure"
|
||||
<?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
<?php p($l->t( 'Encryption' )); ?>
|
||||
</label>
|
||||
<select name="mail_smtpsecure" id="mail_smtpsecure"
|
||||
<?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
<?php foreach ($mail_smtpsecure as $secure => $name):
|
||||
$selected = '';
|
||||
if ($secure == $_['mail_smtpsecure']):
|
||||
|
@ -302,9 +306,11 @@ if (!$_['internetconnectionworking']) {
|
|||
|
||||
<p>
|
||||
<label for="mail_from_address"><?php p($l->t( 'From address' )); ?></label>
|
||||
<input type="text" name='mail_from_address' id="mail_from_address" placeholder="<?php p('owncloud')?>" value='<?php p($_['mail_from_address']) ?>' />
|
||||
<input type="text" name='mail_from_address' id="mail_from_address" placeholder="<?php p('mail')?>"
|
||||
value='<?php p($_['mail_from_address']) ?>' />
|
||||
@
|
||||
<input type="text" name='mail_domain' id="mail_domain" placeholder="<?php p('example.com')?>" value='<?php p($_['mail_domain']) ?>' />
|
||||
<input type="text" name='mail_domain' id="mail_domain" placeholder="<?php p('example.com')?>"
|
||||
value='<?php p($_['mail_domain']) ?>' />
|
||||
</p>
|
||||
|
||||
<p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
|
@ -319,21 +325,26 @@ if (!$_['internetconnectionworking']) {
|
|||
<?php endforeach;?>
|
||||
</select>
|
||||
|
||||
<input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" value="1" <?php if ($_['mail_smtpauth']) print_unescaped('checked="checked"'); ?> />
|
||||
<input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" value="1"
|
||||
<?php if ($_['mail_smtpauth']) print_unescaped('checked="checked"'); ?> />
|
||||
<label for="mail_smtpauth"><?php p($l->t( 'Authentication required' )); ?></label>
|
||||
</p>
|
||||
|
||||
<p id="setting_smtphost" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
<label for="mail_smtphost"><?php p($l->t( 'Server address' )); ?></label>
|
||||
<input type="text" name='mail_smtphost' id="mail_smtphost" placeholder="<?php p('smtp.example.com')?>" value='<?php p($_['mail_smtphost']) ?>' />
|
||||
<input type="text" name='mail_smtphost' id="mail_smtphost" placeholder="<?php p('smtp.example.com')?>"
|
||||
value='<?php p($_['mail_smtphost']) ?>' />
|
||||
:
|
||||
<input type="text" name='mail_smtpport' id="mail_smtpport" placeholder="<?php p($l->t('Port'))?>" value='<?php p($_['mail_smtpport']) ?>' />
|
||||
<input type="text" name='mail_smtpport' id="mail_smtpport" placeholder="<?php p($l->t('Port'))?>"
|
||||
value='<?php p($_['mail_smtpport']) ?>' />
|
||||
</p>
|
||||
|
||||
<p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
|
||||
<label for="mail_smtpname"><?php p($l->t( 'Credentials' )); ?></label>
|
||||
<input type="text" name='mail_smtpname' id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>" value='<?php p($_['mail_smtpname']) ?>' />
|
||||
<input type="password" name='mail_smtppassword' id="mail_smtppassword" placeholder="<?php p($l->t('SMTP Password'))?>" value='<?php p($_['mail_smtppassword']) ?>' />
|
||||
<input type="text" name='mail_smtpname' id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>"
|
||||
value='<?php p($_['mail_smtpname']) ?>' />
|
||||
<input type="password" name='mail_smtppassword' id="mail_smtppassword"
|
||||
placeholder="<?php p($l->t('SMTP Password'))?>" value='<?php p($_['mail_smtppassword']) ?>' />
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
|
|
Loading…
Reference in a new issue