diff --git a/integrations.php b/integrations.php index 70825e0..783d035 100644 --- a/integrations.php +++ b/integrations.php @@ -55,8 +55,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $existing = $stmtExisting->fetch(); $existingSettings = json_decode($existing['settings'] ?? '{}', true) ?: []; - // Als geheim veld leeg is gelaten, behoud het bestaande geheim - if (empty($clientSecret) && !empty($existingSettings['client_secret'])) { + // Als geheim veld leeg is gelaten of bullet tekens bevat, behoud het bestaande geheim + if (($clientSecret === '' || $clientSecret === '••••••••••••••••') && !empty($existingSettings['client_secret']) && $existingSettings['client_secret'] !== '••••••••••••••••') { $clientSecret = $existingSettings['client_secret']; } @@ -119,7 +119,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $existing = $stmtExisting->fetch(); $existingSettings = json_decode($existing['settings'] ?? '{}', true) ?: []; - if (empty($jiraToken) && !empty($existingSettings['jira_api_token'])) { + if (($jiraToken === '' || $jiraToken === '••••••••••••••••') && !empty($existingSettings['jira_api_token']) && $existingSettings['jira_api_token'] !== '••••••••••••••••') { $jiraToken = $existingSettings['jira_api_token']; } @@ -341,11 +341,11 @@ $redirectUri = rtrim(APP_URL, '/') . '/auth/callback_microsoft.php'; type="password" id="msClientSecret" name="client_secret" - value="" + value="" placeholder="Plak hier de Waarde (Value) van uw Client Secret" class="w-full bg-slate-950 border border-slate-800 rounded-lg px-2.5 py-1.5 pr-8 text-xs text-white placeholder-slate-600 focus:outline-none focus:border-blue-500 font-mono" > - @@ -548,11 +548,11 @@ $redirectUri = rtrim(APP_URL, '/') . '/auth/callback_microsoft.php'; type="password" id="jiraApiTokenInput" name="jira_api_token" - value="" + value="" placeholder="Plak hier uw Atlassian API token" class="w-full bg-slate-950 border border-slate-800 rounded-lg px-2.5 py-1.5 pr-8 text-xs text-white placeholder-slate-600 focus:outline-none focus:border-sky-500 font-mono" > - @@ -692,10 +692,19 @@ function copyToClipboard(elementId) { }); } -function togglePasswordVisibility(inputId) { +function togglePasswordVisibility(inputId, btn) { const input = document.getElementById(inputId); if (!input) return; - input.type = input.type === 'password' ? 'text' : 'password'; + const isNowText = input.type === 'password'; + input.type = isNowText ? 'text' : 'password'; + if (btn) { + btn.innerHTML = isNowText + ? '' + : ''; + if (typeof lucide !== 'undefined') { + lucide.createIcons(); + } + } } async function importJiraToTasks(btn, title, jiraKey, url, priority = 'P1') {