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

Well yes, when you use a verify method, you must provide an alternative. I often do this with AJAX calls, because you don't want to redirect to login for an ajax call. Instead, it ends up being something like this:


PHP Code:
if( $this->verify_role('admin') )
{
  // Do admin stuff
}

// No admin logged in
else
{
  // echo json_encode(['status' => 'no_auth']);

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