prashants/webzash — Issue #2: Auto Activation
Author: NewLion
Created: 2012-02-03 04:11:13+00:00
State: open

Ref: Invalid account database. Table "settings" missing.

NewLion:
I looked up (line 77 on) system/application/controllers/user.php. Since [account_name] is already stored in [user].ini, what is the easiest way to auto activate this [account] after log on? Basically, I want users with only one account to skip the Activate step as this is redundant and instead load their dashboard.

prashants:
after line 77 once the user is auth, get the user details from line 140. this will give you the account name in $active_user['accounts'] in string, convert to array in 150. if one element then line 180 to load the account. set session in 187 and then redirect to home page.
much more simple hack :
just add one line after line no. 77 where 'sample' is the account label. thats it.
$this->session->set_userdata('active_account', 'sample');