2 Commits
5.0.1 ... 5.0.2

Author SHA1 Message Date
Laurent Dinclaux
bea25d8396 fix: prevent migration from running on fresh installs 2026-02-27 17:50:57 +11:00
Laurent Dinclaux
b4506a0a3e fix: disable mode select until email is entered 2026-02-27 17:44:15 +11:00
4 changed files with 14 additions and 2 deletions

View File

@@ -86,3 +86,5 @@ CREATE TABLE IF NOT EXISTS `ident_switch`
INDEX `IX_ident_switch_iid`(`iid`),
INDEX `IX_ident_switch_parent_id`(`parent_id`)
);
INSERT INTO `system` (`name`, `value`) VALUES ('ident_switch-version', '2026021000');

View File

@@ -85,3 +85,5 @@ CREATE TABLE ident_switch
CREATE INDEX IX_ident_switch_user_id ON ident_switch(user_id);
CREATE INDEX IX_ident_switch_iid ON ident_switch(iid);
CREATE INDEX IX_ident_switch_parent_id ON ident_switch(parent_id);
INSERT INTO system (name, value) VALUES ('ident_switch-version', '2026021000');

View File

@@ -84,3 +84,5 @@ CREATE TABLE ident_switch
CREATE INDEX IX_ident_switch_user_id ON ident_switch(user_id);
CREATE INDEX IX_ident_switch_iid ON ident_switch(iid);
CREATE INDEX IX_ident_switch_parent_id ON ident_switch(parent_id);
INSERT INTO system (name, value) VALUES ('ident_switch-version', '2026021000');

View File

@@ -56,10 +56,13 @@ function plugin_switchIdent_init() {
$("INPUT[name='_ident_switch.form.sieve.host']").attr('placeholder', initialImapHost);
}
// Re-apply preconfig from current email (handles form re-render after create abort
// where PHP record may lack email, so readonly was not set server-side)
// Disable mode select until a valid email is entered
var $modeSelect = $("SELECT[name='_ident_switch.form.common.mode']");
if (initialEmail && initialEmail.indexOf('@') > 0) {
$modeSelect.prop('disabled', false);
plugin_switchIdent_onEmailChange(initialEmail);
} else {
$modeSelect.prop('disabled', true);
}
}
@@ -278,6 +281,9 @@ function plugin_switchIdent_onEmailChange(email) {
var domain = email.substring(atPos + 1).toLowerCase();
if (!domain) return;
// Enable mode select now that we have a valid email
$("SELECT[name='_ident_switch.form.common.mode']").prop('disabled', false);
// Update label and username placeholders to match current email
$("INPUT[name='_ident_switch.form.common.label']").attr('placeholder', email);