Welcome Guest, Not a member yet? Register   Sign In
Redux Authentication 1.4a (24th July 2008)

[eluser]freshface[/eluser]
Anybody who got the password retrieval working? It doesn't seem to work properly.

[eluser]Fenix[/eluser]
If anybody can explain how to use the activation function, I'd much appreciate it. PM me if you can help. This thread seems very sporadic.

Thanks

[eluser]Fenix[/eluser]
Is there a place with an updated documentation? I am having a very hard time figuring out the forgotten password process. I checked the documentation on the amazon page and it is incomplete and appears to be broken. The documentation included in the download is wrong. It has the same example controller for forgotten_process and forgotten_end.

If anybody has this process working, please share. Disregard my previous post about activation; i got that part working.

Thanks!

[eluser]McNoggin[/eluser]
I was able to get it working. The first thing I did was update the redux config file and changed the forgot password email to include a link instead of just sending the code.
Code:
$config['auth']['forgotten_password_message'] = <<&lt;HTML

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html&gt;
    &lt;head&gt;
        
    &lt;/head&gt;
    &lt;body&gt;
        <h2>MyWebsite.com Forgotten Password Request</h2>
        <p>To continue reseting your password <a href="http://www.MyWebsite.com/user/forgot_password/{key}">click here</a></p>
    &lt;/body&gt;
&lt;/html&gt;

HTML;

Here are the functions I added to my controller to handle the lost password.
Code:
class User extends Controller
{
    function forgot_password($forgot_code = '')
    {
        if ($forgot_code == '') {
            // no code so they must be on the first step
            $rules['email']     = "required|valid_email|callback_registered_email";

            $this->validation->set_rules($rules);

            $fields['email']    = 'Email Address';        

            $this->validation->set_fields($fields);

            if ($this->validation->run() == true)
            {
                $redux = $this->redux_auth->forgotten_begin($this->input->post('email'));

                if ($redux) {
                    // email was sent
                    $this->load->view('users/forgot_password_2');                    
                }
                else {
                    // no account with that email
                    show_error("An unknow error has occured.");
                }
            }
            else
            {
                $this->load->view('users/forgot_password_1');
            }            
        }
        else {
            // there is a code so they are on step 2
            // make sure it was a valid code
            $redux = $this->redux_auth->forgotten_process($forgot_code);
            
            if ($redux != false) {
                // its a valid code so show step 3
                $data['question'] = $redux;
                $this->load->view('users/forgot_password_3', $data);
            }
            else {
                // its a bad code so show a 404 error
                show_404('users/forgot_password/' . $forgot_code);
            }            
        }
    }
    
    function forgot_reset()
    {    
        $rules['answer'] = "required";
                
        $this->validation->set_rules($rules);

        $fields['answer']= 'Security question answer';        
    
        $this->validation->set_fields($fields);
            
        if ($this->validation->run())
        {
            $redux = $this->redux_auth->forgotten_end($this->input->post('answer'));
            
            if ($redux != false) {
                // new password was sent to email address
                $this->load->view('users/forgot_password_4');
            }
            else {
                // the answer was wrong, they need to start all over
                $data['forgot_pass_url'] = 'user/forgot_password';
                $this->load->view('users/forgot_fail', $data);
            }
        }
        else
        {
            // they didn't type an answer so redisplay the page
            $data['question'] = $this->input->post('question');
            $this->load->view('users/forgot_password_3', $data);
        }    
    }

    // make sure an account is using the email address
    function registered_email($str)
    {
         if ($this->redux_auth->check_email($str))
         {
             // there is an account with that email
             return TRUE;
         }
         else {
             $this->validation->set_message('registered_email', 'There are no users with that %s.');
             return FALSE;
         }            
    }
}

Now for views

forgot_password_1.php
Code:
<h1>Forgot Password</h1>

&lt;?php echo $this->validation->error_string; ?&gt;

&lt;?php echo form_open('user/forgot_password'); ?&gt;

    <label for="email">Email : </label>
    &lt;?php echo form_input('email', $this->validation->email); ?&gt;

    <label for="submit"> </label>
    &lt;?php echo form_submit('submit', 'Next'); ?&gt;

&lt;?php echo form_close(); ?&gt;

forgot_password_2.php
Code:
<h1>Forgot Password Step 2</h1>

<p>
A confirmation email has been sent to your email address. Follow the link in the email to continue reseting your password.
</p>

forgot_password_3.php
Code:
<h1>Forgot Password Step 3</h1>

&lt;?php echo $this->validation->error_string; ?&gt;

&lt;?php echo form_open('user/forgot_reset'); ?&gt;

    <label>Question : </label>
    &lt;?php echo $question; ?&gt;
    
    <label for="answer">Answer : </label>
    &lt;?php echo form_input('answer'); ?&gt;

    <label for="submit"> </label>
    &lt;?php echo form_submit('submit', 'Reset Password'); ?&gt;

    &lt;?php echo form_hidden('question', $question); ?&gt;
&lt;?php echo form_close(); ?&gt;

forgot_password_4.php
Code:
<h1>Forgot Password Step 4</h1>

<p>
Your new password has been sent to your email address. Please change it after you login.
</p>

And finally...
forgot_fail.php
Code:
<h1>Forgot Password Failed</h1>

<p>
That answer was not correct. You can retry by starting the &lt;? echo anchor($forgot_pass_url, 'Forgot Password'); ?&gt; process again.
</p>

Let me know if you have any problems. The code I posted here is slightly different then what I'm actually using, and I've also made some changes to the library. I don't think either should cause any errors but you never know.

[eluser]Nonox[/eluser]
Hi, I have a question about Redux...
Reading about Redux I found this http://redux.devjavu.com, this is another project with the same name?

[eluser]Xeoncross[/eluser]
Yep, it's version 2.0 of the Redux Project. This is version 1.4a

[eluser]Nonox[/eluser]
[quote author="Xeoncross" date="1225245682"]Yep, it's version 2.0 of the Redux Project. This is version 1.4a[/quote]

Do you know if this new version was made by Popcorn? I read that he is developing the Redux 1.5. If you see in the home page of the project http://code.google.com/p/reduxauth/ the lastest version is the 1.4a.

[eluser]Nonox[/eluser]
[quote author="Nonox" date="1225246252"][quote author="Xeoncross" date="1225245682"]Yep, it's version 2.0 of the Redux Project. This is version 1.4a[/quote]

Do you know if this new version was made by Popcorn? I read that he is developing the Redux 1.5. If you see in the home page of the project http://code.google.com/p/reduxauth/ the lastest version is the 1.4a.[/quote]

I'll response my own question, yes it was developed by Popcorn and he explain the new version in this thread http://ellislab.com/forums/viewthread/90254/

Xeoncross: Thanks for your time.

[eluser]CARP[/eluser]
Hi guys
did any1 try redux auth with latest 1.7 CI released few days ago?
I think it doesn't work well with the session patch CI 1.7 includes, am I wrong?

TiA,

[eluser]Mat-Moo[/eluser]
I moved from 1.6 to 1.7 using this no issues. Make sure you updated your session tables as required.




Theme © iAndrew 2016 - Forum software by © MyBB