Welcome Guest, Not a member yet? Register   Sign In
Ion_auth V2 meta table?
#1

[eluser]Andy78[/eluser]
Is the meta table still used in V2? I have a large amount of fields to add and dont want them to go in the users table.

As far as I can tell I have set up everything correctly but it is not storing the additional data in the meta table.

Forexample in my ion_auth config file I have the following:

Code:
/*
| -------------------------------------------------------------------------
| Tables.
| -------------------------------------------------------------------------
| Database table names.
*/
$config['tables']['users']           = 'users';
$config['tables']['groups']          = 'groups';
$config['tables']['users_groups']    = 'users_groups';
$config['tables']['login_attempts']  = 'login_attempts';

$config['tables']['meta'] = 'users_profiles';

/*
| Users table column and Group table column you want to join WITH.
|
| Joins from users.id
| Joins from groups.id
*/
$config['join']['users']  = 'user_id';
$config['join']['groups'] = 'group_id';
$config['join']['meta'] = 'user_id';


/**
     * Columns in your meta table,
     * id not required.
     **/
$config['columns'] = array('gender','dateofbirth','ethnicity');

In my data base I have a table called users_profiles that contains the fields

and in my controller I have the following just to test:

Code:
function add_admin_user(){

    $sections = array(
    'config'  => TRUE,
    'queries' => TRUE
    );
    $this->output->enable_profiler(TRUE);
    $this->output->set_profiler_sections($sections);

        $username = 'benedmunds';
        $password = '12345678';
        $email = '[email protected]';
        $additional_data = array(
                                'gender' => 'Male',
                                'dateofbirth' => '1978-04-21',
                                'ethnicity' => 'white'
                                );
        $group = array('1'); // Sets user to admin. No need for array('1', '2') as user is always set to member by default

        $this->ion_auth->register($username, $password, $email, $additional_data, $group);

Any ideas?


Messages In This Thread
Ion_auth V2 meta table? - by El Forum - 09-26-2012, 05:54 PM
Ion_auth V2 meta table? - by El Forum - 09-26-2012, 06:06 PM
Ion_auth V2 meta table? - by El Forum - 10-01-2012, 08:03 AM
Ion_auth V2 meta table? - by El Forum - 10-01-2012, 08:28 AM
Ion_auth V2 meta table? - by El Forum - 10-05-2012, 03:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB