fix(ui): mirror the EWS username:password credentials rule on the SMTP page
This commit is contained in:
+18
@@ -308,6 +308,24 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Mirror of the same gate's credentials rule, with the identical FIRST-colon-only
|
||||
// split: a domain-qualified user name contains no colon but a password may. This
|
||||
// page has no preserve-if-blank behaviour — the field's value IS what gets
|
||||
// persisted, and a blank field clears the stored credential — so the rule applies
|
||||
// on edit as well as add, exactly as the management gate validates the effective row.
|
||||
if (IsEwsForm)
|
||||
{
|
||||
var credentialParts = _credentials?.Trim().Split(':', 2) ?? [];
|
||||
if (credentialParts.Length != 2
|
||||
|| credentialParts[0].Length == 0
|
||||
|| credentialParts[1].Length == 0)
|
||||
{
|
||||
_formError = "EWS credentials must be in 'username:password' form "
|
||||
+ @"(username may be 'domain\username').";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (_editingSmtp != null)
|
||||
|
||||
Reference in New Issue
Block a user