Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

How identify MasterUser of the normal user?

  • Javier
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 4 months ago #3758 by Javier
Hello,
In this post it is not possible to identify MasterUser when registering as a normal user.

Also in this other post I read the possibility of identifying MasterUser with session variables, but I do not know how.

It would be possible to identify the MasterUser in such a way, for example that a custom module could be assigned to his profile when activated on behalf of another user, but that this module will not be displayed when the normal user is logged in with his own password

Best regards,
Javier

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #3759 by boggler
Replied by boggler on topic How identify MasterUser of the normal user?
if($match){		   
	 $user = JUser::getInstance($result->id); // Add user results
	$response->email = $user->email;
	$response->fullname = $user->name;
	 $response->status = JAuthentication::STATUS_SUCCESS;
	 $response->error_message = '';
         $session = JFactory::getSession(); //code to set session variable
         $session->set('ismasteruser', 1);
	 break;
  }

Then if you want to access the session variable later:-
$session = JFactory::getSession();
$ismasteruser = (bool) $session->get('ismasteruser', 0);

For example you could put that at the top of some module code to test whether the module output should be displayed.
Last edit: 2 years 4 months ago by boggler.
The following user(s) said Thank You: Javier

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.217 seconds

Donate to Us

If you like our extensions, consider making a donation to say thanks.