Skip to content

nickuc-com/nLogin-Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Usage:

  1. Instantiating the nLogin class
  2. Verifying the Password
  3. Registering a Player
  4. Changing the Password.

Instantiation

require 'nLogin.php';

// Creates an instance
$nlogin = new nLogin("localhost", "root", "", "nlogin", false);

Verifying the Password

require 'nLogin.php';

// Creates an instance
$nlogin = new nLogin("localhost", "root", "", "nlogin", false);

// Fetches the user identifier (search, mode)
$user_id = $nlogin->fetch_user_id("Player", nLogin::FETCH_WITH_LAST_NAME);

// Verifies the password
$is_valid = $nlogin->verify_password($user_id, "password123");

Registering a Player

require 'nLogin.php';

// Creates an instance
$nlogin = new nLogin("localhost", "root", "", "nlogin", false);

// Fetches the user identifier (search, mode)
$user_id = $nlogin->fetch_user_id("Player", nLogin::FETCH_WITH_LAST_NAME);

// Registers a player (username, plain password, e-mail, unique id (optional), mojang id (optional), bedrock id (optional))
$success = $nlogin->register($user_id, "password123", '[email protected]', null, null, null);

Changing the Password

require 'nLogin.php';

// Creates an instance
$nlogin = new nLogin("localhost", "root", "", "nlogin", false);

// Fetches the user identifier (search, mode)
$user_id = $nlogin->fetch_user_id("Player", nLogin::FETCH_WITH_LAST_NAME);

// Changes the password (user identifier, new plain password)
$success = $nlogin->change_password($user_id, "newpassword123");

License

This code or part of it was taken from the AuthMe project, licensed under the GNU General Public License v3.0 (https://github.com/AuthMe/AuthMeReloaded/blob/master/LICENSE)

For more details, access the original source code:
https://github.com/AuthMe/AuthMeReloaded/tree/master/samples/website_integration

Node.js

If you use Node.js, take a look at the work done by tiagodinis33: https://gitlab.com/tiagodinis33/nlogin-js

About

Synchronize nLogin accounts on your website!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages