Skip to content

Commit

Permalink
move logout from oidc to new file
Browse files Browse the repository at this point in the history
  • Loading branch information
PandorasActorMS committed Sep 20, 2023
1 parent 3029499 commit b9f72d2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@
<div class="info">
<a href="#" onclick="load(this, 'about.htm')">Über HAWKI</a>
<a href="#" id="feedback" onclick="load(this, 'userpost.php')">Feedback</a>
<a href="logout.php">Abmelden (<?php echo $_SESSION['username']?>)</a>
<a href=<?php if(isset($_SESSION['oidc'])){
echo "logout_oidc.php";
} else echo "logout.php" ?>>Abmelden (<?php echo $_SESSION['username']?>)</a>
<br>
<a href="/datenschutz" target="_blank" >Datenschutz</a>
<a href="/impressum" target="_blank">Impressum</a>
Expand Down
6 changes: 0 additions & 6 deletions logout.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?php
session_start();
if(isset($_SESSION['oidc'])){
$oidc = $_SESSION['oidc'];
unset($_SESSION['oidc']);
$oidc -> sign_out($oidc->getIdToken(), "https://ai.lab.hm.edu/logout.php");
}

session_destroy();
header("Location: login.php");
exit;
Expand Down
16 changes: 16 additions & 0 deletions logout_oidc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
require __DIR__ . '/vendor/autoload.php';

use Jumbojett\OpenIDConnectClient;

session_start();
$oidc = $_SESSION['oidc'];
unset($_SESSION['oidc']);
$oidc -> sign_out($oidc->getIdToken(), "https://ai.lab.hm.edu/logout.php");



session_destroy();
header("Location: login.php");
exit;
?>

0 comments on commit b9f72d2

Please sign in to comment.