Featured Products
- Home
- PHP Scripts
- PHP User Roles Manager
PHP User Roles Manager
By : makemakecode Published on Thursday, August 04, 2016,22:03:22 in PHP Scripts
The User Roles Manager PHP Application
The application performs users and roles management and helps to support Single Sign On (SSO) concept for your PHP applications without the need to create user management application again and again for each new web site. Also, you can use the same application and database with different domains using different configuration which can be linked to specific domainForums
Documents
FAQ
Demo Web Sites
The package contains three web applications: User Roles Manager and two example web sites which demonstarte how to use it. Just drop content of User Roles Manager folder to your Apache web site, run it in broswer and use installation wizard to set up all parameters.user: admin@demo.com
pass: admin
Cross domain authentication
1. Add domain on domains management page2. Add user which will be used for server to server API call
3. Create API token for that user
3. Include security.php file to your project from UserRolesManager.Example.Client.Simple
5. Copy and paste user email and token (which you created) to security.php
define('APP_API_AUTHENTICATION', true); // <- true define('APP_API_ENDPOINT', 'https://userappdomain/api'); define('APP_API_USER', 'your api user'); define('APP_API_TOKEN', 'you user API token');and do not forget to set your user management app URL:
define('APP_USER_MANAGEMENT_URL', URL_PROTOCOL.'userappdomain');6. Add the following code at the begining of you page
<?php require 'security.php'; sign_in_required(); ?>After that if user is not authenticated he or she will be redirect to user manager login page. After authentication process the user will be redirected back to your site page.
The steps above you can use for all of your sites without development of authentication application each time you need, so you will have users and roles central repository.
The security.php file contains function to get user roles, so you can restrict content visibility by those roles.
Changelog
v1.0.1 - August 15, 2016 - Twitter bootstrap & schemes update to 3.3.7 - Sub directory installation (Multiple installation in a subdirectory) - Cross domain authentication simple implementation User Roles Manager App: 1. You need to create a user. 2. Click on Edit User ->API tab click on Generate API Token & Secret Key Advance Example: 1. Open \application\modules\Configuration\Config.php 2. Copy and paste user email and token: define('APP_API_AUTHENTICATION', true); // <- true: define('APP_API_ENDPOINT', 'https://userappdomain/api'); define('APP_API_USER', 'user email'); define('APP_API_TOKEN', 'token'); Simple Example: 1. Open security.php file 2. Copy and paste user email and token: define('APP_API_AUTHENTICATION', true); // <- true define('APP_API_ENDPOINT', 'https://https://userappdomain/api'); define('APP_API_USER', 'user email'); define('APP_API_TOKEN', 'token'); v1.0.0 - August 4, 2016 - Initial release