4 Commits
4.3.4 ... 4.4

Author SHA1 Message Date
Boris Gulay
ad97f4bfd0 Use identity from field. Thanx Daniel Haag.
Closes #44.
2022-01-17 19:30:39 +03:00
Mickael
181ac6b27c Merged in Mickael/ident_switchphp-solve-the-issue-that-do-1642283330232 (pull request #4)
ident_switch.php - Solve the issue that don't set the good configuration variable for the smtp_host on the latest version + dev of roundcube

Approved-by: Boris Gulay
2022-01-17 15:55:00 +00:00
Mickael
ae7b905824 ident_switch.php - Solve the issue that don't set the good configuration variable for the smtp_host on the latest version + dev of roundcube 2022-01-15 21:48:55 +00:00
Boris Gulay
ca790d72de Add Slovenian translation. Thanx to Marko Ambrožič 2021-02-03 00:28:03 +03:00
3 changed files with 94 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
"authors": [
{
"name": "Boris Gulay",
"email": "boris@boressoft.ru",
"email": "boris@gulay.name",
"role": "Developer"
}
],

View File

@@ -159,7 +159,20 @@ class ident_switch extends rcube_plugin
{
$iid = $_SESSION['iid' . self::MY_POSTFIX];
if (!is_numeric($iid) || $iid == -1)
{
self::write_log('no identity switch is selected... trying to find related smtp server from the from header');
$requestFrom = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST);
if (empty($requestFrom)) {
self::write_log('no _from post parameter found... falling back to original default config');
return $args;
} else {
$iid = intval($requestFrom);
if ($iid == 0) {
self::write_log('falling back to original default config as _from post field is no integer: ' . $_POST['_from']);
return $args;
}
}
}
$rc = rcmail::get_instance();
@@ -179,15 +192,15 @@ class ident_switch extends rcube_plugin
$args['smtp_user'] = $r['username'];
$args['smtp_pass'] = $r['smtp_auth'] == self::SMTP_AUTH_IMAP ? $rc->decrypt($r['password']) : '';
$args['smtp_server'] = $r['smtp_host'] ? $r['smtp_host'] : 'localhost'; // Default SMTP host here
$args['smtp_host'] = $r['smtp_host'] ? $r['smtp_host'] : 'localhost'; // Default SMTP host here
$args['smtp_port'] = $r['smtp_port'] ? $r['smtp_port'] : 587; // Default SMTP port here
if ($r['flags'] & self::DB_SECURE_IMAP_TLS)
{
if (strpos($args['smtp_server'], ':') !== false)
if (strpos($args['smtp_host'], ':') !== false)
self::write_log('SMTP server already contains protocol, ignoring TLS flag.');
else
$args['smtp_server'] = 'tls://' . $args['smtp_server'];
$args['smtp_host'] = 'tls://' . $args['smtp_host'];
}
}

76
localization/sl_SI.inc Normal file
View File

@@ -0,0 +1,76 @@
<?php
/*
* Localization file for ident_switch plugin
*/
$labels = array();
// Plugin ident_switch
$labels['form.common.caption'] = 'Razširitev ident_switch';
// Enabled
$labels['form.common.enabled'] = 'Omogočeno';
// Label
$labels['form.common.label'] = 'Oznaka';
// Value in \'Label\' field is too long (32 chars max).
$labels['err.label.long'] = 'Število znakov v polju \'Oznaka\' presega maksimalno število znakov (max 32 znakov).';
// IMAP
$labels['form.imap.caption'] = 'IMAP';
// Server host name
$labels['form.imap.host'] = 'Ime oz. naslov IMAP strežnika';
// Secure connection (TLS)
$labels['form.imap.tls'] = 'Varna povezava (TLS)';
// Port
$labels['form.imap.port'] = 'Vrata';
// Folder hierarchy delimiter
$labels['form.imap.delimiter'] = 'Ločilo hierarhije map';
// Username
$labels['form.imap.username'] = 'Uporabniško ime';
// Password
$labels['form.imap.password'] = 'Geslo';
// Value in \'Username\' field is too long (64 chars max).
$labels['err.user.long'] = 'Število znakov v polju \'Uporabniško ime\' presega maksimalno število znakov (max 64 znakov).';
// SMTP
$labels['form.smtp.caption'] = 'SMTP';
// Server host name
$labels['form.smtp.host'] = 'Ime oz. naslov SMTP strežnika';
// Secure connection (TLS)
$labels['form.smtp.tls'] = 'Varna povezava (TLS)';
// Port
$labels['form.smtp.port'] = 'Vrata';
// Authorization
$labels['form.smtp.auth'] = 'Avtorizacija';
// As IMAP
$labels['form.smtp.auth.imap'] = 'Tako kot IMAP';
// None
$labels['form.smtp.auth.none'] = 'Brez';
// Errors
// Value in \'Server host name\' field is too long (64 chars max).
$labels['err.host.long'] = 'Število znakov v polju \'Ime oz. naslov IMAP strežnika\' presega maksimalno število znakov (max 64 znakov).';
// Value in \'Port\' field must be a number.
$labels['err.port.num'] = 'Vrednost \'Vrata\' mora biti številka.';
// Value in \'Port\' field must be between 1 and 65535.
$labels['err.port.range'] = 'Vrednost v polju \'Vrata\' mora biti med 1 in 65535.';