You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
5.4 KiB

{"name":"Codeigniter-aauth","tagline":"Authorization, authentication and User Management library for Codeigniter 2.x to make easy user management and permission operations","body":"***\r\nAauth is a User Authorization Library for CodeIgniter 2.x, which aims to make easy some essential jobs such as login, permissions and access operations. Despite ease of use, it has also very advanced features like private messages, groupping, access management, public access etc..\r\n\r\nAfter Quick Start, Take a look [detailed Documentation from wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages) \r\n\r\n### Features \r\n***\r\n* User Management and Operations (login, logout, register, vertification via e-mail, forgoten password, ban management, login ddos protection)\r\n* Group Operations (Creaing, deleting groups, membership management)\r\n* Admin and Public Group support (Public permissions)\r\nPermission Management (creating,deleting permissons, allow, deny groups, public permissions, permission checking)\r\n* Group Permissions \r\n* User Permissions (new)\r\n* User and System Variables (new)\r\n* Login Ddos Protection (new)\r\n* Private Messages (pm between users)\r\n* Error Mesages and Validations\r\n* Langugage and config file support\r\n* Flexible\r\n\r\n### What is new in Version 2\r\n***\r\n* User Permissions\r\n* User and System Variables\r\n* Login Ddos Protection\r\n* Some functions has changed\r\n* Some bugs fixed\r\n\r\n### Migration\r\n***\r\n* if you have been using Version 1 before, take a look at Migration Page\r\n\r\n### Quick Start \r\n***\r\nLet's start :) \r\nFirstly we will load Aauth Library to system\r\n```php\r\n$this->load->library(\"Aauth\");\r\n```\r\n \r\nthats OK. \r\n\r\nNow we will create 2 new users, Ali and John \r\n\r\n```php\r\n$this->aauth->create_user('ali@ali.com','alispass','Ali Akay');\r\n$this->aauth->create_user('john@john.com','johnspass','John Button');\r\n```\r\n \r\nthats it. now we have two users.\r\n\r\nLets Create two group governors and commons :)\r\n```php\r\n$this->aauth->create_group('governors');\r\n$this->aauth->create_group('commons');\r\n``` \r\n\r\nThen, Lets Create a User with power whic is Obama (having id=12)\r\n```php\r\n$this->aauth->create_user('obama@usa.gov', 'pass-cia-fbi', 'Barrack Obama');\r\n``` \r\n\r\nok now we have two groups and one user.\r\n\r\nLets create a permissions 'incrase_tax' and 'change_government' \r\n\r\n```php\r\n$this->aauth->create_perm('increase_tax');\r\n$this->aauth->create_perm('change_government');\r\n``` \r\n\r\nOk, now lets give accesses. logically 'governors' will have 'increase_tax' permission and 'commons' will have 'change_government' access. \r\nok lets give proper access with _alow_group()_ function\r\n\r\n```php\r\n$this->aauth->allow_group('governors','increase_tax');\r\n$this->aauth->allow_group('commons','change_government');\r\n \r\n \r\n$this->aauth->allow_group('commons','increase_tax');\r\n``` \r\n\r\nOps wait a minute. commons cannot 'increase_tax'. we need to fix it, we will use deny() to take back permission.\r\n\r\n```php\r\n$this->aauth->deny('commons','increase_tax');\r\n``` \r\n\r\nObama also can increse tax ha?\r\n\r\n```php\r\n$this->aauth->allow_user(12,'increase_tax');\r\n``` \r\n\r\n\r\nOk now lets check if commons can 'increase_tax'\r\n\r\n```php\r\nif($this->aauth->is_group_allowed('commons','increase_tax')){\r\n // i dont think so\r\n} else {\r\n // do sth in the middle\r\n}\r\n``` \r\n\r\nCan Obama increase_tax ? Let's check it.\r\n\r\n```php\r\nif($this->aauth->is_allowed(15,'increase_tax')){\r\n // i guess so\r\n} else {\r\n // piece of code\r\n}\r\n``` \r\n\r\n\r\ni think 'increse_tax' must have never been created. just delete it\r\n\r\n```php\r\n$this->aauth->delete_perm('increase_tax');\r\n``` \r\nnow better. \r\n \r\nSo what about public people? (public means not logged users). Can public people travel? Lets assume we have permissions namely 'travel' , of course.\r\n\r\n```php\r\n$this->aauth->allow_group('public','travel');\r\n``` \r\n \r\nSo Admin? what can he