2017 © Pedro Peláez
 

library users-management

The most powerful and the simplest library to add a customizable users management system

image

thecsea/users-management

The most powerful and the simplest library to add a customizable users management system

  • Monday, October 5, 2015
  • by carduz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

users-management

Build status: Build Status Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

The most powerful and the simplest library to add a customizable users management system, (*2)

  • Password stored with hash (MD5)
  • Object oriented: every user is an object
  • Very simply, only two object: User (single user) and UsersManagement (environment)
  • Integrated with mysqltcs
  • Use an already established database connection (mysqltcs connection)
  • ApiKey support
  • Enabled user support
  • Salt support (more security)
  • Expendable

Download

Get/update composer

This library require composer (download composer here https://getcomposer.org/), (*3)

Update composer, (*4)

php composer.phar self-update, (*5)

Download

Download via composer require (we suggest to create a dedicated directory for this), (*6)

php composer.phar require thecsea/users-management, (*7)

or insert library as dependency in your composer project, (*8)

thecsea/users-management": "1.0.*, (*9)

in the last case you have to install or update you project, (*10)

php composer.phar install, (*11)

or, (*12)

php composer.phar update, (*13)

N.B. If you don't have access to server terminal you can perform installation on your pc and upload all via ftp, (*14)

Update users-management

You can update users-management (according to version limit set in composer.json), (*15)

php composer.phar update, (*16)

Use

The examples are not implemented yet, although you can see how to use the library looking the tests, (*17)

Firt use

You have to import the sql structure tests/usersManagement.sql, (*18)

Simple example

<?php
require_once(__DIR__."/vendor/autoload.php"); //composer autoload
$db = require(__DIR__."/config.php"); //mysql connection data as array
use it\thecsea\mysqltcs\Mysqltcs;
use it\thecsea\users_management\UsersManagement;
use it\thecsea\users_management\User;
$connection = new Mysqltcs($db['host'],  $db['user'], $db['psw'], $db['db']); //myslqtcs connection
$usersManagement = new UsersManagement($connection, $db['tables']['users'], "salt"); //environment
$user = User::newUser($usersManagement, "t", "tt@hhh.it", "gggg"); //new user, already inserted in db
$user2 = User::getUserByLogin($usersManagement, "tt@hhh.it", "gggg"); //LOGIN get user checking password
$users = $usersManagement->getUsers(); //get list of users
print_r($users[0]->getUserInfo()); //print user info (associative matrix) 
?>

N.B. config.php is a file that contains the mysql connection data as array., (*19)

N.B. you have to include composer autoload to use the library, (*20)

How it works

This library is fully object oriented so you have tostring, equals (user), clone and so on, (*21)

Exception

This library use exception to show error, every method can throw two exception:, (*22)

  • UsersManagementException thrown on logic error (for example wrong password)
  • Mysqltcsexception thrown on mysql error (for example db permission problem)

Methods and documentation

The user contains other useful method, you can see how to use method looking the phpdoc, (*23)

Salt

This library has support to salt, for more security, you can specify it via construct or via setter, or you can ignore it and use the default salt "thecsea", (*24)

Extra features

This library include extra features like apiKey string and enabled flag for each user, you can use these information as you want, this class provide only the insert and update methods for these information, (*25)

N.B. this class create an unique apiKey for each user (default behavior), (*26)

Db access

You can obviously access to db, but we suggest to don't modify the structure., (*27)

Test

This library is tested, you can find tests under tests, coverage: Code Coverage, (*28)

Credits

  • Mysqltcs: php library to connect to a mysql database

By thecsea.it

The Versions

05/10 2015

dev-master

9999999-dev http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

05/10 2015

v1.1.2

1.1.2.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

04/10 2015

v1.1.1

1.1.1.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

30/09 2015

v1.1.0

1.1.0.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

28/09 2015

v1.0.4

1.0.4.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

28/09 2015

v1.0.3

1.0.3.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

27/09 2015

v1.0.2

1.0.2.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

27/09 2015

v1.0.1

1.0.1.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable

16/09 2015

v1.0.0

1.0.0.0 http://www.thecsea.it

The most powerful and the simplest library to add a customizable users management system

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

management simple users powerful customizable