{"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 do? He can access everthing, You dont need to give permiision ( using allow_group() or allow_user() ) him, he already has. \r\n \r\nWhat about User Variables?\r\nfor every individual user, variables can be defined as key-value.\r\n\r\nthis is a simple example to set a variable.\r\n```php\r\n$this->aauth->set_user_var(\"key\",\"value\");\r\n``` \r\n\r\nFor example if you want to keep users phones\r\n```php\r\n$this->aauth->set_user_var(\"phone\",\"0216 313 23 33\");\r\n``` \r\n\r\nto get the variable\r\n```php\r\n$this->aauth->set_user_var(\"key\");\r\n``` \r\n\r\nAauth also permits you to define System Variables which can be accesed by every user in the system.\r\n```php\r\n$this->aauth->set_system_var(\"key\",\"Value\");\r\n$this->aauth->set_system_var(\"key\");\r\n``` \r\n\r\nok lets look at private messages. John (his id=3) will send pm to Ali(id=4)\r\n\r\n```php\r\n$this->aauth->send_pm(3,4,'Hi bro. i need you',' can you gimme your credit card?')\r\n``` \r\n \r\nsorry John you will be banned :(\r\n\r\n```php\r\n$this->aauth->ban_user(3);\r\n``` \r\n \r\nQuick Start is done but thats not the end \r\nTake a look [detailed Documentation from wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages) \r\n\r\nDont forget to watch Aauth. \r\nYou can also contribute and help me :)\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}