2

I'm trying to update an user with update_user function. But I have got this error.

Fatal error: Uncaught exception ‘Exception’ with message ‘Undefined method on_auth::update_user() called’

My code is

$id = 8;
$data = array(
     'first_name' => 'Ben',
     'last_name' => 'Edmunds',

      );
$this->ion_auth->update_user($id, $data); 
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
SNaRe
  • 1,997
  • 6
  • 32
  • 68
  • Are you 100% sure this is the actual code that generates the error? Look at the error message: `on_auth`. It should be `ion_auth`. Search for typos. – Wesley Murch Nov 17 '11 at 20:50
  • I found the problem. I wanted to write here but I didn't allow me to wrote due to I am a new member :) So I can write as a comment. the coder of ion_auth didn't update documentation. So, instead of update_user , we should use just update. There are many more functions that he didn't update on documentation but have problems. I will write detailed explanation when stackoverflow allows me – SNaRe Nov 17 '11 at 22:09

1 Answers1

4

I found the answer. The problem is the author didn't update user guide. Therefore, I had go through codes and found the solutions. In addition to that, this function is not the only function that should have changed in documentation. There are many. I hope he updates soon.

Solution

Instead of

$this->ion_auth->update_user($id, $data); 

Use

$this->ion_auth->update($id, $data); 
SNaRe
  • 1,997
  • 6
  • 32
  • 68