ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

DX Auth 1.0.6 (Authentication library)

December 01, 2008 6:14am

Subscribe [160]
  • #346 / Feb 06, 2009 4:12pm

    phazei

    46 posts

    I mean when I put the name of the controller in the uri permissions, do I always put the controller name, or do I need to put the rerouted name as well.
    So with:
    $route[‘alternate/route’] = ‘auth/login’;

    If it checks it based on the actual url, then if I put something like “auth/login” that will never be seen because “alternate/route” is there instead.

    The way I’m thinking is check_uri_permissions is called before any function call and checking the currently requested page against the whitelist.  When it checks, does it search for the function that’s being called, or is it looking at the url itself.

  • #347 / Feb 06, 2009 4:37pm

    jcavard

    130 posts

    I’m not sure I understand correctly. You must use the built-in interface to manage the permissions, are you?

    It is accessible at http://www.your-site.com/index.php/backend/uri_permissions/

    This page is hidden/nowhere mentionned in the doc. You will see it’s fairly easy then.

    the permission works like this
    Allowed URI (One URI per line) :

    Input ‘/’ to allow role access all URI.
    Input ‘/controller/’ to allow role access controller and it’s function.
    Input ‘/controller/function/’ to allow role access controller/function only.

    These rules only have effect if you use check_uri_permissions() in your controller

    In your case, it’s only the /controller/function. Hope this helped, again I am not sure if I got your point correctly. My appologies if I don’t.
    happy friday

  • #348 / Feb 08, 2009 2:11pm

    Spir

    139 posts

    I have notice that register_recaptcha_form is not set in config & co.

    I have added :

    in dx_auth configuration :

    $config['DX_register_recaptcha_view'] = 'auth/register_recaptcha_form';

    in DX_Auth library :

    $this->register_recaptcha_view = $this->ci->config->item('DX_register_recaptcha_view');

    So in my controller (register_recaptcha) I have :

    $this->load->view($this->dx_auth->register_recaptcha_view);
  • #349 / Feb 08, 2009 2:29pm

    Spir

    139 posts

    I got a captcha with login after one failed attempt. is there any means to desactivate that?

    Is there any example with re captcha for login?

  • #350 / Feb 08, 2009 7:14pm

    phazei

    46 posts

    I got a captcha with login after one failed attempt. is there any means to desactivate that?

    Is there any example with re captcha for login?

    The config file has settings for how many failed attempts are allowed.

    There are a number of other settings URI paths that aren’t set in the config file.

    When I used the captchas, I only saw the box asking for the code, I didn’t see any image at all, so I just turned it off.

  • #351 / Feb 09, 2009 4:13am

    Spir

    139 posts

    I had the same issue. I think I put my ‘captcha’ folder at the wrong place. But I would prefer to have the REcaptcha. I’ll find out how I can set it up for login.

  • #352 / Feb 09, 2009 2:44pm

    Iverson

    153 posts

    I really want to use this lib, as I’ve used it in previous versions and it was great. But I also use DataMapper! Meaning I use relationships, etc for my user database info. I successfully modified DX Auth’s code with DM’s code once, but that included changing core files, etc. i.e. code from hell…lol.

    @dexcell: Any way you see these two working together? Having an auth lib with pre-made functions (other than the one or two that DM comes with) would be unmatched in its functionality.

  • #353 / Feb 09, 2009 2:53pm

    Spir

    139 posts

    I also use DataMapper. i have decided to let them play both by their own. it means I have DataMapper for my datas and DX auth only for auth and secure part.

    I don’t think it’s relevant to mix them up since DX Auth works fine alone.

  • #354 / Feb 09, 2009 2:57pm

    Iverson

    153 posts

    I also use DataMapper. i have decided to let them play both by their own. it means I have DataMapper for my datas and DX auth only for auth and secure part.

    I don’t think it’s relevant to mix them up since DX Auth works fine alone.

    What about when you need more than just authentication. There are two parts to User management. Authenication and User info. When I need a system that has users, user’s payments, user’s subscriptions, and other type of relational data, DM is exactly what I need.

  • #355 / Feb 09, 2009 3:00pm

    Spir

    139 posts

    I agree with you. I also manage user with comments, some more profile infos & co. I have done another model specific for that matter. DX Auth use his own model and I use a Datamapper one. Maybe not clean but efficient for me.

  • #356 / Feb 12, 2009 9:49pm

    Xeoncross

    350 posts

    I have an admin area where I want to get a list of the other admins of the site and place them in a form. So I built this function to get the users of a certain group when you only have about 5-20 in that group.

    /**
         * Fetch all the users of a certain role (or higher)
         * 
         * @param $role
         * @return unknown_type
         */
        public function fetch_users_of_role($role=5, $parents=TRUE, $limit=30) {
            
            //SELECT * FROM `ci_dx_users` WHERE `role_id` = '2'
            
            $this->db->select('dx_users.username, dx_users.email, dx_users.id');
            
            //Include admins
            $this->db->where('dx_roles.id = 2');
            
            //Include this role
            $this->db->or_where('dx_roles.id = '. $role);
            
            //Also include parents?
            if($parents) {
                $this->db->or_where('dx_roles.parent_id >= '. $role);
            }
            
            $this->db->join('dx_roles', 'dx_roles.id = dx_users.role_id', 'left');
            $this->db->where('banned = 0');
            $this->db->limit($limit);
            $result = $this->db->get('dx_users');
            
            //If no rows are found
            if(!$result->num_rows()) { return; }
            
            //Return the rows
            return $result->result();
            
        }

    Then you can call that function and pass the result to a view like this (assuming you have a $row that has the value “user_id” in it).

    <label for="user_id"><b>Author</b></label>
        <select name="user_id" class="max">
            <?php 
            foreach($authors as $author) {
                $selected = '';
                if($author->id == $row->user_id) {
                    $selected = 'selected="selected"';
                }
        
                print '<option value="'. $author->id. '"'. $selected. '>'. $author->username. '</option>';
            }
            ?>
        </select>

    This is how I edit posts on one of my sites and I though I might share it.

  • #357 / Feb 16, 2009 10:01am

    karloff

    46 posts

    hey guys,

    can anyone help me with the best approach to encode the password which i have imported to my db.

    I have inserted the data into the db, however the password is not encoded. I’m looking to run through the entire db and use the _encode function with dx_auth to encode and return my password encrypted….. I’m obviously going wrong some where

    $query = $this->db->query('SELECT password FROM users');
            
            foreach ($query->result() as  $item) {
                
                $item  = crypt($this->dx_auth->_encode($item));    
                
                $this->db->insert('users', $item);
                
            }

    can anyone help me out on the correct way to pull and insert the info?

  • #358 / Feb 16, 2009 5:19pm

    llbbl

    324 posts

    It would be nice if you released this thing on code.google.com. Also add a link to the wiki page in your original post.

    http://codeigniter.com/wiki/DX_Auth/

    thanks


    *I don’t like that it sends the password after registration. This is bad security practice and if your going to include it as a feature, it should be turned OFF by default.

  • #359 / Feb 20, 2009 4:18am

    teenoi

    1 posts

    i have problem about resiter when i install and click link for register
    and input user name
    that show message

    “Your confirmation code has expired. Please try again.”

    ?

    how to fix about problem?

  • #360 / Feb 21, 2009 1:15pm

    gh0st

    130 posts

    Please integrate a flashdata status message system.

    I tried to customise it so that when a user logs out it creates a session flash message and redirects to the login page with the aforementioned message—however regardless of how hard I try the flash message never appears.

    The library as it is kills all session variables (which is incorrect) instead of just getting rid of the current user’s session.

    Thanks

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases