Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

PHP know Master User plugin used to login

  • jordiblanch
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 1 month ago #3635 by jordiblanch
PHP know Master User plugin used to login was created by jordiblanch
Dear Sirs,

I'm using your Master User extension in our website to login as another user and it works perfectly, but I would be very interesting for us to know if the user has logged into Joomla with it's own password or with a Master User password, so that we could program our own components to react to this and follow or not some steps depending on this.

Is there any kind of session variable or whatever that our component developer could use to test if the user has logged with it's own password or a Master User password?

Thank you very much for this excellent extension.

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

More
3 years 1 month ago - 3 years 1 month ago #3636 by boggler
Replied by boggler on topic PHP know Master User plugin used to login
At the moment there is no way to tell, as far as joomla is concerned the person who is logged in is the actual user. You would need to modify the plugin to set a session variable. You need to modify this code:-
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 = '';
          // add code to set session variable here
	 break;
  }

It is quite a good idea actually, we do occasionally get asked about this point.
Last edit: 3 years 1 month ago by boggler.
The following user(s) said Thank You: jordiblanch

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

  • jordiblanch
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 1 month ago #3637 by jordiblanch
Replied by jordiblanch on topic PHP know Master User plugin used to login
Perfect!!! Your solution worked perfectly, now we can check our own session variable and know if the user logged in as a Master User or not.

Thank you very much for your help!

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

More
2 years 8 months ago #3760 by Javier
Replied by Javier on topic PHP know Master User plugin used to login
Hi Jordi,
Could you share for non programmers how you identify master user when logged in?
There is possibility of making that identification via the activation of a module that is shown when it is active
In this post boggler shared code but it is quite complicated for me to take it to a custom module.

Best regards
Javier

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

  • jordiblanch
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 8 months ago #3761 by jordiblanch
Replied by jordiblanch on topic PHP know Master User plugin used to login
Hello Javier,

boggler approach is exactly what I did, so if you are not a programmer then I cannot help you either. I'm using some custom made components in my Joomla site, so I modified their code to know whether the user was a "Master User" or not.

Best regards.

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

Moderators: boggler
Time to create page: 0.278 seconds

Donate to Us

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