2017 © Pedro PelĂĄez
 

library user

An user module for the Anax framework.

image

oenstrom/user

An user module for the Anax framework.

  • Tuesday, October 24, 2017
  • by oenstrom
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Anax user

Build Status CircleCI Build Status Scrutinizer Code Quality Code Coverage, (*1)

Anax user module implementing user and admin functionality., (*2)

Install

Install the module with composer and then integrate the module with your Anax installation., (*3)

Install with composer

composer require oenstrom/user

Automatic configuration

You can automatically configurate most of the module using the makefile. The makefile is located in vendor/oenstrom/user/, make sure you are in that directory before running the make command., (*4)

# cd vendor/oenstrom/user
make install-module

Manual configuration

If you want to manually copy the files you can do so from the root directory of your Anax installation with the following commands., (*5)

rsync -a vendor/oenstrom/user/config/di/* config/di/
rsync -a vendor/oenstrom/user/config/route/* config/route/
rsync -a vendor/oenstrom/user/config/database.php config/
rsync -a vendor/oenstrom/user/view/user view/

Setup database

Execute the SQL-file sql/setup.sql to create a new database called anaxuser and a new table with two users: admin:admin and doe:doe If you already have a database, just edit the SQL-file or use the SQL code below., (*6)

CREATE TABLE User (
    `id`        INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
    `role`      VARCHAR(20) NOT NULL DEFAULT 'user',
    `username`  VARCHAR(80) UNIQUE NOT NULL,
    `email`     VARCHAR(255) UNIQUE NOT NULL,
    `password`  VARCHAR(255) NOT NULL,
    `created`   TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `deleted`   DATETIME
) ENGINE INNODB CHARACTER SET utf8 COLLATE utf8_swedish_ci;

INSERT INTO User(role, username, email, password) VALUES
('admin', 'admin', 'admin@admin.com', '$2y$10$Njbsb6l8TCLdvHUcS/65IOcEVARQGICBYqDqx8843aPgpVdlYedrC'),
('user', 'doe', 'user@user.com', '$2y$10$26KgRWjs3F654.yHpsYYDO4sd86ksNN1E8zpQ2yHMA/yx33tV/ACq');

Now update the file config/database.php with settings and credentials for your SQL server., (*7)

Test it

When all of the above is done you can test it with the following routes., (*8)

user/register               Register a new account
user/login                  Login with your account
user/logout                 Logout from your account

# Protected from unauthenticated users
user/profile                Display the user profile

# Protected from unauthorized users
user/admin/users            Display all users
user/admin/users/add        Create a new user
user/admin/update/:id       Update an user with the provided id
user/admin/delete/:id       Delete an user with the provided id

License

This software carries a MIT license., (*9)


Copyright (c) 2017 Olof Enström (olof.enstrom@gmail.com)

The Versions

24/10 2017

dev-master

9999999-dev https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

24/10 2017

1.0.6

1.0.6.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

23/10 2017

1.0.5

1.0.5.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

08/10 2017

1.0.4

1.0.4.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

08/10 2017

1.0.3

1.0.3.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

30/09 2017

1.0.2

1.0.2.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

30/09 2017

1.0.1

1.0.1.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education

29/09 2017

1.0.0

1.0.0.0 https://github.com/oenstrom/anax-user/

An user module for the Anax framework.

  Sources   Download

MIT

The Requires

 

by Olof Enström

micro framework user mvc education