Welcome Guest, Not a member yet? Register   Sign In
troubles with flashdata
#6

[eluser]Fenix[/eluser]
Yes, now it looks like this (works too, for what I can tell):
Code:
if(is_string($redux))
            {
                switch($redux)
                {
                    case 'NOT_ACTIVATED':
                        $this->session->set_flashdata('login', 'Your account is not activated.');
                        redirect('users/login');
                        break;
                    case 'BANNED':
                        $this->session->set_flashdata('login', 'Your account has been banned.');
                        redirect('users/login');
                        break;
                }
            }
            elseif(is_bool($redux))
            {
                switch($redux)
                {
                    case true:
                        redirect('admin/dashboard');
                        break;
                    case false:
                        $this->session->set_flashdata('login', 'The credentials you provided are invalid.');
                        redirect('users/login');
                        break;
                }
            }
            else
            {
                $this->session->set_flashdata('login', 'An unknown error ocurred.');
                redirect('users/login');
            }

And my logout function is in that same controller:
Code:
function logout ()
    {
        $this->redux_auth->logout();
        $this->session->set_flashdata('login', 'Logout successful!');
        redirect('users/login');
    }

And here is my view:
Code:
<h1>Login</h1>
&lt;?=$this->validation->error_string?&gt;
&lt;?php
    echo $this->session->flashdata('login');
?&gt;

&lt;?=form_open('users/login')?&gt;

<label for="username">Email : </label>
&lt;?=form_input('email')?&gt;<br/>

<label for="password">Password : </label>
&lt;?=form_password('password')?&gt;<br/>

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

&lt;?=form_close()?&gt;


Messages In This Thread
troubles with flashdata - by El Forum - 08-21-2008, 01:01 PM
troubles with flashdata - by El Forum - 08-21-2008, 01:23 PM
troubles with flashdata - by El Forum - 08-21-2008, 01:28 PM
troubles with flashdata - by El Forum - 08-21-2008, 03:59 PM
troubles with flashdata - by El Forum - 08-21-2008, 04:12 PM
troubles with flashdata - by El Forum - 08-21-2008, 04:22 PM
troubles with flashdata - by El Forum - 08-26-2008, 04:41 PM
troubles with flashdata - by El Forum - 08-26-2008, 10:31 PM
troubles with flashdata - by El Forum - 08-27-2008, 12:41 AM
troubles with flashdata - by El Forum - 12-18-2008, 10:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB