Add custom auth, connection testing, preconfig_only, and security fixes
Major form improvements: - Custom SMTP/Sieve credentials (separate username/password per protocol) - Connection testing on save (IMAP, SMTP, Sieve) with localized errors - preconfig_only mode to restrict domains to preconfigured entries - Form POST value preservation on save errors (auth selects, passwords) - Smart host placeholders (SMTP/Sieve default to IMAP host) Security and bug: - Fix password re-encryption bug (was comparing raw vs encrypted values) - Fix XSS: escape label output in special folders form - Fix parse_url() return value not checked for false - Fix decrypt() failures not handled (fallback to empty string) - Sanitize log output (remove raw POST data from log messages) - Replace weak == comparisons with strict === (PHP and JS) SQL changes: - Consolidate 4 migrations (2026021000-03) into single 2026021000 - Remove now unused notify_sound_url column - Add smtp_username, smtp_password, sieve_username, sieve_password columns
This commit is contained in:
@@ -42,12 +42,18 @@ class ident_switch extends rcube_plugin
|
||||
/** @var int SMTP authentication: no authentication required. */
|
||||
public const SMTP_AUTH_NONE = 2;
|
||||
|
||||
/** @var int SMTP authentication: use custom credentials. */
|
||||
public const SMTP_AUTH_CUSTOM = 3;
|
||||
|
||||
/** @var int Sieve authentication: use same credentials as IMAP. */
|
||||
public const SIEVE_AUTH_IMAP = 1;
|
||||
|
||||
/** @var int Sieve authentication: no authentication required. */
|
||||
public const SIEVE_AUTH_NONE = 2;
|
||||
|
||||
/** @var int Sieve authentication: use custom credentials. */
|
||||
public const SIEVE_AUTH_CUSTOM = 3;
|
||||
|
||||
/** @var int Notification checking: enabled. */
|
||||
public const NOTIFY_CHECK_ENABLED = 1;
|
||||
|
||||
@@ -189,7 +195,7 @@ class ident_switch extends rcube_plugin
|
||||
while ($r = $rc->db->fetch_assoc($qRec)) {
|
||||
$accValues[] = $r['id'];
|
||||
$iidMap[$r['iid']] = $r['id'];
|
||||
if ($iid == $r['iid']) {
|
||||
if ($iid === (int)$r['iid']) {
|
||||
$accSelected = $r['id'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user