| 200 | |
| 201 | // wrap the TOTP modal opener to disable other login buttons only for Basic/OIDC flows |
| 202 | function openTOTPLoginModal() { |
| 203 | originalOpenTOTPLoginModal(); |
| 204 | |
| 205 | const isFormLogin = Boolean(window.__lastLoginData); |
| 206 | if (!isFormLogin) { |
| 207 | // disable Basic‑Auth link |
| 208 | const basicLink = document.querySelector('a[href$="api/auth/login_basic.php"], a[href$="/api/auth/login_basic.php"]'); |
| 209 | if (basicLink) { |
| 210 | basicLink.style.pointerEvents = 'none'; |
| 211 | basicLink.style.opacity = '0.5'; |
| 212 | } |
| 213 | // disable OIDC button |
| 214 | const oidcBtn = document.getElementById("oidcLoginBtn"); |
| 215 | if (oidcBtn) { |
| 216 | oidcBtn.disabled = true; |
| 217 | oidcBtn.style.opacity = '0.5'; |
| 218 | } |
| 219 | // hide the form login |
| 220 | const authForm = document.getElementById("authForm"); |
| 221 | if (authForm) authForm.style.display = 'none'; |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | /* ----------------- Utility Functions ----------------- */ |
| 226 | function updateItemsPerPageSelect() { |