Welcome Guest, Not a member yet? Register   Sign In
DX Auth 1.0.6 (Authentication library)

[eluser]dexcell[/eluser]
[quote author="Iverson" date="1229428262"][quote author="dexcell" date="1229413197"]
Can you specify when you get this function error?[/quote]

That error occurs during the situation I initially described.

-I log in as a user
-Type in the url to the backend
-Throws the wrong datatype error[/quote]

Thanks, but i cannot produce the error.

But i think there is big probability, it's happened at check_uri_permisisons() function when calling

if ($this->_array_in_array(array('/', $controller, $action), $allowed_uris))

[line 506 in libraries/DX_Auth.php]

Maybe $allowed_uris = NULL ? Can you help me do some print_r or something to check the $allowed_uris value.

[eluser]Iverson[/eluser]
Yeah I'm not sure what's going on. Don't really feel like troubleshooting so I'll leave it as it is. Like I said, I'll be the only one logging into the backend. On another note, when logging out, since you're only sending a message ($data['auth_message']), most browswers load the cached version of the page, resulting in any login data that was on the page to stay visible. For instance, I show the username and last login on a main page. After clicking logout and loading the example logout function you used, the message shows up that I'm logged out, but the user info still shows. A simple fix was to add

Code:
$this->dx_auth->logout();
redirect('', 'refresh');

[eluser]Berserk[/eluser]
greats !!! Smile

can you zip your document ? i want to download to view offline like CI's doc Big Grin

[eluser]Iverson[/eluser]
So there's been talk about the config vars being static. This is probably my biggest problem with dx auth(Other than that, it's by far the best CI lib for authentication I've used thus far. Thanks <b>dexcell</b>). If anybody's interested, I made some mos to the library and created a <b>dx_auth_config</b> table. All the variables get set from the value in the database except the views. I figured there wasn't really a dire need to be able to dynamically change these so they're still in dx_auth.php in <i>application/config</i>. I've attached the sql file. All you have to do is import it.

<b>Changes in DX_Auth.php</b>

Include this line with the class variables:

Code:
var $_config_table = 'dx_auth_config';

This is the new _init() function:

Code:
function _init()
    {
        // When we load this library, auto Login any returning users
        $this->autologin();
        
        // Init helper config variable
        
/***********    Start Modification    ************************
Modification by Iverson
http://ellislab.com/forums/member/71157/
12/16/2008
***********************************************************/
$get_config_vars = $this->ci->db->query('SELECT field, value FROM ' . $this->_config_table);

foreach ($get_config_vars->result() as $row)
{
    $field = $row->field;
    // Models access the config variable so we'll set the config var it in here to not cause any problems!
    $this->ci->config->set_item($field, $row->value);
    
    // Set this class' variables as well
    $this->$field = $row->value;
}

/************    End Modification    **********************/
        
        // Forms view
        $this->login_view = $this->ci->config->item('DX_login_view');
        $this->register_view = $this->ci->config->item('DX_register_view');
        $this->forgot_password_view = $this->ci->config->item('DX_forgot_password_view');
        $this->change_password_view = $this->ci->config->item('DX_change_password_view');
        $this->cancel_account_view = $this->ci->config->item('DX_cancel_account_view');
        
        // Pages view
        $this->deny_view = $this->ci->config->item('DX_deny_view');
        $this->banned_view = $this->ci->config->item('DX_banned_view');
        $this->logged_in_view = $this->ci->config->item('DX_logged_in_view');
        $this->logout_view = $this->ci->config->item('DX_logout_view');        
        
        $this->register_success_view = $this->ci->config->item('DX_register_success_view');
        $this->activate_success_view = $this->ci->config->item('DX_activate_success_view');
        $this->forgot_password_success_view = $this->ci->config->item('DX_forgot_password_success_view');
        $this->reset_password_success_view = $this->ci->config->item('DX_reset_password_success_view');
        $this->change_password_success_view = $this->ci->config->item('DX_change_password_success_view');
        
        $this->register_disabled_view = $this->ci->config->item('DX_register_disabled_view');
        $this->activate_failed_view = $this->ci->config->item('DX_activate_failed_view');
        $this->reset_password_failed_view = $this->ci->config->item('DX_reset_password_failed_view');
    }


<b>Changes in <i>application/config/dx_auth.php</i></b>
Simply comment out all variables except the view variables. Or you can download the one created. I left all the comments in because it's really well documented


If anyone disagrees with this, let me know why so I'll know if I need to revert back to static vars. The main benefit of this is that the admin panel I'm creating will be able to change all my authentication settings from a GUI instead of having to edit a static file.

[eluser]humugus[/eluser]
thank you very much for a great library, which by the way was implemented very easily to my project although i'm a newbie in CI and PHP programming Smile

i have a question, as i could not find the answer in all those pages of the thread :

the database has already 2 users registered : admin (id 1) and user(id 2)
which is the password for the admin ?

[eluser]Iverson[/eluser]
[quote author="humugus" date="1229458415"]
the database has already 2 users registered : admin (id 1) and user(id 2)
which is the password for the admin ?[/quote]

I had the same problem. The info is at
http://dexcell.shinsengumiteam.com/dx_au...chema.html

[eluser]humugus[/eluser]
thank you very much for the fast reply, i should have noticed it myself :?
but using the library for just a few hours i was thrilled that i got a grasp on it although i have not read everything !!

[eluser]Iverson[/eluser]
[quote author="humugus" date="1229458824"]thank you very much for the fast reply, i should have noticed it myself :?
but using the library for just a few hours i was thrilled that i got a grasp on it although i have not read everything !![/quote]

Yeah, CI forums have the fastest response time I've seen dealing with PHP. That's why we're always on it... %-P

[eluser]humugus[/eluser]
hmm, i cannot login ...
could it be the encryption_key ??
-------

EDIT : yes, i deleted my encryption key from CI config and was able to login Big Grin

[eluser]dexcell[/eluser]
Thanks Iverson,

In my opinion, i think it's better creating a parser function to parse DX Auth config file,
then display it to GUI page.
Then if you save it you can create new config file, overwrite the old config.

The benefit if you are creating the parser you can parse practically any static config (not only DX Auth),
and display it to your GUI page.

This way also you don't need to edit DX_Auth core.




Theme © iAndrew 2016 - Forum software by © MyBB