Customizing User Data
BitAuth has a number of required fields, and they are all in the users table (default: bitauth_users). Anything in the data (default: bitauth_userdata) table is optional, and you can customize this table to include anything you like. This table will only be updated when data is passed to add_user() or update_user() that is not found in the users table.
To include custom user data in BitAuth, all you need to do is update the structure of bitauth_userdata with your new fields, then pass data for those new fields to add_user() and update_user(). That's it! BitAuth determines which table the data given to it belongs to, and it will insert or update the appropriate table. Also, just by being in the userdata table, your custom data will be included with the user object that is returned when fetching users.
For example, if you add the column mydata to the userdata table, you can access that attribute easily with:
$user = $this->bitauth->get_user_by_id(2); echo $user->mydata;
You can also set that column when adding or updating just like any other column:
$user = array(
'username' => 'testuser',
'password' => 'ABC123!',
'groups' => array(2,5,7),
'mydata' => 'This is my data!'
);
$this->bitauth->add_user($user);