Compare commits

...

2 Commits

Author SHA1 Message Date
0ece15a23b Logout: Microsoft-Redirect im Dev-Modus umgehen
Beim Abmelden wurde bisher immer auf login.microsoftonline.com weitergeleitet,
was lokal ins Leere läuft. Bei DISABLE_MS_AUTH=1 wird stattdessen
/?action=intranet_logout verwendet (Desktop- und Mobile-Button).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 14:04:13 +02:00
c55777c089 Login: Microsoft-Auth per Env-Variable deaktivierbar machen
Im lokalen Docker-Betrieb funktioniert der Microsoft-OAuth-Flow nicht.
DISABLE_MS_AUTH=1 in docker-compose.yml schaltet ihn ab und zeigt
stattdessen ein einfaches Dev-Login-Formular (Eingabe der User-ID
aus main_contact). Auf 0 setzen, um MS-Auth wieder zu aktivieren.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 14:03:53 +02:00
2 changed files with 29 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ $translation = \DynCom\mysyde\common\classes\Registry::get('translation');
$isAzure = true; $isAzure = getenv('DISABLE_MS_AUTH') !== '1';
if ($isAzure) { if ($isAzure) {
@@ -260,11 +260,33 @@ getQuote();
} }
} }
else { else {
?> ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dev Login</title>
<style>
body { font-family: sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #f0f0f0; }
.box { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); min-width: 280px; }
.box h2 { margin: 0 0 1rem; font-size: 1.1rem; color: #c00; }
.box label { display: block; margin-bottom: .25rem; font-size: .85rem; color: #555; }
.box input[type=number] { width: 100%; box-sizing: border-box; padding: .5rem; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 1rem; font-size: 1rem; }
.box button { width: 100%; padding: .6rem; background: #0078d4; color: #fff; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }
.box button:hover { background: #005fa3; }
.note { margin-top: .75rem; font-size: .75rem; color: #999; text-align: center; }
</style>
</head>
<body>
<div class="box">
<h2>⚠️ Dev-Login (kein Microsoft)</h2>
<form method="post">
<label>User-ID (aus main_contact)</label>
<input type="number" name="fgztiknxbhhk" min="1" required autofocus />
<button type="submit">Einloggen</button>
</form>
<p class="note">Nur lokal verfügbar — DISABLE_MS_AUTH=1 in docker-compose.yml</p>
</div>
</body>
<?php <?php
} }
?> ?>

View File

@@ -69,7 +69,7 @@
transform="translate(-3.232 -4.31)" /> transform="translate(-3.232 -4.31)" />
</g> </g>
</svg> </svg>
<a href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/" onclick="delete_coockie()">Abmelden</a> <a href="<?= getenv('DISABLE_MS_AUTH') === '1' ? '/?action=intranet_logout' : 'https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/' ?>" onclick="delete_coockie()">Abmelden</a>
</div> </div>
<script> <script>
function delete_coockie() { function delete_coockie() {
@@ -111,7 +111,7 @@
transform="translate(-3.232 -4.31)" /> transform="translate(-3.232 -4.31)" />
</g> </g>
</svg> </svg>
<a href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/" onclick="logout(<?php echo $_SESSION['login_id']; ?>)">Abmelden</a> <a href="<?= getenv('DISABLE_MS_AUTH') === '1' ? '/?action=intranet_logout' : 'https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://awo-hamburg.breadcrumb-online.de/dev/de/logout/' ?>" onclick="logout(<?php echo $_SESSION['login_id']; ?>)">Abmelden</a>
</div> </div>
</div> </div>
</div> </div>