[eluser]term25[/eluser]
I use Tank Auth library on my site and it work great from frontend, however I want to be able to manage users from admin side of my website, so I need to be able to create a new user via admin.
I would like to use Tank auth's functions to create the password in the same format as phpass in tank auth is using.
So, after successful validation I need to hash $_POST['password'] using Tank Auth function PasswordHash.
So, now I have this code in my controller:
Code:
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->library('security');
$this->load->library('tank_auth');
$this->lang->load('tank_auth');
$password_original = $_POST['password'];
$hasher = new PasswordHash(
$this->ci->config->item('phpass_hash_strength', 'tank_auth'),
$this->ci->config->item('phpass_hash_portable', 'tank_auth')
);
$hashed_password = $hasher->HashPassword($password);
However I am getting this error message:
Message: Undefined property: Admin::$ci
I guess I have to initialize new instance with &ci; something, but I don't know how.
Thanks in advance for any help or advice how to do it differently.