Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Group problem
  • hello
    simpleauth.php made ​​from the group settings.

    100 the value of a new member registration and group'm doing.

    I would also check with a controller function that I created before.

    code:

      if (!Auth::member(1)  and Request::active()->action != 'login') {
                 Response::redirect('message/error');
            }

    Despite the high value of the member's group is doing the routing.

    Why is this?
  • The group is not a 'level' value, it's a discrete group id. So 1 !== 100.
  • How can I use a group level as well?
  • 'groups' => array(
            -1 => array('name' => 'Banned', 'roles' => array('banned')),
            0 => array('name' => 'Guests', 'roles' => array()),
            1 => array('name' => 'Users', 'roles' => array('user')),
            50 => array('name' => 'Moderators', 'roles' => array('user', 'moderator')),
            100 => array('name' => 'Administrators', 'roles' => array('user', 'moderator', 'admin')),

    Also included in the administrator user group means the above code is not it?
  • It's just a number and a name. As in "you are member of Administrators".

    If you want it to behave like a level ( so member(50) returns true if you are administrator), you'll have to extend the Auth driver class that provides the method and overload it.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion