Module Init Master Admin

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
How to get if logged in User is in the "Master Admin" group - from custom Module _init() function?
updated by @softdesigns: 01/26/18 10:44:36AM
paul
@paul
7 years ago
4,332 posts
The 'jrUser_is_master()' function returns 'true' if logged in user is a Master.
Does that help?


--
Paul Asher - JR Developer and System Import Specialist
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@paul - That sounds like what we need. Will study and test...
--
Great Support :)
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@paul - This function below seems to return opposite result ?
Logged in as "master admin" , yet function below returns "User Not Admin" ?
Do you see anything wrong with this logic below ?
	$sMsg = "0";
	if (jrUser_is_master()) {
		$sMsg = "USER = MASTER_ADMIN";
	} else {
		$sMsg = "USER NOT ADMIN";
	}
	jrCore_logger("INF", $_sModule."-:-".$sMsg, "");


updated by @softdesigns: 10/26/17 01:32:39PM
brian
@brian
7 years ago
10,148 posts
See my follow up on your other post:

https://www.jamroom.net/the-jamroom-network/forum/new_posts/54741/module-init-get-userid#last


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@brian - Ahh - ok it makes sense : Custom Module _init() runs BEFORE Session, so we cannot access those functions yet..
--
Question: New Custom Module written today - needs to run ONLY for "Non Master Admins" : So basically - run the module for normal standard users, but do NOT run the module for "Master Admins"
--
How could we code that ?
Please Advise...

Tags