百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

CodeIgniter-Aauth

> 安全
开源

用于 Codeigniter 2.x 和 3.x 的授权、身份验证和用户管理库,可轻松实现用户管理和权限操作

393 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 Codeigniter 2.x 和 3.x 的授权、身份验证和用户管理库,可轻松实现用户管理和权限操作


Aauth is a User Authorization Library for CodeIgniter 2.x and 3.x, which aims to make easy some essential jobs such as login, permissions and access operations. Despite its ease of use, it has also very advanced features like private messages, groupping, access management, and public access.

This is Quick Start page. You can also take a look at the detailed Documentation Wiki to learn about other great Features

Features


  • User Management and Operations (login, logout, register, verification via e-mail, forgotten password, user ban, login DDoS protection)
  • Group Operations (creating/deleting groups, membership management)
  • Admin and Public Group support (Public permissions)
  • Permission Management (creating/deleting permissions, allow/deny groups, public permissions, permission checking)
  • Group Permissions
  • User Permissions
  • User and System Variables
  • Login DDoS Protection
  • Private Messages (between users)
  • Error Messages and Validations
  • Langugage and config file support
  • Flexible implementation

What is new in Version 2


  • User Permissions
  • User and System Variables
  • Login DDoS Protection
  • Updated functions (check documentation for details)
  • Bugs fixes
  • TOTP (Time-based One-time Password)

Migration


  • If you are currently using Version 1, take a look at the v1 to v2 migration page..

Quick Start


Let's get started :) First, we will load the Aauth Library into the system

php
$this->load->library("Aauth");

That was easy!

Now let's create two new users, Frodo and Legolas.

php
$this->aauth->create_user('[email protected]','frodopass','FrodoBaggins');
$this->aauth->create_user('[email protected]','legolaspass','Legolas');

We now we have two users.

OK, now we can create two groups, hobbits and elves.

php
$this->aauth->create_group('hobbits');
$this->aauth->create_group('elves');

Now, let's create a user with power, Gandalf (for our example, let's assume he was given the id of 12).

php
$this->aauth->create_user('[email protected]', 'gandalfpass', 'GandalfTheGray');

OK, now we have two groups and three users.

Let's create two permissions walk_unseen and immortality

php
$this->aauth->create_perm('walk_unseen');
$this->aauth->create_perm('immortality');

Ok, now let's give accesses to our groups. The Hobbits seem to have ability to walk unseen, so we will assign that privilage to them. The Elves have imortality, so we will assign that privilage to them. We will assign access with allow_group() function.

php
$this->aauth->allow_group('hobbits','walk_unseen');
$this->aauth->allow_group('elves','immortality');
  
  
$this->aauth->allow_group('hobbits','immortality');

Wait a minute! Hobbits should not have immortality. We need to fix this, we can use deny_group() to remove the permission.

php
$this->aauth->deny_group('hobbits','immortality');

Gandalf can also live forever.

php
$this->aauth->allow_user(12,'immortality');

Ok now let's check if Hobbits have immortality.

php
if($this->aauth->is_group_allowed('hobbits','immortality')){
	echo "Hobbits are immortal";
} else {
	echo "Hobbits are NOT immortal";
}

Results:

Hobbits are NOT immortal

Does Gandalf have the ability to live forever?

php
if($this->aauth->is_allowed(12,'immortality')){
	echo "Gandalf is immortal";
} else {
	echo "Gandalf is NOT immortal";
}

Results:

Gandalf is immortal

Since we don't accually live in Middle Earth, we are not aware of actual immortality. Alas, we must delete the permission.

php
$this->aauth->delete_perm('immortality');

It is gone.

Un-authenticated Users

So, how about un-authenticated users? In Aauth they are part of the public group. Let's give them permissions to travel. We will assume we already have a permission set up named travel.

php
$this->aauth->allow_group('public','travel');

Admin Users

What about the Admin users? The Admin user and any member of the Admin group is a superuser who had access everthing, There is no need to grant additional permissions.

User Parameters/Variables

For each user, variables can be defined as individual key/value pairs.

php
$this->aauth->set_user_var("key","value");

For example, if you want to store a user's phone number.

php
$this->aauth->set_user_var("phone","1-507-555-1234");

To retreive value you will use get_user_var():

php
$this->aauth->get_user_var("key");

Aauth also permits you to define System Variables. These can be which can be accesed by all users in the system.

php
$this->aauth->set_system_var("key","value");
$this->aauth->get_system_var("key");

Private Messages

OK, let's look at private messages. Frodo (id = 3) will send a PM to Legolas (id = 4);

php
$this->aauth->send_pm(3,4,'New cloaks','These new cloaks are fantastic!')

Banning users

Frodo has broke the rules and will now need to be banned from the system.

php
$this->aauth->ban_user(3);

You have reached the end of the Quick Start Guide, but please take a look at the detailed Documentation Wiki for additional information.

Don't forget to keep and eye on Aauth, we are constantly improving the system. You can also contribute and help me out. :)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPaauthauthenticationcodeignitercodeigniter-aauth

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类安全
定价开源

> 相关工具

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.