Infra_HDC icon

ticketdemo-cgi.php

Infra_HDC | PRO | 10/15/19 06:57:28 AM UTC | 0 ⭐ | 1044 👁️ | Never ⏰ | []
PHP |

1.39 KB

|

None

|

0 👍

/

0 👎

<?php
  session_start();
  if (!is_null($_GET['url'])) $_SESSION['url']=$_GET['url'];
 
  // If ezproxyticket.php isn't on your PHP path, you may need to
  // include a directory reference such as
  // require("./ezproxyticket.php");
  require("ezproxyticket.php");
 
  // static auth
  define('USER', "someuser");
  define('PASSWORD', "xxxxxxxxxxxxxxx");
 
  if (($_POST['user'] == USER) && ($_POST['password'] == PASSWORD)) {
  // Create an EZproxyTicket object that will be used to generate
  // ticket URLs.  The first parameter is the EZproxy server base
  // URL, the second is the shared secret that appears in user.txt/ezproxy.usr,
  // and the third should be changed to a variable that provides
  // the user's username
    $ezproxy = new EZproxyTicket("http://ezproxy.example.com:2048", "yyyyyyyyyyyyy", $_POST['user']);
    header('Location: '.$ezproxy->url($_SESSION['url']));
  }
?>
<html>
        <head>
                <title>MY OWN AUTH</title>
        </head>
        <body>
                <form action="ticketdemo-cgi.php" method="POST">
                        <p>Введите логин:</p>
                        <input type="text" name="user">
                        <p>Введите пароль:</p>
                        <input type="password" name="password">
                        <input type="submit">
                </form>
        </body>
</html>

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎