Welcome Guest, Not a member yet? Register   Sign In
Ag_auth - Undefined method
#1

[eluser]Ybor_01[/eluser]
Hi there,

I'm trying to use the AG Auth authentication library. I've installed in accordance with the user guide, and can register new accounts and log in and and out via the admin panel.

I'm extending the Application controller like this:

Code:
<?php

class Example extends Application
{
public function __construct()
{
  parent::__construct();
}
}

/* End of file: example.php */
/* Location: application/controllers/example.php */

Now I'm able to use the restrict function and all of the helper functions.

However, when I try to use the login and logout functions e.g. "$this->ag_auth->logout();" I get the following error:

"Fatal error: Call to undefined method AG_Auth::login() in /var/www/application/controllers/test.php on line 14"

I'd appreciate any help with this.

Thanks.
#2

[eluser]Ybor_01[/eluser]
If anyone's interested, I got this working with

Code:
$this->login() ;

rather than

Code:
$this->ag_auth->login();

#3

[eluser]InsiteFX[/eluser]
Those methods are in the ./application/core/MY_Controller with the class name of Application.
#4

[eluser]Ybor_01[/eluser]
Yeah, I realised once I had a proper look at the files. I was originally just going off the documentation.


Thanks




Theme © iAndrew 2016 - Forum software by © MyBB