Advanced Security - PHP Register/Login System

Advanced Security - PHP Register/Login System

20 Articles / Last Updated: April 27, 2018

Installaton

In order to use the application, you will have to install it on your server. Installation is painless process that will set up everything you need (from database tables to configuration files) to use the application. Se...

Configuration

This section contains some important configuration options that are specific to Advanced Security application. All configuration options are stored inside ASEngine\ASConfig.php file, which is created after successful ins...

Social Authentication

Before you enable social configuration, make sure that your SOCIAL_CALLBACK_URI is properly defined inside ASConfig.php file. It should point to socialauth_callback.php file on your server. So, if you have AS installed i...

Localization

AS application allows you to easily translate the whole interface to any language you want. All locales are simple .php files located inside Lang folder. Available Locales Out of the box, there are 7 different locales t...

Upgrade Guide

To 2.4 from 2.3 This version contains few bug fixes from previous release. Here is what you wound need to do: Overwrite your vendor folder with latest one. In case you modified something inside the vendor folder, just c...

Authentication and Registration

Logging In When you try to access any protected file (file that requires authentication) you will automatically be redirected to login page. From there, you are able to login using your username and password. Login form:...

The Home Page

Posting Comments Posting comments is actually a demonstration how Advanced Security System can be used in some real-world situations. If your user role is set to user (this is the default value when a new user successful...

User's Profile

Updating The Profile You can navigate to profile page by clicking My Profile from sidebar navigation menu or from the drop-down menu from top-right corner. The profile page is displayed below: From profile page, users ...

User Management

If you are logged in as Administrator, you are available to manage registered website users. To do this, go to Users page. There is 3 type of users (3 different user roles) by default: Admin Editor User For every user di...

System Roles

In order to manage user roles, just open User Roles page by selecting it from sidebar navigation menu. Create New Role To add new role, simply enter new role name and click Add. New role will be automatically added. It'...

Developer Guide

This short guide will help you to continue developing your system based on AS or to figure out what is wrong if something doesn't work as expected on your server. Debug Mode By default, system is configured to not displ...

Dependency Injection Container

What is DI Container? A dependency injection (DI) container can be defined as an object that knows how to instantiate and configure objects and all their dependent objects. Lets take a look into an example to better unde...

Protect Your Pages

If you already have some PHP pages that you want to protect, or you are using AS as a base and adding new pages to it, you will probably want to protect those files and allow access to authenticated users only. To do so,...

CSRF Protection and Forms

If you want to add new forms and extend the application, you need to make sure that you send the CSRF token whenever a form is submitted. To learn more about CSRF protection check this article. AJAX Forms If you are usin...

Working with Session

ASSession Class By including ASEngine/AS.php file into some of your own files, your session will be automatically started. However, if you want to do it by your self, you need to call startSession() method from ASSession...

Currently Authenticated User

After the user is successfully authenticated, his unique ID is stored inside the session and it can be easily obtained like following: This ID can be used anywhere inside the application where we need to get the id for ...

Managing User Details

Get Info You can get the basic user info (data from as_users db table) like following: $info will be an array containing following information: Note app('user') will just resolve the instance of ASUser class for you (...

Authorization

Every AS user has a role assigned to his account. We are able to get that role and determine should we display some content to that user, or perform some action. User's Role As it was already mentioned inside current us...

Database Queries

Advanced Security comes with a simple database abstraction class that you can use to communicate with the database. ASdatabase class extends native PDO class, you can use any PDO function you want. You can learn more abo...

Working with Comments

If you want to work with ASComments class, first you need to create new object of that class. Although you can do it manually, it's recommended to just resolve it out of the container with all it's dependencies: Adding...