git clone https://github.com/kafeman/HabraAuth.git
HabraAuth.class.php
, it needs to be connected first of all:
<?php include('HabraAuth.class.php'); ?>
<h1> </h1> <form method="post"> <p> :</p> <p> <input type="text" name="login"> <input type="submit" value=" !"> </p> </form>
// , // $config = array( // callback- // 'callback' => 'http://localhost/sample/callback.php', // // - , ;-) 'salt' => 'qwerty', // , // - , // 'cookies' => array( 'PHPSESSID' => '8ba44cc67a851d1c43d740c356665061', 'hsec_id' => 'c086a2c37f395cbb9aa7b064c8c712db', ), ); // HabraAuth // $habraAuth = new HabraAuth($config); // Auth $habraAuth->Auth($_POST['login']); // , header('Location: http://habrahabr.ru/users/none/mail/');
<?php // , if (empty($_GET['user']) || empty($_GET['hash'])) { header('Location: /sample/login.php'); exit(); } // include __DIR__ . '/../HabraAuth.class.php'; // , $config = array('salt' => 'qwerty'); // HabraAuth $habraAuth = new HabraAuth($config); // if (!$habraAuth->CheckAuth($_GET['user'], $_GET['hash'])) { header('Location: /sample/login.php'); exit(); } // TODO - echo ', ' . $_GET['user'] . ', ?'; ?>
Source: https://habr.com/ru/post/157255/