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.
7 lines
6.4 KiB
7 lines
6.4 KiB
{ |
|
"name": "Codeigniter Aauth", |
|
"tagline": "Authorization, authentication and User Management library for Codeigniter 2.x and 3.x to make easy user management and permission operations", |
|
"body": "<p align=\"center\">\r\n<img src=\"https://cloud.githubusercontent.com/assets/2417212/8925689/add409ea-34be-11e5-8e50-845da8f5b1b0.png\" height=\"320\">\r\n</p>\r\n\r\n***\r\nAauth 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.\r\n\r\n**This is Quick Start page. You can also take a look at the [detailed Documentation Wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages) to learn about other great Features**\r\n\r\n### Features \r\n***\r\n* User Management and Operations (login, logout, register, verification via e-mail, forgotten password, user ban, login DDoS protection)\r\n* Group Operations (creating/deleting groups, membership management)\r\n* Admin and Public Group support (Public permissions)\r\n* Permission Management (creating/deleting permissions, allow/deny groups, public permissions, permission checking)\r\n* Group Permissions\r\n* User Permissions\r\n* User and System Variables\r\n* Login DDoS Protection\r\n* Private Messages (between users)\r\n* Error Messages and Validations\r\n* Langugage and config file support\r\n* Flexible implementation\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* Updated functions (check documentation for details)\r\n* Bugs fixes\r\n* TOTP (Time-based One-time Password)\r\n\r\n### Migration\r\n***\r\n* If you are currently using Version 1, take a look at the [v1 to v2 migration page.](https://github.com/emreakay/CodeIgniter-Aauth/wiki/1%29-Migration-from-V1).\r\n\r\n### Quick Start \r\n***\r\nLet's get started :)\r\nFirst, we will load the Aauth Library into the system\r\n```php\r\n$this->load->library(\"Aauth\");\r\n```\r\n\r\nThat was easy!\r\n\r\nNow let's create two new users, `Frodo` and `Legolas`.\r\n\r\n```php\r\n$this->aauth->create_user('[email protected]','frodopass','Frodo Baggins');\r\n$this->aauth->create_user('[email protected]','legolaspass','Legolas');\r\n```\r\n \r\nWe now we have two users.\r\n\r\nOK, now we can create two groups, `hobbits` and `elves`.\r\n```php\r\n$this->aauth->create_group('hobbits');\r\n$this->aauth->create_group('elves');\r\n``` \r\n\r\nNow, let's create a user with power, Gandalf (for our example, let's assume he was given the `id` of 12).\r\n```php\r\n$this->aauth->create_user('[email protected]', 'gandalfpass', 'Gandalf the Gray');\r\n``` \r\n\r\nOK, now we have two groups and three users.\r\n\r\nLet's create two permissions `walk_unseen` and `immortality` \r\n\r\n```php\r\n$this->aauth->create_perm('walk_unseen');\r\n$this->aauth->create_perm('immortality');\r\n``` \r\n\r\nOk, 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.\r\nWe will assign access with `allow_group()` function.\r\n\r\n```php\r\n$this->aauth->allow_group('hobbits','walk_unseen');\r\n$this->aauth->allow_group('elves','immortality');\r\n \r\n \r\n$this->aauth->allow_group('hobbits','immortality');\r\n``` \r\n\r\nWait a minute! Hobbits should not have `immortality`. We need to fix this, we can use `deny()` to remove the permission.\r\n\r\n```php\r\n$this->aauth->deny('hobbits','immortality');\r\n``` \r\n\r\nGandalf can also live forever.\r\n\r\n```php\r\n$this->aauth->allow_user(12,'immortality');\r\n``` \r\n\r\nOk now let's check if Hobbits have `immortality`.\r\n\r\n```php\r\nif($this->aauth->is_group_allowed('hobbits','immortality')){\r\n\techo \"Hobbits are immortal\";\r\n} else {\r\n\techo \"Hobbits are NOT immortal\";\r\n}\r\n```\r\nResults:\r\n```\r\nHobbits are NOT immortal\r\n```\r\n\r\nDoes Gandalf have the ability to live forever?\r\n\r\n```php\r\nif($this->aauth->is_allowed(12,'immortality')){\r\n\techo \"Gandalf is immortal\";\r\n} else {\r\n\techo \"Gandalf is NOT immortal\";\r\n}\r\n``` \r\nResults:\r\n```\r\nGandalf is immortal\r\n```\r\n\r\nSince we don't accually live in Middle Earth, we are not aware of actual immortality. Alas, we must delete the permission.\r\n\r\n```php\r\n$this->aauth->delete_perm('immortality');\r\n``` \r\nIt is gone.\r\n\r\n#### Un-authenticated Users\r\n\r\nSo, how about un-authenticated users? In Aauth they are part of the `public` group. Let's give them permissions to `travel`.\r\nWe will assume we already have a permission set up named `travel`.\r\n\r\n```php\r\n$this->aauth->allow_group('public','travel');\r\n``` \r\n\r\n#### Admin Users\r\nWhat 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.\r\n \r\n#### User Parameters/Variables\r\nFor each user, variables can be defined as individual key/value pairs.\r\n\r\n```php\r\n$this->aauth->set_user_var(\"key\",\"value\");\r\n``` \r\n\r\nFor example, if you want to store a user's phone number.\r\n```php\r\n$this->aauth->set_user_var(\"phone\",\"1-507-555-1234\");\r\n``` \r\n\r\nTo retreive value you will use `get_user_var()`:\r\n```php\r\n$this->aauth->get_user_var(\"key\");\r\n``` \r\n\r\nAauth also permits you to define System Variables. These can be which can be accesed by all users in the system.\r\n```php\r\n$this->aauth->set_system_var(\"key\",\"value\");\r\n$this->aauth->get_system_var(\"key\");\r\n``` \r\n\r\n#### Private Messages\r\nOK, let's look at private messages. Frodo (`id` = 3) will send a PM to Legolas (`id` = 4);\r\n\r\n```php\r\n$this->aauth->send_pm(3,4,'New cloaks','These new cloaks are fantastic!')\r\n``` \r\n\r\n#### Banning users\r\n\r\nFrodo has broke the rules and will now need to be banned from the system.\r\n```php\r\n$this->aauth->ban_user(3);\r\n``` \r\n\r\nYou have reached the end of the Quick Start Guide, but please take a look at the [detailed Documentation Wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages) for additional information.\r\n\r\n\r\nDon't forget to keep and eye on Aauth, we are constantly improving the system.\r\nYou can also contribute and help me out. :)\r\n", |
|
"google": "", |
|
"note": "Don't delete this file! It's used internally to help with page regeneration." |
|
} |