Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Wayne Smallman[/eluser]
[quote author="wiredesignz" date="1299523884"]Yes the application that is in the Ion_Auth download.[/quote]I had to throw everything away and start again, but I've not got Ion Auth working with your Modular Extensions, as far as the default "welcome" controller is concerned.

Assuming the whole thing is working properly, I'm good to go!

Thanks for your assistance on this. Always appreciated.

[eluser]Wayne Smallman[/eluser]
I'm back to where I started, getting errors with every attempt I make to:
1. create a module, and;
2. add the library references for Ion Auth.

I want to call an Ion Auth method from the default controller (and from any other public controller from any other module), so I can validate the user:

Code:
function index() {

    if (!$this->ion_auth->logged_in()):

    // logic here...
But I'm not even getting this far without encountering errors.

If I add library references as an autoload:
Code:
$autoload['libraries'] = array('database', 'session', 'auth/ion_auth');
I get the error:
Quote:The configuration file auth/ion_auth.php does not exist.
If I add the reference as a module call into the constructor for the default controller referenced in "routes.php":
Code:
$this->load->module('auth/ion_auth');
I get the error:
Quote:Unable to load the requested class: ion_auth
If I try changing which core class my constructor is extending, to MY_Controller from MX_Controller, I get the same errors. If I try using the default class CI_Controller I get even more errors in addition to previously mentioned:
Quote:Message: Undefined property: CI::$form_validation

Filename: MX/Loader.php

Line Number: 166
As far as I can see, the errors are happening within the constructor for the Ion Auth library.

I've tried every permutation I can think of (routes, moving the modules directory, adding in the whole paths for the references et cetera) and none of them have worked.

Guys, I have no idea what's going on. I simply cannot get any of this to work.

[eluser]RJ[/eluser]
@Wayne: Are you trying to load ion_auth in your MY_Controller? I was/am having the same problem. I pulled ion_auth out of autoload and setup MY_Controller as shown below, I no longer receive the error.

Code:
class MY_Controller extends MX_Controller
{
    public $data;

        function __construct()
        {
                parent::__construct();
                if ( ENVIRONMENT == 'development' )
                {
                        $this->output->enable_profiler(TRUE);    // debug onscreen
                }
                $this->benchmark->mark('my_controller_start');
                log_message('debug', "*** MY_Controller initialized");

                // Load the user and get user data
                $CI =& get_instance();
                $CI->load->library('users/ion_auth');
                $this->user = $this->ion_auth->get_user();
                
                $this->benchmark->mark('my_controller_end');
        }
}

I have a crap load more to do in the app, so it is not 100% the method above is my final solution. But I no longer receive an error.

EDIT: Had to add $data var to controller. Was producing error in MX Controller looking for CI $data var. Not sure why.

[eluser]Ivan Awe-Inspiring[/eluser]
Hi guys,

Is there a way to change login with method on the fly? For example my app has only email login, but I want to enable users to login with their username as well. Is there any known way or I have to hack through the ion auth code to make this work?

Thanks in advance.

[eluser]Wayne Smallman[/eluser]
[quote author="bullspit" date="1299545668"]@Wayne: Are you trying to load ion_auth in your MY_Controller? I was/am having the same problem. I pulled ion_auth out of autoload and setup MY_Controller as shown below, I no longer receive the error.[/quote]No, I'm calling Ion Auth from the default controller:

Code:
function index() {

        if (!$this->ion_auth->logged_in()):

            // logic here...

But I'm not getting this far because Ion Auth is generating errors when I try to auto load it.

I simply cannot get any of this to work at all. I've spent hours trying all of the permutations I can think of and none of them work.

[eluser]wiredesignz[/eluser]
@Wayne Smallman, it does work. First off, don't autoload the Ion_Auth library from a module. And perhaps if you post your controller code it might help others to diagnose your problem.

[eluser]Wayne Smallman[/eluser]
[quote author="wiredesignz" date="1299602496"]@Wayne Smallman, it does work. First off, don't autoload the Ion_Auth library from a module. And perhaps if you post your controller code it might help others to diagnose your problem.[/quote]I have no doubt that all of this works, because enough people appear to be using it.

However, as you know from our earlier conversations from elsewhere on this forum, you yourself flatly refused to assist me in getting Ion Auth and your own software to work together — which is why I'm now here, seeking further assistance.

I've read through every piece of documentation I can find, I've tried all of the methods described and all have failed in exactly the same way, in exactly the same places. The errors are the only thing that work consistently.

All of what I've attempted has been posted previously. I can, if required, bundle the whole project up and upload it somewhere so you can sift through what I've done.

[eluser]wiredesignz[/eluser]
I am trying to help now so post your controller code.

[eluser]Swissv2[/eluser]
After sifting through this forum thread, it would be great for someone to post an updated video on the proper setup of Ion Auth, preferably those who really know all the caveats of the program.

I have setup the system, got it to run to a certain extent, but unable to access a few sections, including "edit_user". I will release a video of me setting up Ion_Auth in a little while along with screenshots to show what exactly is happening on my end.

[eluser]RJ[/eluser]
@swissv2 - The edit user view is looking for an admin/edit_user method. The admin controller wasn't included in my ion_auth download. Maybe Ben can chime in here...




Theme © iAndrew 2016 - Forum software by © MyBB