Advertisement
Infra_HDC

ticketdemo-cgi.php

Oct 15th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2.   session_start();
  3.   if (!is_null($_GET['url'])) $_SESSION['url']=$_GET['url'];
  4.  
  5.   // If ezproxyticket.php isn't on your PHP path, you may need to
  6.   // include a directory reference such as
  7.   // require("./ezproxyticket.php");
  8.   require("ezproxyticket.php");
  9.  
  10.   // static auth
  11.   define('USER', "someuser");
  12.   define('PASSWORD', "xxxxxxxxxxxxxxx");
  13.  
  14.   if (($_POST['user'] == USER) && ($_POST['password'] == PASSWORD)) {
  15.   // Create an EZproxyTicket object that will be used to generate
  16.   // ticket URLs.  The first parameter is the EZproxy server base
  17.   // URL, the second is the shared secret that appears in user.txt/ezproxy.usr,
  18.   // and the third should be changed to a variable that provides
  19.   // the user's username
  20.     $ezproxy = new EZproxyTicket("http://ezproxy.example.com:2048", "yyyyyyyyyyyyy", $_POST['user']);
  21.     header('Location: '.$ezproxy->url($_SESSION['url']));
  22.   }
  23. ?>
  24. <html>
  25.         <head>
  26.                 <title>MY OWN AUTH</title>
  27.         </head>
  28.         <body>
  29.                 <form action="ticketdemo-cgi.php" method="POST">
  30.                         <p>Введите логин:</p>
  31.                         <input type="text" name="user">
  32.                         <p>Введите пароль:</p>
  33.                         <input type="password" name="password">
  34.                         <input type="submit">
  35.                 </form>
  36.         </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement