Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement