Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
de:shibslohttpd:helperscripts [2015/12/09 11:25] Schreiterer, Frankde:shibslohttpd:helperscripts [2019/02/28 12:25] (aktuell) – [logoutnotify.php] Schreiterer, Frank
Zeile 10: Zeile 10:
 //redirect to application //redirect to application
 header('Location: '.$_GET['return']); header('Location: '.$_GET['return']);
 +?>
 +</file>
 +
 +===== initsess.php =====
 +<file php initsess.php>
 +<?php
 +//initialize application session
 +session_start();
 +//applicationpath
 +$path = "Path/to/NORMALAPPLICATION";
 +//and redirect to application
 +$redirect = "https://".$_SERVER['SERVER_NAME']."/$path";
 +header('Location: '.$redirect);
 ?> ?>
 </file> </file>
Zeile 89: Zeile 102:
 //       See function LogoutNotification below //       See function LogoutNotification below
    
-elseif (!empty($HTTP_RAW_POST_DATA)) {+elseif (!empty(file_get_contents("php://input"))) {
     // Set SOAP header     // Set SOAP header
     $server = new SoapServer('https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'/LogoutNotification.wsdl');     $server = new SoapServer('https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'/LogoutNotification.wsdl');
Zeile 205: Zeile 218:
 </file> </file>
  
-===== sessionremover.php =====+===== remsess.php =====
  
-<file php SESSIONREMOVER.php>+<file php remsess.php>
 <?php <?php
  
 /* /*
-    This program is free software: you can redistribute it and/or modify+ This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 3 of the License, or     the Free Software Foundation, either version 3 of the License, or
Zeile 226: Zeile 239:
     Copyright 2015 Frank Schreiterer, University of Bamberg, Computing Centre          Copyright 2015 Frank Schreiterer, University of Bamberg, Computing Centre     
 */  */ 
- 
-#modus memcached oder DB 
-$mode = "memcached"; 
- 
-function removeDB ($destid) { 
- $dbDriver="mysql"; 
- $dbHost="localhost"; 
- $dbUser="shibUser"; 
- $dbPass="Password"; 
- $dbName="shibchecker"; 
- $dbPort="3306"; 
- try { 
- $pdo = new PDO("$dbDriver:dbname=$dbName;host=$dbHost;port=$dbPort",$dbUser,$dbPass); 
- } catch (PDOExeption $e) { } 
- $sql="Delete from appshibsession where appsessionid='$destid'"; 
- $pdo->query($sql);  
- $pdo = NULL; 
-} 
  
 function removeMemcached($destid) { function removeMemcached($destid) {
-    $mcsrv="127.0.0.1"; + $mcsrv="127.0.0.1"; 
-    $mcport="11211"; + $mcport="11211"; 
-    $mc=new Memcache; + $mc=new Memcache; 
-    $mc->connect($mcsrv,$mcport); + $mc->connect($mcsrv,$mcport); 
-    $stats = $mc->getExtendedStats();+ $stats = $mc->getExtendedStats();
     $list = array();     $list = array();
     #memcached auslesen und bei passendem Wert den Key entfernen     #memcached auslesen und bei passendem Wert den Key entfernen
Zeile 281: Zeile 276:
  if ($destid != "") {  if ($destid != "") {
  session_id($destid);  session_id($destid);
- if ($mode == "DB") { + removeMemcached($destid);
- removeDB($destid); +
- } elseif ($mode == "memcached") { +
- removeMemcached($destid); +
- }+
  session_start();   session_start();
  session_destroy();   session_destroy();
Zeile 296: Zeile 287:
  $shiblogoff = $_REQUEST['shibloggedoff'];  $shiblogoff = $_REQUEST['shibloggedoff'];
  if ($shiblogoff == "true") {  if ($shiblogoff == "true") {
- echo "Sie wurden abgemeldet.<br><br>Erneut <a href=\"$serverurl/logouttest/lazy\">mit Lazy-Sesson anmelden</a><br> + echo "Sie wurden abgemeldet.<br><br>Erneut <a href=\"$serverurl/PATH/TO/Login\">anmelden</a><br>";
- oder <a href=\"$serverurl/logouttest/mixedlazy\">mit Lazy-Sesson oder Anwendungssession anmelden</a><br+
- oder <a href=\"$serverurl/logouttest/normal\">mit normaler Sesson anmelden</a><br><br>";  +
- echo "Von allen Webanwendungen <a href=\"https://weblogout.rz.uni-bamberg.de\">abmelden.</a>"; +
  }  }
 } else { } else {
   
  $destid = session_id();  $destid = session_id();
- if ($mode == "DB") { + removeMemcached($destid);
- removeDB($destid); +
- } elseif ($mode == "memcached") { +
- removeMemcached($destid);  +
- }+
   
- $url="$serverurl/Shibboleth.sso/Logout?return=$serverurl/logouttest/logout/remsess.php?shibloggedoff=true";+ $url="$serverurl/Shibboleth.sso/Logout?return=$serverurl/PATH/TO/remsess.php?shibloggedoff=true";
  header('Location: '.$url);  header('Location: '.$url);
 } }
  • Zuletzt geändert: vor 9 Jahren