Welcome Guest, Not a member yet? Register   Sign In
set extra authentication variable from usertable
#1

I added a new column "dummy" to usertable and made changes in 

Code:
get_auth_data()

 declared in 

Code:
Auth_Controller_set_user_variables()

But still unable to set authentication variable "dummy". 
[font=Arial,]NOTE I Know there is a define way to pull profile data in community autho BUT for single column i don't want to create a extra table.[/font]
Reply
#2

It would help if you told us what Auth System you were using.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

The get_auth_data() function will only GET data, it doesn't SET anything.
Reply
#4

I really apologise. I was working with community auth and trying to extra authentication variable. @skunkbot already described a proper way to pull profile data but I only need one extra variable without creating extra table.
Reply
#5

1) You add your field to the user table.
2) You modify your existing auth model (not Community Auth's auth model). If you don't have one, make one and declare it.
3) Modify your auth model's get_auth_data and check_login_status methods to return your new field.
4) If you haven't already, extend the _set_user_variables method that is in Auth_Controller by adding it to MY_Controller. Add your new field to controller properties, config values, or whatever you want.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB