Public paste
SSO
By: Xmoo | Date: Jun 22 2011 12:44 | Format: PHP | Expires: never | Size: 2.06 KB | Hits: 1454

  1. <?php
  2. ////////////////////////////////////////
  3. // (C)ontent (M)anagement (S)ystem    //
  4. // Version: 1.0                       //
  5. // By: Mohammad Moghtader                 //
  6. // Group: B31                                 //
  7. ////////////////////////////////////////  
  8.  
  9. include("inc/config.php"); //Configuratie includen
  10. include("inc/functions.php"); //Functie includen
  11.  
  12. $sid = $_GET['sid'];
  13. $sss = mysql_query("SELECT * FROM ira_session WHERE session_id  = '".$sid."'") or die(mysql_error());
  14.                         while($ttt = mysql_fetch_object($sss))
  15.                     $jusername = $ttt->username;
  16.  
  17. ?>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
  19. <!-- =============================== -->
  20. <!-- (S)elf (S)ervice (P)ortal       -->
  21. <!--     Version: 1.0                -->
  22. <!--     By: Mohammad Moghtader      -->
  23. <!--     Group: B31c                 -->
  24. <!-- =============================== -->
  25. <!--    (c) 2011  DBI                -->
  26. <!--     All rights reserved         -->
  27. <!-- =============================== -->
  28.  
  29. <?php
  30.         $query = ("SELECT * FROM ira_users WHERE username = '".$jusername."'");
  31.         $aaa = mysql_query($query) or die ("Error: " .mysql_error()); // query uitvoeren
  32.         $record = mysql_num_rows($aaa);
  33.                              
  34.         if ($record != 0){ //Controleren op gegevens
  35.                   $bbb = ("SELECT * FROM ira_users WHERE username = '".$jusername."'");
  36.                   $ccc = mysql_query($bbb) or die ("Error: " .mysql_error());
  37.                   while ($ddd = mysql_fetch_object($ccc)){
  38.             $_SESSION['persid'] = $ddd->id; //Registreer de variabele
  39.             $_SESSION['access'] = $ddd->usertype;
  40.             echo "<meta http-equiv='refresh' content='0;url=index.php?p=thuis'>";
  41.          } }  
  42.                  else { echo "<script type='text/javascript'>alert('Foutieve gegevens!'); </script>";
  43.           echo "<script type='text/javascript'>window.location='http://ssp.moghtader.net/'; </script>";
  44.                   echo "<script type='text/javascript'>window.location.reload; </script>"; }
  45. ?>