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

[eluser]JGarrido[/eluser]
So what type of errors/output are you getting? I've been attempting to access the same object with no success.

This isn't really relevant to the flashdata, but should help you with troubleshooting/debugging this particular section of code: One thing I noticed that could be problematic is the usage of that switch statement which includes both boolean and string evaluations. I've been evaluating this ReduxAuth library for a couple days, and that specific section gave me tons of trouble due to the fact that the 'switch' statement in PHP does a loose comparison, as opposed to strict (more info here); so when $redux contained a value of 'true', it still fired off the code in the first case block ('NOT_ACTIVATED'). I wound up wrapping it with an additional elseif to determine the return value type and then evaluate accordingly:

Code:
if(is_string($redux)) {
    switch ($redux) {
        case 'NOT_ACTIVATED':
            redirect('user/activate/');
            break;
        case 'BANNED':
            echo "<br />You have been bad and so have been BANNED!<br />";
            break;
        case 'WRONG_PASSWORD':
            echo "<br />Wrong password bub, press the back button on your browser and try again<br />";
            break;
    }
} elseif (is_bool($redux)) {
    switch ($redux) {
        case false:
            echo "<br />We do not seem to have a user registered with that email address.<br />";
            break;
        case true:
            echo "<br /><h4 style=\"color:green;font-weight:bold;\">LOGIN SUCCESSFUL!</h4><br />";
            break;
    }
} else {
    echo "error, big time!";
}

Another option would be to convert the switch to an elseif, would work just as well (and might actually be more concise and efficient, depending on your situation).

Aside from that, I've been having issues with the flashdata myself, but I'm new to both CI and ReduxAuth (and PHP in-general, for that matter), so hopefully someone else will be able to provide more insight. A deeper elaboration of the session handling in CI/ReduxAuth in the broader sense would be extremely helpful.


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