PHP Classes
elePHPant
Icontem

Secure PHP Login System: Register and login users using a database via PDO

Recommend this page to a friend!
  Info   Demos   View files View files (32)   DownloadInstall with Composer Download .zip   Reputation   Support forum (7)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-12-02 (3 days ago) RSS 2.0 feedStarStarStar 49%Total: 3,578 This week: 113All time: 911 This week: 5Up
Version License PHP version Categories
secure-login-system 0.6.10Custom (specified...5.5PHP 5, Databases, User Management
Description Author

This class can register and login users using a database via PDO.

It can process the registration of a user given the user name, password, name and email address.

It can also authenticate a user given the user name and password and optionally set a cookie to remember the user name on the next login.

The class starts a session for successfully authenticated users.

It can also log out by ending the user session, send a password reminder message and change the user password.

It also implements a two step login process similar to that of Google's, Facebook's SMS security process.

The user can see they devices they used to log in as well as log out from a device used before.

The class also provides an administration interface to manage users, edit details, see statistics, etc..

Recommendations

What is the best PHP session wrapper class?
I need PHP session class along with user management

I need a PHP class for professional login system
Create a professional login system

What is the best PHP mysql login class?
MySQL login script

user login script
package to create, update user login logout

Looking for a Registration-login system
Along with Social registration with latest APIs if any!

What is the best PHP login limit attempts class?
Limit attempts of login

Secure user management
Need a secure user login management

simple user and password login
User name and password login

  Performance   Level  
Name: Subin Siby is available for providing paid consulting. Contact Subin Siby .
Classes: 4 packages by
Country: India India
Age: 16
All time rank: 70837 in India India
Week rank: 7 Up2 in India India Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Details
logSys
======

PHP Advanced Login System as part of the [Francium Project](http://subinsb.com/the-francium-project)

See this [Blog Post](http://subinsb.com/php-logsys) for more details

Features
========

logSys includes but not limited to :

* Basic Login/Register
* Secure - Uses PDO, Bcrypt & Protection against CSRF
* Password Reset (Forgot Password) functionality
* 2 Step Login (2 Step Verification by Mobile SMS/E-Mail)
* Email Functionality
* Add & use custom user data
* **[Admin Panel](http://subinsb.com/logsys-admin)**
* Device Manager to know the devices that are currently logged in
* Debugging/Logging made simpler
* Simple Examples to get you started
* Lightweight (**42 KB of Awesomeness...**)
* A very active project

Installation
============

Simply download [`LS.php`](https://github.com/subins2000/logSys/blob/master/src/LS.php) file and include it in PHP :

```php
<?php
require_once "LS.php";
```

or use [Composer](http://getcomposer.org) :

```bash
composer require francium/logsys
```

Instructions
============

The **[Blog Post](http://subinsb.com/php-logsys)** contains the entire information on how to install and use logSys.

In case of GitHub repo, the following folders contain examples of usage
* example-basic
* example-two-step-login

PHP's mail() function is used to send emails. Most likely, emails sent through it will reach the SPAM folder. To avoid this, add an email function in `config` -> `basic` -> `email_callback`.

I recommend to use [PHPMailer](https://github.com/PHPMailer/PHPMailer/) (SMTP) or [Mailgun API](https://mailgun.com) to send emails.

Versions
========

## 0.6

**Requires PHP 5.5** - If you want to use it in an older PHP version, get the **password.php** file from [here](https://github.com/ircmaxell/password_compat/blob/master/lib/password.php) and include it before loading `LS.php` file.

This version changes the algorithm used to hash passwords. If you're using an old version of logSys, you **cannoot** upgrade without resetting the existing passwords in your database.

### Upgrade

* (For upgrading from old versions) Remove all existing values in `password` column in your table
* Remove `password_salt` column from your users' table and set the length of the `password` column to `255`.
* Update "LS.php" file. If it's class.logsys.php, rename it to LS.php

Testing
=======

Run `phpunit`.

## Config

Edit `phpunit.xml` and change `DB_TYPE` value to either `mysql` or `sqlite` :

```xml
<var name="DB_TYPE" value="sqlite" />
```
  logSys DemoExternal page  

Open in a separate window

  Files folder image Files  
File Role Description
Files folder imageexamples (2 directories)
Files folder imagesql (2 files)
Files folder imagesrc (3 files)
Files folder imagetests (3 files)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data composer file
Accessible without login Plain text file LICENSE Lic. GPL License
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Data A Readme

  Files folder image Files  /  examples  
File Role Description
Files folder imagebasic (9 files)
Files folder imagetwo-step-login (10 files)

  Files folder image Files  /  examples  /  basic  
File Role Description
  Accessible without login Plain text file change.php Aux. Auxiliary script
  Accessible without login Plain text file config.php Aux. Auxiliary script
  Accessible without login Plain text file home.php Aux. Auxiliary script
  Accessible without login Plain text file index.php Aux. Auxiliary script
  Accessible without login Plain text file login.php Aux. Auxiliary script
  Accessible without login Plain text file logout.php Aux. Auxiliary script
  Accessible without login Plain text file register.php Aux. Auxiliary script
  Accessible without login Plain text file reset.php Aux. Auxiliary script
  Accessible without login Plain text file status.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  two-step-login  
File Role Description
  Accessible without login Plain text file change.php Aux. Auxiliary script
  Accessible without login Plain text file config.php Aux. Auxiliary script
  Accessible without login Plain text file home.php Aux. Auxiliary script
  Accessible without login Plain text file index.php Aux. Auxiliary script
  Accessible without login Plain text file login.php Aux. Auxiliary script
  Accessible without login Plain text file logout.php Aux. Auxiliary script
  Accessible without login Plain text file manage-devices.php Aux. Auxiliary script
  Accessible without login Plain text file register.php Aux. Auxiliary script
  Accessible without login Plain text file reset.php Aux. Auxiliary script
  Accessible without login Plain text file status.php Aux. Auxiliary script

  Files folder image Files  /  sql  
File Role Description
  Accessible without login Plain text file mysql.sql Data Auxiliary data
  Accessible without login Plain text file sqlite.sql Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file class.logsys.php Class Class source
  Plain text file LS.php Class Class source
  Accessible without login Plain text file table.sql Data Auxiliary data

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file TestDBSetup.php Class Class source
  Plain text file TestUserBasic.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:3,578
This week:113
All time:911
This week:5Up
User Ratings User Comments (3)
 All time
Utility:83%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:-
Examples:-
Tests:-
Videos:-
Overall:49%StarStarStar
Rank:2134