PHP Classes

File: wp-site/hab-wp-login.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil  >  PHP WordPress Login  >  wp-site/hab-wp-login.php  >  Download  
File: wp-site/hab-wp-login.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP WordPress Login
Authenticate users of a WordPress installation
Author: By
Last change: Allow hash based authentication
Date: 2 years ago
Size: 781 bytes
 

Contents

Class file image Download
<?php



include 'wp-includes/class-phpass.php';

include
'wp-includes/wp-db.php';

include
'wp-config.php';

include
'wp-load.php';



if(isset(
$_POST['user']) && isset($_POST['pass']))
{

   
$user = htmlspecialchars($_POST['user'],ENT_QUOTES);

   
$pass = $_POST['pass'];

   
$userinfo = get_userdatabylogin($user);

    if (
$_POST['hash'] == 1)
    {
        if(
$pass == $userinfo->user_pass)
        {
            exit(
json_encode($userinfo));
        }
        die(
json_encode(array("ID"=>"null")));
    }

   
$wp_hasher = new PasswordHash(8, TRUE);

   
$check = $wp_hasher->CheckPassword($pass, $userinfo->user_pass);

    if (
$check)
    {
        exit(
json_encode($userinfo));
    }
    else
    {
        die(
json_encode(array("ID"=>"failled")));
    }
}
else
{
    die(
json_encode(array("ID"=>"null")));
}


For more information send a message to info at phpclasses dot org.