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

[eluser]jaswinder_rana[/eluser]
If you are using Firefox and Web Developer extension, then you can use images drop down and "View Image Information" to see what might be an issue.

If it does show an image link but no image then it's just a matter of wrong image path. Maybe that will help.

[eluser]aidanmcg33[/eluser]
It doesnt show any html to insert an image never mind a broken image link.

[eluser]chamu_cfi[/eluser]
Hi, I'm trying to use this library for my new project but there is an issue I must resolve before continue:

when a user is trying to access a specific URL which is protected, if the user is not connected is redirected to the login form, but when the user has logged on is not redirected to the originally requested URL.

How is posible to do that?

Can anyone give me some help about that?

PD: Sorry about my english

[eluser]jaswinder_rana[/eluser]
[quote author="chamu_cfi" date="1229911391"]Hi, I'm trying to use this library for my new project but there is an issue I must resolve before continue:

when a user is trying to access a specific URL which is protected, if the user is not connected is redirected to the login form, but when the user has logged on is not redirected to the originally requested URL.

How is posible to do that?

Can anyone give me some help about that?

PD: Sorry about my english[/quote]

I have the same problem. I haven't checked to see how to resolve this but I will

- either check for $_SERVER['HTTT_REFERER'] value
- or pass the referer to the login page when redirecting users if they are not logged in

[eluser]chamu_cfi[/eluser]
[quote author="jaswinder_rana" date="1229912044"][quote author="chamu_cfi" date="1229911391"]Hi, I'm trying to use this library for my new project but there is an issue I must resolve before continue:

when a user is trying to access a specific URL which is protected, if the user is not connected is redirected to the login form, but when the user has logged on is not redirected to the originally requested URL.

How is posible to do that?

Can anyone give me some help about that?

PD: Sorry about my english[/quote]

I have the same problem. I haven't checked to see how to resolve this but I will

- either check for $_SERVER['HTTT_REFERER'] value
- or pass the referer to the login page when redirecting users if they are not logged in[/quote]

Thank you for your fast response.

I've been thinking on use the user_logged_in() function in DX_Auth_Event.php and do something like retrieve the requested URL from someplace (i'm still thinking from where :roll: ) and then redirect the user

What do you think about that?

What is the correct way to use the events in DX_Auth?

[eluser]jaswinder_rana[/eluser]
I noticed that when I logout, cookies (or session information) is still there even after user ha logged out.

I tried following code on my logout page
Code:
if($this->dx_auth->is_logged_in(){
echo 'Logged In';
}else{
echo 'Logged Out';
}

When I go to logout page, it shows "Logged In". When I refresh it again, then it says "Logged Out".

I understand that cookies can't be deleted (at least in FireFox) until page is refreshed. So, maybe a redirect behind the scenes on logout page can solve it?

Not sure if it'd be considered bug but just wanted to post my finding.

[eluser]sofbas[/eluser]
[quote author="chamu_cfi" date="1229911391"]
when a user is trying to access a specific URL which is protected, if the user is not connected is redirected to the login form, but when the user has logged on is not redirected to the originally requested URL.
[/quote]

I use flashdata to store the URL. You can set_flashdata('url', uri_string()) to set the page referred from, get the flashdata('url') to redirect to on successful login, or you can keep_flashdata('url') to keep the referral when the user does not login successfully.

So if I tried to access a protected URI, e.g: /admin/dashboard
in Controller admin/dashboard.php set the flashdata
Code:
//Constructor
function Dashboard()
    if ( ! $this->dx_auth->is_logged_in()) {
        $this->session->set_flashdata('url', uri_string());
        redirect('/auth/login');
    }

then in Controller auth.php, from line 99, grab the flashdata
Code:
if ($val->run() AND $this->dx_auth->login($val->set_value('username'), $val->set_value('password'), $val->set_value('remember')))
{
    // Redirect to url stored in flashdata else homepage
    $redirect = $this->session->flashdata('url');
    redirect($redirect);
}

and line 128 set keep_flashdata for when an error occurs:
Code:
// Load login page view
$this->session->keep_flashdata('url');
$this->load->view($this->dx_auth->login_view, $data);

Hope this helps. It works well enough for me.

[eluser]sofbas[/eluser]
[quote author="jaswinder_rana" date="1229919002"]I noticed that when I logout, cookies (or session information) is still there even after user ha logged out.

I tried following code on my logout page
Code:
if($this->dx_auth->is_logged_in(){
echo 'Logged In';
}else{
echo 'Logged Out';
}

When I go to logout page, it shows "Logged In". When I refresh it again, then it says "Logged Out".

I understand that cookies can't be deleted (at least in FireFox) until page is refreshed. So, maybe a redirect behind the scenes on logout page can solve it?

Not sure if it'd be considered bug but just wanted to post my finding.[/quote]

I tried logging in using /auth/login
Then I logged out using /auth/logout and it displays You have been logged out so I guess the default logout page works.

When I tried your example, it does what you say. Interesting.

I can see how it can cause some confusion if you are debugging. Smile

[eluser]little brittle[/eluser]
I have 2 questions:

Why does it say the captcha is "case insensitive" on the registration page, when it is actually case sensitive?

Why does the password reset email address the person as "site name" instead of "username?" For example, if my website is called "Cool Cars Website", and a user named "Frank" resets his password, the email looks like this:

Quote:Cool Cars Website,

You have requested your password to be changed...

Is there an easy way to fix this so that it says "Frank" instead of "Cool Cars Website?"

[eluser]jaswinder_rana[/eluser]
[quote author="sofbas" date="1229942721"]
I tried logging in using /auth/login
Then I logged out using /auth/logout and it displays You have been logged out so I guess the default logout page works.

When I tried your example, it does what you say. Interesting.

I can see how it can cause some confusion if you are debugging. Smile[/quote]

Actually, if you put following code in auth/logout(), you will find the same behavior. It doesn't delete session and cookies until browser is refreshed.

Code:
if($this->dx_auth->is_logged_in()){
  echo 'Not Yet';
}
$data['auth_message'] = 'You have been logged out.';

and it does print "Not Yet". It's just printing the message after running library/logout() function. It's not checking if user has logged out or not.




Theme © iAndrew 2016 - Forum software by © MyBB