Welcome Guest, Not a member yet? Register   Sign In
User Login Page?

Great! You can proof read it :p

If you think things are missing, unclear or if your interested in additional things, please let me know!

Bramme, worked like a charm! Learned some good stuff along the way too! Thanks again, and again for posting that. One thing I did notice, was when I clicked the link to 'view plain' on the code, in Safari (mac) it opens squished to one line. Works fine in FireFox 3 on (mac) though. Other than that, all looks good to me!

That's the JavaScript I'm afraid... It's the first time I used it but it's good to know the bug's there. Though I don't really care :p People reading it will probably have got Firefox ^^

Curious on something in your auth library. I am trying to set the cookie to something else than the say user name, in my case username is the email. I want to use my user's id from the database instead for the cookie. I have been trying this, but its not working. Maybe I am just using the query variable wrong here, or maybe i'm missing something al together?

// Query time
    $this->CI->db->where('dEmail', $email);
    $this->CI->db->where('dPassword', $password);
    $query = $this->CI->db->get('designer');
    if ($query->num_rows() == 1)    {
        // Our user exists, set session.
        $designerid = $query[0]; //First item in array would be the designerid
        $this->CI->session->set_userdata('logged_user', $designerid );
        return TRUE;
    }     else {
        // No existing user.
        return FALSE;

Update, was able to fix changing to grab the row via:

foreach ($query->result() as $row) {
            $designerid = $row->dDesignerId;

Indeed, $query[0]would not have worked, seeing as it wasn't converted into a result (or row) yet.

A better way would be (imo)
$row = $query->row();
$designerid = $row->dDesignerID;

indeed better, thanks.

[eluser]Randy Casburn[/eluser]
Please consider this post: Authentication (ACL) - Challenges - Solutions - Dilemmas



Theme © iAndrew 2016 - Forum software by © MyBB