Welcome Guest, Not a member yet? Register   Sign In
Community Auth - User Levels
#4

(08-31-2016, 03:36 AM)easymusic Wrote: Thanks for the swift reply, but I have two more question.
I call require_min_level (x) to force authentication, but can I use require_min_role (x)? or can it not be done?
Also using verify_min_level, why is it that I get a blank page if I do not have that specific level, is there a way to put a message that you simply do not have access to this page?

You just use the two methods differently.

Let's say you want to allow any user from level 284 to 10000000 to have access, then:

PHP Code:
if( $this->require_min_level(284) ){
  // levels 284 to 10000000 have access ....


But, if you want to instead grant access to the two roles foo and bar:

PHP Code:
if( $this->require_role('foo,bar') ){
  // Only roles foo and bar have access ....


There is no method "require_min_role".

Finally, if you want to allow any user that is logged in to have access, try either:

PHP Code:
if( $this->require_min_level(0) ) {}

// OR

if( $this->require_min_level(1) ) {} 
Reply


Messages In This Thread
Community Auth - User Levels - by easymusic - 08-24-2016, 02:05 AM
RE: Community Auth - User Levels - by skunkbad - 08-24-2016, 06:18 PM
RE: Community Auth - User Levels - by easymusic - 08-31-2016, 03:36 AM
RE: Community Auth - User Levels - by skunkbad - 08-31-2016, 06:53 AM
RE: Community Auth - User Levels - by easymusic - 08-31-2016, 09:53 AM
RE: Community Auth - User Levels - by skunkbad - 08-31-2016, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB