Browse Source

Merge pull request #37 from tswagger/master

Info and Errors (and other bug fixes)

----

    Added flashdata boolean to error() and info() allowing the option for errors/messages to only remain for current page.
    Added clear_errors() and clear_infos() which removes all errors and infos from Aauth storage as well as flashdata storage
    Loaded flashdata into errors and infos on construct in order to fully utilize flashdata (as a result, keep_errors() and keep_infos() now work properly)
    Added boolean return value to login_fast()
    Remove redundant indexes from Aauth_v2.sql
    Removed bool return value from get_errors_array() and get_infos_array(). As "array" is in the method name, should only return array. Change should remain backwards compatible as empty array will still evaluate to "false".
    Fix bug in which "is_allowed" returns true if user is logged in and has access to perm_id=1 and perm is non-existant.
    Modified list_user_var_keys() to return an array so that it can be looped through
    Fixed duplicate message when sending password reset email, line 424
    Modified lang-file constants to include prefix. This will help avoid collisions. Also added a few missing items to the lang-file
    Updated SQL file to be a bit more efficient.
    Modified keep_infos() and keep_errors() to include non-flash data values on optional boolean parameter.
develop v2.2.0
Emre Akay 10 years ago
parent
commit
e8d5b54d37
  1. 165
      README.md
  2. 9
      application/config/aauth.php
  3. 78
      application/language/english/aauth_lang.php
  4. 4072
      application/libraries/Aauth.php
  5. 92
      sql/Aauth_v2.sql
  6. 6
      sql/readme.txt

165
README.md

@ -1,172 +1,183 @@
*** ***
Aauth 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.. Aauth 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 its ease of use, it has also very advanced features like private messages, groupping, access management, and public access.
**This is Quick Start page. After Quick Start, Take a look [detailed Documentation from wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages) to learn other great Features** **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**
### Features ### Features
*** ***
* User Management and Operations (login, logout, register, vertification via e-mail, forgoten password, ban management, login ddos protection) * User Management and Operations (login, logout, register, verification via e-mail, forgotten password, user ban, login DDoS protection)
* Group Operations (Creaing, deleting groups, membership management) * Group Operations (creating/deleting groups, membership management)
* Admin and Public Group support (Public permissions) * Admin and Public Group support (Public permissions)
Permission Management (creating,deleting permissons, allow, deny groups, public permissions, permission checking) * Permission Management (creating/deleting permissions, allow/deny groups, public permissions, permission checking)
* Group Permissions * Group Permissions
* User Permissions (new) * User Permissions
* User and System Variables (new) * User and System Variables
* Login Ddos Protection (new) * Login DDoS Protection
* Private Messages (pm between users) * Private Messages (between users)
* Error Mesages and Validations * Error Messages and Validations
* Langugage and config file support * Langugage and config file support
* Flexible * Flexible implementation
### What is new in Version 2 ### What is new in Version 2
*** ***
* User Permissions * User Permissions
* User and System Variables * User and System Variables
* Login Ddos Protection * Login DDoS Protection
* Some functions has changed * Updated functions (check documentation for details)
* Some bugs fixed * Bugs fixes
### Migration ### Migration
*** ***
* if you have been using Version 1 before, take a look at [migration page from here.](https://github.com/emreakay/CodeIgniter-Aauth/wiki/1%29-Migration-from-V1). * 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).
### Quick Start ### Quick Start
*** ***
Let's start :) Let's get started :)
Firstly we will load Aauth Library to system First, we will load the Aauth Library into the system
```php ```php
$this->load->library("Aauth"); $this->load->library("Aauth");
``` ```
thats OK.
Now we will create 2 new users, Ali and John That was easy!
Now let's create two new users, `Frodo` and `Legolas`.
```php ```php
$this->aauth->create_user('ali@ali.com','alispass','Ali Akay'); $this->aauth->create_user('frodo@example.com','frodopass','Frodo Baggins');
$this->aauth->create_user('john@john.com','johnspass','John Button'); $this->aauth->create_user('legolas@example.com','legolaspass','Legolas');
``` ```
thats it. now we have two users. We now we have two users.
Lets Create two group governors and commons :) OK, now we can create two groups, `hobbits` and `elves`.
```php ```php
$this->aauth->create_group('governors'); $this->aauth->create_group('hobbits');
$this->aauth->create_group('commons'); $this->aauth->create_group('elves');
``` ```
Then, Lets Create a User with power whic is Obama (having id=12) Now, let's create a user with power, Gandalf (for our example, let's assume he was given the `id` of 12).
```php ```php
$this->aauth->create_user('obama@usa.gov', 'pass-cia-fbi', 'Barrack Obama'); $this->aauth->create_user('gandalf@example.com', 'gandalfpass', 'Gandalf the Gray');
``` ```
ok now we have two groups and one user. OK, now we have two groups and three users.
Lets create a permissions 'incrase_tax' and 'change_government' Let's create two permissions `walk_unseen` and `immortality`
```php ```php
$this->aauth->create_perm('increase_tax'); $this->aauth->create_perm('walk_unseen');
$this->aauth->create_perm('change_government'); $this->aauth->create_perm('immortality');
``` ```
Ok, now lets give accesses. logically 'governors' will have 'increase_tax' permission and 'commons' will have 'change_government' access. 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.
ok lets give proper access with _alow_group()_ function We will assign access with `allow_group()` function.
```php ```php
$this->aauth->allow_group('governors','increase_tax'); $this->aauth->allow_group('hobbits','walk_unseen');
$this->aauth->allow_group('commons','change_government'); $this->aauth->allow_group('elves','immortality');
$this->aauth->allow_group('commons','increase_tax'); $this->aauth->allow_group('hobbits','immortality');
``` ```
Ops wait a minute. commons cannot 'increase_tax'. we need to fix it, we will use deny() to take back permission. Wait a minute! Hobbits should not have `immortality`. We need to fix this, we can use `deny()` to remove the permission.
```php ```php
$this->aauth->deny('commons','increase_tax'); $this->aauth->deny('hobbits','immortality');
``` ```
Obama also can increse tax ha? Gandalf can also live forever.
```php ```php
$this->aauth->allow_user(12,'increase_tax'); $this->aauth->allow_user(12,'immortality');
``` ```
Ok now let's check if Hobbits have `immortality`.
Ok now lets check if commons can 'increase_tax'
```php ```php
if($this->aauth->is_group_allowed('commons','increase_tax')){ if($this->aauth->is_group_allowed('hobbits','immortality')){
// i dont think so echo "Hobbits are immortal";
} else { } else {
// do sth in the middle echo "Hobbits are NOT immortal";
} }
``` ```
Results:
```
Hobbits are NOT immortal
```
Can Obama increase_tax ? Let's check it. Does Gandalf have the ability to live forever?
```php ```php
if($this->aauth->is_allowed(15,'increase_tax')){ if($this->aauth->is_allowed(12,'immortality')){
// i guess so echo "Gandalf is immortal";
} else { } else {
// piece of code 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.
i think 'increse_tax' must have never been created. just delete it
```php ```php
$this->aauth->delete_perm('increase_tax'); $this->aauth->delete_perm('immortality');
``` ```
now better. It is gone.
So what about public people? (public means not logged users). Can public people travel? Lets assume we have permissions namely 'travel' , of course. #### 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 ```php
$this->aauth->allow_group('public','travel'); $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.
So 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. #### User Parameters/Variables
For each user, variables can be defined as individual key/value pairs.
What about User Variables?
for every individual user, variables can be defined as key-value.
this is a simple example to set a variable.
```php ```php
$this->aauth->set_user_var("key","value"); $this->aauth->set_user_var("key","value");
``` ```
For example if you want to keep users phones For example, if you want to store a user's phone number.
```php ```php
$this->aauth->set_user_var("phone","0216 313 23 33"); $this->aauth->set_user_var("phone","1-507-555-1234");
``` ```
to get the variable To retreive value you will use `get_user_var()`:
```php ```php
$this->aauth->get_user_var("key"); $this->aauth->get_user_var("key");
``` ```
Aauth also permits you to define System Variables which can be accesed by every user in the system. Aauth also permits you to define System Variables. These can be which can be accesed by all users in the system.
```php ```php
$this->aauth->set_system_var("key","Value"); $this->aauth->set_system_var("key","value");
$this->aauth->get_system_var("key"); $this->aauth->get_system_var("key");
``` ```
ok lets look at private messages. John (his id=3) will send pm to Ali(id=4) #### Private Messages
OK, let's look at private messages. Frodo (`id` = 3) will send a PM to Legolas (`id` = 4);
```php ```php
$this->aauth->send_pm(3,4,'Hi bro. i need you',' can you gimme your credit card?') $this->aauth->send_pm(3,4,'New cloaks','These new cloaks are fantastic!')
``` ```
sorry John you will be banned :(
#### Banning users
Frodo has broke the rules and will not need to be banned from the system.
```php ```php
$this->aauth->ban_user(3); $this->aauth->ban_user(3);
``` ```
Quick Start is done but thats not the end
Take a look [detailed Documentation from wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages)
Dont forget to watch Aauth. You 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.
You can also contribute and help me :)
Don't forget to keep and eye on Aauth, we are constantly improving the system.
You can also contribute and help me out. :)

9
application/config/aauth.php

@ -1,7 +1,4 @@
<?php <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| Aauth Config | Aauth Config
@ -74,5 +71,5 @@ $config['aauth'] = array(
); );
/* End of file autoload.php */ /* End of file aauth.php */
/* Location: ./application/config/autoload.php */ /* Location: ./application/config/aauth.php */

78
application/language/english/aauth_lang.php

@ -1,35 +1,47 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$lang['verification_subject'] = 'Account Vertification'; /* E-mail Messages */
$lang['reset'] = 'Pasword Reset';
// Account verification
// error mesages $lang['aauth_email_verification_subject'] = 'Account Verification';
// change to your language $lang['aauth_email_verification_code'] = 'Your verification code is: ';
$lang['aauth_email_verification_link'] = " You can also click on (or copy and paste) the following link\n\nhttp://yourdomain/account/verification/";
$lang['email_taken'] = 'E-mail is already taken';
$lang['email_invalid'] = 'E-mail invalid'; // Password reset
$lang['pass_invalid'] = 'Password invalid'; $lang['aauth_email_reset_subject'] = 'Reset Password';
$lang['name_invalid'] = 'Name invalid'; $lang['aauth_email_reset_link'] = "To reset your password click on (or copy and paste in your browser address bar) the link below:\n\nhttp://yourdomain/account/reset_password/";
$lang['code'] = 'Your code is: ';
$lang['link'] = ' or you can copy and paste falowing link http://localhost/vert/'; // Password reset success
$lang['aauth_email_reset_success_subject'] = 'Successful Pasword Reset';
$lang['remind'] = 'If you want to reset your password click the copy and go the link below http://localhost/reset/'; $lang['aauth_email_reset_success_new_password'] = 'Your password has successfully been reset. Your new password is : ';
$lang['new_password'] = 'Your new password is : ';
// no access /* Error Messages */
$lang['no_access'] = 'You dont have access.';
// Account creation errors
// $lang['aauth_error_email_exists'] = 'Email address already exists on the system. If you forgot your password, you can click the link below.';
$lang['wrong'] = 'E-mail or Password is wrong.'; $lang['aauth_error_username_exists'] = "Account already exists on the system with that username. Please enter a different username, or if you forgot your password, please click the link below.";
$lang['exceeded'] = 'Login try limit exceeded.'; $lang['aauth_error_email_invalid'] = 'Invalid e-mail address';
$lang['recaptcha_not_correct'] = 'reCAPTCHA is incorrect.'; $lang['aauth_error_password_invalid'] = 'Invalid password';
$lang['no_user'] = 'User not Exist'; $lang['aauth_error_username_invalid'] = 'Invalid Username';
$lang['not_verified'] = 'Please verify your account.'; $lang['aauth_error_username_required'] = 'Username required';
$lang['group_exist'] = 'Group already exists';
$lang['no_group'] = 'Group doesn\'t exists'; // Access errors
$lang['self_pm'] = 'It is not reasonable to send pm to yourself :)'; $lang['aauth_error_no_access'] = 'Sorry, you do not have access to the resource you requested.';
$lang['no_pm'] = 'Pm not found'; $lang['aauth_error_login_failed'] = 'E-mail Address and Password do not match.';
$lang['aauth_error_login_attempts_exceeded'] = 'You have exceeded your login attempts, your account has now been locked.';
//info $lang['aauth_error_recaptcha_not_correct'] = 'Sorry, the reCAPTCHA text entered was incorrect.';
$lang['already_member'] = 'User already member of group';
$lang['already_perm'] = 'Permission name already existed';
// Misc. errors
$lang['aauth_error_no_user'] = 'User does not exist';
$lang['aauth_error_account_not_verified'] = 'Your account has not been verified. Please check your e-mail and verify your account.';
$lang['aauth_error_no_group'] = 'Group does not exist';
$lang['aauth_error_self_pm'] = 'It is not possible to send a Message to yourself.';
$lang['aauth_error_no_pm'] = 'Private Message not found';
/* Info messages */
$lang['aauth_info_already_member'] = 'User is already member of group';
$lang['aauth_info_group_exists'] = 'Group name already exists';
$lang['aauth_info_perm_exists'] = 'Permission name already exists';

4072
application/libraries/Aauth.php

File diff suppressed because it is too large Load Diff

92
sql/Aauth_v2.sql

@ -1,16 +1,5 @@
/* /*
Navicat MySQL Data Transfer Aauth SQL Table Structure
Source Server : local
Source Server Version : 50508
Source Host : localhost:3306
Source Database : aauth_v2_dev
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2014-07-03 21:23:21
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
@ -20,29 +9,28 @@ SET FOREIGN_KEY_CHECKS=0;
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_groups`; DROP TABLE IF EXISTS `aauth_groups`;
CREATE TABLE `aauth_groups` ( CREATE TABLE `aauth_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` text, `name` varchar(100),
PRIMARY KEY (`id`), `definition` text,
KEY `id_index` (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
-- Records of aauth_groups -- Records of aauth_groups
-- ---------------------------- -- ----------------------------
INSERT INTO `aauth_groups` VALUES ('1', 'Admin'); INSERT INTO `aauth_groups` VALUES ('1', 'Admin', 'Super Admin Group');
INSERT INTO `aauth_groups` VALUES ('2', 'Public'); INSERT INTO `aauth_groups` VALUES ('2', 'Public', 'Public Access Group');
INSERT INTO `aauth_groups` VALUES ('3', 'Default'); INSERT INTO `aauth_groups` VALUES ('3', 'Default', 'Default Access Group');
-- ---------------------------- -- ----------------------------
-- Table structure for `aauth_perms` -- Table structure for `aauth_perms`
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_perms`; DROP TABLE IF EXISTS `aauth_perms`;
CREATE TABLE `aauth_perms` ( CREATE TABLE `aauth_perms` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` text, `name` varchar(100),
`definition` text, `definition` text,
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `id_index` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
@ -54,11 +42,9 @@ CREATE TABLE `aauth_perms` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_perm_to_group`; DROP TABLE IF EXISTS `aauth_perm_to_group`;
CREATE TABLE `aauth_perm_to_group` ( CREATE TABLE `aauth_perm_to_group` (
`id` int(11) NOT NULL AUTO_INCREMENT, `perm_id` int(11) unsigned DEFAULT NULL,
`perm_id` int(11) DEFAULT NULL, `group_id` int(11) unsigned DEFAULT NULL,
`group_id` int(11) DEFAULT NULL, PRIMARY KEY (`perm_id`,`group_id`)
PRIMARY KEY (`id`),
KEY `perm_id_group_id_index` (`perm_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
@ -70,11 +56,9 @@ CREATE TABLE `aauth_perm_to_group` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_perm_to_user`; DROP TABLE IF EXISTS `aauth_perm_to_user`;
CREATE TABLE `aauth_perm_to_user` ( CREATE TABLE `aauth_perm_to_user` (
`id` int(11) NOT NULL AUTO_INCREMENT, `perm_id` int(11) unsigned DEFAULT NULL,
`perm_id` int(11) DEFAULT NULL, `user_id` int(11) unsigned DEFAULT NULL,
`user_id` int(11) DEFAULT NULL, PRIMARY KEY (`perm_id`,`user_id`)
PRIMARY KEY (`id`),
KEY `perm_id_user_id_index` (`perm_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
@ -86,13 +70,13 @@ CREATE TABLE `aauth_perm_to_user` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_pms`; DROP TABLE IF EXISTS `aauth_pms`;
CREATE TABLE `aauth_pms` ( CREATE TABLE `aauth_pms` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL, `sender_id` int(11) unsigned NOT NULL,
`receiver_id` int(11) NOT NULL, `receiver_id` int(11) unsigned NOT NULL,
`title` text NOT NULL, `title` varchar(255) NOT NULL,
`message` text, `message` text,
`date` datetime DEFAULT NULL, `date` datetime DEFAULT NULL,
`read` int(11) DEFAULT '0', `read` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`) KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -106,8 +90,8 @@ CREATE TABLE `aauth_pms` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_system_variables`; DROP TABLE IF EXISTS `aauth_system_variables`;
CREATE TABLE `aauth_system_variables` ( CREATE TABLE `aauth_system_variables` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`key` text NOT NULL, `key` varchar(100) NOT NULL,
`value` text, `value` text,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -121,11 +105,11 @@ CREATE TABLE `aauth_system_variables` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_users`; DROP TABLE IF EXISTS `aauth_users`;
CREATE TABLE `aauth_users` ( CREATE TABLE `aauth_users` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` text COLLATE utf8_general_ci NOT NULL, `email` varchar(100) COLLATE utf8_general_ci NOT NULL,
`pass` text COLLATE utf8_general_ci NOT NULL, `pass` varchar(50) COLLATE utf8_general_ci NOT NULL,
`name` text COLLATE utf8_general_ci, `name` varchar(100) COLLATE utf8_general_ci,
`banned` int(11) DEFAULT '0', `banned` tinyint(1) DEFAULT '0',
`last_login` datetime DEFAULT NULL, `last_login` datetime DEFAULT NULL,
`last_activity` datetime DEFAULT NULL, `last_activity` datetime DEFAULT NULL,
`last_login_attempt` datetime DEFAULT NULL, `last_login_attempt` datetime DEFAULT NULL,
@ -135,24 +119,22 @@ CREATE TABLE `aauth_users` (
`verification_code` text COLLATE utf8_general_ci, `verification_code` text COLLATE utf8_general_ci,
`ip_address` text COLLATE utf8_general_ci, `ip_address` text COLLATE utf8_general_ci,
`login_attempts` int(11) DEFAULT '0', `login_attempts` int(11) DEFAULT '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `id_index` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- ---------------------------- -- ----------------------------
-- Records of aauth_users -- Records of aauth_users
-- ---------------------------- -- ----------------------------
INSERT INTO `aauth_users` VALUES ('1', 'admin@admin.com', 'dd5073c93fb477a167fd69072e95455834acd93df8fed41a2c468c45b394bfe3', 'Admin', '0', null, null, null, null, null, null, null, null, '0'); INSERT INTO `aauth_users` VALUES ('1', 'admin@example.com', 'dd5073c93fb477a167fd69072e95455834acd93df8fed41a2c468c45b394bfe3', 'Admin', '0', null, null, null, null, null, null, null, null, '0');
-- ---------------------------- -- ----------------------------
-- Table structure for `aauth_user_to_group` -- Table structure for `aauth_user_to_group`
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_user_to_group`; DROP TABLE IF EXISTS `aauth_user_to_group`;
CREATE TABLE `aauth_user_to_group` ( CREATE TABLE `aauth_user_to_group` (
`user_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) unsigned NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0', `group_id` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`,`group_id`), PRIMARY KEY (`user_id`,`group_id`)
KEY `user_id_group_id_index` (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
@ -166,9 +148,9 @@ INSERT INTO `aauth_user_to_group` VALUES ('1', '3');
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `aauth_user_variables`; DROP TABLE IF EXISTS `aauth_user_variables`;
CREATE TABLE `aauth_user_variables` ( CREATE TABLE `aauth_user_variables` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL, `user_id` int(11) unsigned NOT NULL,
`key` text NOT NULL, `key` varchar(100) NOT NULL,
`value` text, `value` text,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `user_id_index` (`user_id`) KEY `user_id_index` (`user_id`)

6
sql/readme.txt

@ -1,8 +1,8 @@
Aauth V2 Database Aauth V2 Database
----------------- -----------------
- First you must create a database. - First open your database (or create one if you have not already done so)
- Execute sql "Aauth.sql" file in your database - Execute sql "Aauth_v2.sql" file in your database
- Don't forget to change database connection setups from application/config/database.php - If you have not already, don't forget to change database connection settings in application/config/database.php
That's All :) That's All :)

Loading…
Cancel
Save