Commit Graph

198 Commits

Author SHA1 Message Date
Milos Sen
42d4f44a70 rollback plugin name 1 2026-08-08 10:28:07 +03:00
Milos Sen
1a5b07273d change plugin name
Some checks failed
PHP Lint / lint (8.2) (pull_request) Has been cancelled
PHP Lint / lint (8.3) (pull_request) Has been cancelled
PHP Lint / lint (8.4) (pull_request) Has been cancelled
PHP CodeSniffer / phpcs (pull_request) Has been cancelled
2026-08-08 09:28:20 +03:00
Milos Sen
64d2ff3e98 change plugi name 2026-08-08 09:20:09 +03:00
Milos Sen
85a0d4f9ec change plugi name 2026-08-08 09:03:01 +03:00
Milos Sen
84c7b31dfb update comment v1.0.0 2026-08-08 06:53:11 +03:00
1499347b7b added workbench to list of skins 2026-08-07 19:41:40 +00:00
1d39bc03d8 Update SQL/postgres.initial.sql
makes the script safe to re-run against an already-migrated database
2026-08-06 05:10:47 +00:00
Laurent Dinclaux
8f45736b1b fix(skins): keep menu links visible and align native select look
The wrapper had width:100% which pushed the right-side menu links
(mail/contacts/settings/logout) out of #taskbar in Classic, and the
global custom select styling defeated Roundcube's native select
rendering — even when reset — because any background-image on a
<select> disables the native gradient/rounded corners.

- Scope the custom appearance/SVG-chevron CSS to Elastic and Larry
- Add a Classic-specific rule (width:auto, max-width, -2px nudge) that
  preserves Roundcube's native select look in #taskbar
- Drop the inline padding:0 imposed by the PHP renderer; let CSS own it
- Cap the Larry wrapper width to keep .button-logout in flow, and move
  the Larry-only styling out of the JS into the scoped CSS rule

Fixes #1
5.0.4
2026-05-12 17:02:32 +11:00
Laurent Dinclaux
8385197f11 chore: refresh composer.lock 2026-05-06 20:26:54 +11:00
Laurent Dinclaux
ca16e3ca39 ci: bump actions/checkout to v5 (Node 24) 2026-05-06 20:21:04 +11:00
Laurent Dinclaux
c194661fa3 fix: prevent username flash on load and remove select max-width 5.0.3 2026-05-06 20:11:10 +11:00
Laurent Dinclaux
e539c60e9b feat: use primary identity display name in switcher dropdown
The account switcher dropdown previously showed the IMAP username
(typically the email address) for the primary account. Now it falls
back to the identity's display name when available, matching the
behavior of secondary accounts which use their custom label.

Priority order: global_alias session var > primary identity display
name > IMAP username.
2026-05-06 17:37:50 +11:00
Laurent Dinclaux
bea25d8396 fix: prevent migration from running on fresh installs 5.0.2 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
Laurent Dinclaux
54b96ef059 refactor: delegated form events and harden preconfig enforcement 5.0.1 2026-02-27 17:12:27 +11:00
Laurent Dinclaux
7de47160b6 fix: add dropdown chevron to account switcher 2026-02-27 17:10:26 +11:00
Laurent Dinclaux
e81002c528 Rename Composer package to gecka/ident-switch
The roundcube/plugin-installer derives the plugin directory name from
the package name by replacing dashes with underscores. The previous
name gecka/roundcube-ident_switch resulted in plugins/roundcube_ident_switch/.
Renaming to gecka/ident-switch produces the correct plugins/ident_switch/.
5.0.0
2026-02-11 01:19:29 +11:00
Laurent Dinclaux
efcca69d43 Fix double HTML escaping in switcher and harden JS edge cases 2026-02-11 01:18:10 +11:00
Laurent Dinclaux
dd477c1b83 Rewrite README for v5.x with full feature documentation 2026-02-10 23:34:38 +11:00
Laurent Dinclaux
c86f38672a Hide Sieve form section when managesieve plugin is not active
Add GitHub Actions workflows for PHP CodeSniffer and PHP Lint (8.2/8.3/8.4).
2026-02-10 23:34:38 +11:00
Laurent Dinclaux
b9e16f186d PSR-12 coding standards compliance
Add phpcs/phpcbf tooling (composer require-dev, scripts, .phpcs.xml).
Auto-fix tabs to spaces across all PHP files (phpcbf).
Add missing doc comments for classes and constructors.
Add missing @param tags on public/private methods.
2026-02-10 23:34:38 +11:00
Laurent Dinclaux
05a7a2967f Fixes: centralize helpers, remove dead code, fix JS issues 2026-02-10 23:34:38 +11:00
Laurent Dinclaux
da573c184e Merge parent_id migration into single 2026021000 upgrade script 2026-02-10 23:34:38 +11:00
Laurent Dinclaux
0dbba36345 Filter compose From dropdown by active account
When composing, only show identities belonging to the active account
and its aliases. Prevents sending from wrong SMTP and saving drafts/sent
to wrong folders.
2026-02-10 22:29:04 +11:00
Laurent Dinclaux
08673a4399 Add alias SMTP/Sieve resolution, debug logging, and exclude aliases from switcher
SMTP and Sieve hooks follow parent_id to resolve alias config from parent
account. Aliases excluded from account switcher dropdown and background
mail checker. Debug logging behind ident_switch.debug config flag.
Fix double ssl:// prefix in switch_account host parsing.
2026-02-10 22:28:56 +11:00
Laurent Dinclaux
e4bd92ca63 Replace enabled checkbox with account mode select
Identities can now be set as primary (default), alias of an existing
separate account, or separate account. Alias records store parent_id
and skip server validation. Password sentinel changed to a safe string
that survives HTML form round-trips. Preconfig host composition fixed
to include security scheme.
2026-02-10 22:28:30 +11:00
Laurent Dinclaux
08797ab5a8 Add parent_id column for alias identity support
Migration and initial schemas for linking alias identities to parent
accounts via a nullable parent_id foreign key.
2026-02-10 22:28:20 +11:00
Laurent Dinclaux
fd9836c7ae 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
2026-02-10 20:50:05 +11:00
Laurent Dinclaux
3a8202bd7a Align Checker port resolution and add delimiter preconfig support 2026-02-10 18:38:42 +11:00
Laurent Dinclaux
39fe417104 Add Auto/Manual mode select for IMAP delimiter 2026-02-10 18:15:43 +11:00
Laurent Dinclaux
36b9b3e35f Replace TLS checkbox with security dropdown (None/STARTTLS/SSL)
Replace the single IMAP TLS checkbox with a per-protocol security
dropdown for IMAP, SMTP, and Sieve. The security scheme (ssl:// or
tls://) is now stored directly in the host field, unifying the approach
across all protocols.

Smart form behavior:
- Default ports update automatically when changing security type
- Fields clear on blur when value matches the placeholder
- Warning shown when selecting no encryption
- Defaults: IMAP SSL/993, SMTP STARTTLS/587, Sieve STARTTLS/4190

The DB_SECURE_IMAP_TLS flag is no longer written but still read for
backward compatibility with existing records.
2026-02-10 17:54:36 +11:00
Laurent Dinclaux
780cfc6a7e Add wildcard domain support in preconfig
Use '*' as a catch-all domain key in ident_switch.preconfig to provide
default settings for any domain not explicitly listed.
2026-02-10 17:46:58 +11:00
Laurent Dinclaux
fc13088c62 Use auto-detect for IMAP folder hierarchy delimiter
Roundcube auto-detects the delimiter from the IMAP server via LIST
command. Remove hardcoded fallback values and let Roundcube handle
detection when no delimiter is explicitly configured.
2026-02-10 17:46:15 +11:00
Laurent Dinclaux
12572b563d Add background mail checking and new mail notifications 2026-02-10 17:13:57 +11:00
Laurent Dinclaux
6ea4aee0a7 Add managesieve (Sieve) support for remote accounts
When switching identities, the managesieve plugin still connected to
the default sieve server. Hook into managesieve_connect to redirect
the sieve connection to the remote account's server.

Adds sieve_host, sieve_port and sieve_auth columns to the database,
a Sieve section to the identity settings form, preconfig support for
sieve_host, and localized labels for all 7 languages.
2026-02-10 14:03:47 +11:00
Laurent Dinclaux
546e9ba882 Add migration guide for users of the original plugin 2026-02-10 14:02:52 +11:00
Laurent Dinclaux
9ebe30c40a Support separate IMAP and SMTP hosts in preconfig
The preconfig previously used a single 'host' field for both IMAP and
SMTP, making it impossible to configure different servers/schemes/ports
(e.g. IMAPS on 993 + SMTP STARTTLS on 587). Also, ssl:// scheme was
silently lost during parse_url() since only tls:// was recognized.

Add imap_host and smtp_host as separate config keys with full scheme
support (ssl://, tls://). The legacy 'host' key is still supported as
fallback for backward compatibility.
2026-02-10 14:02:52 +11:00
Laurent Dinclaux
16af27a3f4 Add installation instructions to README 2026-02-10 14:02:52 +11:00
Laurent Dinclaux
3c4d856d60 Fix SQL schema issues across all database engines
- Increase password column from varchar(64) to varchar(255) to
  prevent silent truncation of encrypted passwords
- Add missing UNIQUE constraint on iid in MySQL
- Add missing IX_ident_switch_iid index in PostgreSQL
- Remove deprecated int display width in MySQL (int(10) -> int)
- Fix trailing comma syntax error in SQLite 2018121800 migration
- Normalize indentation across all initial SQL files
- Add migration 2026021000 for all engines to fix existing installs
2026-02-10 14:02:52 +11:00
Laurent Dinclaux
958af7769f Ignore config.inc.php in gitignore 2026-02-10 14:02:52 +11:00
Laurent Dinclaux
7b1a68aad6 Add conflicting packages to prevent co-installation
Declare boressoft/ident_switch (original package, same DB table)
and toteph42/identity_switch (similar plugin) as conflicts.
2026-02-10 14:02:52 +11:00
Laurent Dinclaux
651bb19d05 Split ident_switch.php into focused classes
Extract business logic into dedicated classes under lib/:
- IdentSwitchForm: form building, validation, and persistence
- IdentSwitchSwitcher: account switching, SMTP config, special folders
- IdentSwitchPreconfig: domain-based preconfiguration

The main plugin class remains the orchestrator, registering hooks
and delegating to the appropriate handler. Constants changed from
private to public to allow cross-class access.
2026-02-10 14:02:49 +11:00
Laurent Dinclaux
456d44c677 Fix and complete all localization files
- fr_FR, de_DE: add missing keys (imap.delimiter, smtp.auth.imap,
  smtp.auth.none)
- it_IT, nl_NL: rewrite with current key names (form.common.*,
  form.imap.*, form.smtp.*) and add all missing SMTP keys
- All 7 languages now have the same complete set of keys
2026-02-10 10:11:04 +11:00
Laurent Dinclaux
70f863ac68 Modernize config.inc.php.dist for Roundcube 1.6+
- Use $config instead of deprecated $rcmail_config
- Replace array() with short array syntax []
- Replace # comments with // for consistency
- Fix typo: 'threated' -> 'treated'
2026-02-10 10:11:02 +11:00
Laurent Dinclaux
d979e45fa3 Add AGPL-3.0 LICENSE file 2026-02-10 10:06:20 +11:00
Laurent Dinclaux
85ed8815f1 Modernize ident_switch.php for PHP 8.2+ and Roundcube 1.6+
- Add docblocks to all classes, methods, and constants
- Add type declarations to all parameters and return types
- Add visibility modifiers to all methods and constants
- Use PHP 8.0+ syntax: match expression, named arguments,
  str_contains(), str_starts_with(), str_ends_with()
- Replace array() with short array syntax []
- Use null coalescing operator ?? instead of isset ternaries
- Use early returns instead of deeply nested if/else
- Remove Roundcube < 1.6 compatibility code (smtp_server/smtp_port)
- Fix unreferenced $config variable in on_switch default restore
- Use union type array|false for get_preconfig return
2026-02-10 10:00:22 +11:00
Laurent Dinclaux
8b9447fc63 Bump PHP requirement to >= 8.2 (first non-EOL version) 2026-02-10 10:00:22 +11:00
Laurent Dinclaux
6a4a4e09df Add copyright headers and contributors list
Add proper copyright notices to all source files with accurate date
ranges per contributor based on git history. Add contributors to
composer.json authors and README.
2026-02-10 10:00:22 +11:00
Laurent Dinclaux
8f800610cf Remove minified JS files
Minification is unnecessary as compression is handled at the HTTP
server level and Roundcube provides its own asset pipeline.
2026-02-10 09:42:46 +11:00
Laurent Dinclaux
6cf3d3da3a Improve .gitignore for IDE, OS and Composer files 2026-02-10 09:41:47 +11:00