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

[eluser]Popcorn[/eluser]
Hmmm, I forgot to change that function to use the id of the user, here's the fix and example

Replace line 480 with :
Code:
function get_group($id){return $this->_get_group($this->groups_table, $this->users_table, $id);}

Replace line 784 to 794 with :
Code:
protected function _get_group ($table, $user, $where)
    {
        $i = $this->ci->db->select($table.'.title')
        ->from($table)
        ->join($user, $table.'.id = '.$user.'.group_id', 'left')
        ->where($user.'.id', $where)
        ->limit(1)
        ->get();

        return $var = ($i->num_rows() > 0) ? $i->row()->title : false;
    }

Example

Then you should be able to use the function like so :

Code:
$group = $this->redux_auth->get_group($this->session->userdata('id'));
if($group == 'groupname')
{
  echo 'You are part of group name';
}
etc ...

Hope that helps.

[edit] Updated the zip file.
#92

[eluser]Scott Boyde[/eluser]
Thanks again, I'm getting there slowly.
#93

[eluser]alekz[/eluser]
Hi, you made a excellent library!!!

i have one question or maybe a suggestion, in the redux_auth.php library into the function register, you use a SELECT to get the last insert id question, why don't you use $this->db->insert_id() from the query helper, i think this could be a good enhancement...

Best Regards...
from Mexico
#94

[eluser]jbads[/eluser]
Hey, thanks alot for this library. Damn fine work. Would you be interested in looking to add a reset password feature for if a user would like to change their password?
#95

[eluser]ddrury[/eluser]
Hi,

I originally posted a query in the Code & Apps forum but was directed here. I've made a few more steps since the previous question.

I'm attemting to set up Redux on a new CI 1.6.2 installation and cannot get the 'user' controller to work - Am I right in thinking that the views referenced in 'user' are not in the redux_auth_1.2 package?

Dave
#96

[eluser]Popcorn[/eluser]
alekz : Thank you for the comment and I will add this feature into the future versions.

jbads : A reset password and change password are different functions, I assume you'll want the change password function and yes, this is in the list of features to implement.

ddruy : You can find the view files here. I will include them in future versions because a lot of people are asking for them.

http://www.leveldesign.info/redux/views.zip
#97

[eluser]ddrury[/eluser]
Popcorn,

Thank you so much, Not only does this look like an excellent authentication library, it also makes a very good primer for building a site (PS don't forget the CSS & image files for the views though)

Thanks once again

Dave
#98

[eluser]jbads[/eluser]
Awesome. Just a couple of other questions:

I am wondering the best way to check upon login
That a user has not been banned and if so not allow any access.

I may have missed something within the code that already checks these things and acts upon them? Please let me know if so.

Cheers.
#99

[eluser]Popcorn[/eluser]
I'm just about to go to bed, but look at the "check_access" function.

Code:
function check_access($email)
    {
        $result = $this->_check_access($this->banned_table, $this->users_table, $email);

        if ($result)
        {
            if (!empty($result->id))
            {
                $this->logout();
                return 'BANNED';
            }
            elseif (!empty($result->activation_code))
            {
                return 'NOT_ACTIVATED';
            }
        }
        return false;
    }

Returns : BANNED | NOT_ACTIVATED

Just noticed that it checks against a passed email and not a user id. I'll fix that up and have it with you for tomorrow unless you can't do it.

[eluser]Popcorn[/eluser]
Updated the front page with news that the project has moved over to google code. This allows me to keep a better grip on bugs and feature requests.




Theme © iAndrew 2016 - Forum software by © MyBB