Download the PHP package dsijak/authman without Composer

On this page you can find all versions of the php package dsijak/authman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package authman

AUTHMAN

PHP authorization module.

Easy drag-and-drop-and-use authorisation module.

Features

Install

    composer require dsijak/authman

On install new Sqlite project.db file is created and new JWT server.key will be generated.

Usage

Make sure authman dir is set to read/write before usage.

    namespace Authman;
    $errorMessage;        
    $authman = new Authman();

    //register
    $registerSuccessful = $authman->register('[email protected]', '1234', $errorMessage);
    if (!$registerSuccessful)
    {
        //do something with error message.
        error_log($errorMessage);
    }

    //login
    $loginSuccessful = $authman->login('[email protected]', '1234', $errorMessage);
    if (!$loginSuccessful)
    {
        //do something with error message.
        error_log($errorMessage);
    }

    //get login details
    $authman->admin->debugHtml();

    //logout
    $authman->logout(); 

Config

To configure Authman edit '/conf/config.php'.

Options

Isn't there an bottleneck/limit for SQLite if site is too busy?

Sqlite should handle up to 100 connections at same time.
If you have more then 100 login/logouts at same time, use something else.

API

Methods return boolean and $message argument references fail/error message.

register($email, $password, &$message=null)
Register user with email and password.
Returns: boolean.

unregister($password, &$message=null)
Unregister. Set account 'active' column to 0.
Returns: boolean.

login($email, $password, &$message=null)
Login user with email and password.
Returns: boolean.

logout()
Logout user.
Returns: boolean.

getCsrf()
Returns csrf token.
Returns: string/null.

isCsrfValid($token)
Validates csrf token.
Returns: boolean.

getRole()
Returns logged on user role.
Returns: string/null.

setUserRole($role)
Changes logged on user role to string listed in DS_AM_USER_ROLES.
Returns: boolean.

isLoggedOn()
Returns boolean if user is logged on.
Returns: boolean.

refresh(&$message=null)
Check if session has expired.
Returns: boolean.

isRouteLinked()
Check if logged on user is linked with route. For example if user role
is 'admin' and route is '/admin', returns true.
Links are set in 'config.php' DS_AM_USER_ONLY_ROUTES and DS_AM_ADMIN_ONLY_ROUTES.
Returns: boolean.

changeRole($role)
Change logged on user role to 'banned', 'notVerified', 'user' or 'admin'.
Returns: boolean.

addExtraData($assoc, &$message=null)
Add extra data to current logged on user. for example: ['city'=>'Smalltown'] will add 'Smalltown' to 'city' column.
Returns: boolean.

verifyUser($confirmationCode, &$eMessage=null)
Verify user with confirmation code from verification email.
Returns: boolean.

isUserVerified()
Returns false if user have 'notVerified' role.
Returns: boolean.

sendConfirmationCodeEmail(&$eMessage=null)
Sends verification email with confirmation code.
Returns: boolean.

Licence

MIT

Have Fun


All versions of authman with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dsijak/authman contains the following files

Loading the files please wait ....