Download the PHP package crecket/advanced-login-script without Composer

On this page you can find all versions of the php package crecket/advanced-login-script. 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 advanced-login-script

advanced-login-script

License

Introduction

Advanced-login-script features a bunch of basic and more advanced options to manage your users.

Features

  1. Login/Registration
  2. Usergroups and session control
  3. SMTP mails over ssl
  4. QRCode login
  5. Config file to manage settings

Requirements

  1. Php version >= 5.5
  2. PHPMailer
  3. crecket/secure-functions
  4. doctrine/dbal
  5. endroid/qrcode
  6. firebase/php-jwt

Installation

Composer

  1. Require the repo
  2. Copy the config file from /vendor/crecket/advanced-login-script/src/configfiles/config.php and place it somewhere else. (If you don't do this, updating this plugin with composer will reset your config!
  3. Call the class and add config location in the first parameter
Config setup

For both composer and manual installation you have to setup the config file. Make sure to update your secret key and to change any settings. This can be done manually by editing the config file or the setConfig function. For a example view setup_file.php in the demo folder. Once you've created a new key make sure it stays the same or all old cookies will become invalid.

For the activation link and resetpassword link {code} will get replaced with the appropriate reset code If you want to use a clean URL simply change it to something like this:

http://localhost.dev/forgot_password/{code}

or a normal URL could be something like this:

http://localhost.dev/forgot_password.php?code={code}

Notifications

If you wish to disable or change a notification you can do so by editing the loginScriptTranslations.php file. If you wish to disable the message all together and handle the message systme yourself, simply remove the message.

Database setup

Run the sql file includded with the project files function. In total, 5 tables will be created

Examples

Log in a user through login form

Verify if user is logged in

Register a new user

Secure a form with a token

In this example somedata has to be updated for user '59348534'. In order to secure this, you add the id to the token generator. After that you add both the token and the id to a hidden form.

If the id is different when the post request is received, the formtoken will block it.

Logout the current user

QR login

In order to understand this have a look at the demo files.

If the user is logged in on a phone, they can scan the QR code. Once you open the page, the token that is added to the link will activate the session for the user on the PC. The example is still very basic so you should be careful with how you use this.

Creating a QR code is simple:

All QR codes are valid for 30 seconds

Verify a QR code

Now in order to login you will need to trigger the checkLoggedIn() function

JWT token verification

This library now has JWT support so you can verify users without sending credentials.

On login, a JWT token will be stored in both a session and a cookie.

In order to refresh the current user JWT token. This shouldn't be neccesary but it is possible

Now you can use the token in your client-side applications.

Todo

  1. Travis testing
  2. User meta data
  3. Replace normal queries with querybuilder
  4. Better QR example (Using ajax?)
  5. Configurable default values (E.G. Default usergroup)

License

WTFPL: Do whatever you want with this repo


All versions of advanced-login-script with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
phpmailer/phpmailer Version ^5.2
crecket/secure-functions Version ^1.0
doctrine/dbal Version ^2.5
endroid/qrcode Version ^1.5
firebase/php-jwt Version ^3.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 crecket/advanced-login-script contains the following files

Loading the files please wait ....