I’ve been working with the Tank Auth library all day and have a question about it. I added two fields to the registration form: first_name and last_name respectively and I’m trying to find out why its not inserting into the user_profiles page.
With the updated code I’m getting this error:
A PHP Error was encountered
Severity: Warning
Message: Missing argument 5 for Tank_auth::create_user(), called in /home/xtremer/public_html/kowmanager/application/controllers/auth.php on line 136 and defined
Filename: libraries/Tank_auth.php
Line Number: 162
A PHP Error was encounteredSeverity: Notice
Message: Undefined property: Tank_auth::$users
Filename: libraries/Tank_auth.php
Line Number: 188
Fatal error: Call to a member function UpdateProfileInfo() on a non-object in /home/xtremer/public_html/kowmanager/application/libraries/Tank_auth.php on line 188
Updated Code:
Any ideas on what I am doing wrong now?
I’ll put a 50 point bounty on this but I can’t get the link to come up so that there is a bounty.
What You should do is put the two columns you want in the
user_profilestable, then add a function to themodels/tank_auth/users.phpwith something like:Then replace (in
/libraries/Tank_auth.php)function create_user($username, $email, $password, $email_activation)With
function create_user($username, $email, $password, $email_activation, $userInfo)Then right beneath (in
/libraries/Tank_auth.php)if (!is_null($res = $this->ci->users->create_user($data, !$email_activation))) {Add
$this->users->UpdateProfileInfo($userInfo["firstname"],$userInfo["lastname"]);Then replace (in
/controllers/auth.php)with:
This isn’t tested though it should work, tell me how it goes
Max