Created
November 27, 2014 09:42
-
-
Save arabsalem/8f99d41e29ceef180c71 to your computer and use it in GitHub Desktop.
phpmaker user info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Page_Rendering() { | |
//echo "Page Rendering"; | |
//$role = $GLOBALS["Security"]->CurrentUserLevelName(); | |
//echo $role; | |
if (IsLoggedIn()) { | |
$UserInfo= '<div class="box-announcement alert-info"><div class="noprint">'; | |
$UserInfo.='<p>'; | |
$UserInfo.='Username: '; | |
$UserInfo.='<strong>' . $GLOBALS["Security"]->CurrentUserInfo('username') . '</strong>'; | |
$UserInfo.=' Level: '; | |
$UserInfo.='<strong>' . $GLOBALS["Security"]->CurrentUserLevelName() . '</strong>'; | |
$UserInfo.=' Scope: '; | |
switch ($GLOBALS["Security"]->CurrentUserInfo('scope_id')) { | |
case SCOPE_GLOBAL: | |
$UserInfo.= '<strong>' . getLookupValue(SCOPE_GLOBAL) . '</strong>'; | |
break; | |
case SCOPE_COUNTRY: | |
$UserInfo.= '<strong>' . getLookupValue(SCOPE_COUNTRY) . '</strong>'; | |
$UserInfo.= ' ==> ' . '<strong>' . getCountryName($GLOBALS["Security"]->CurrentUserInfo('country_id')) . '</strong>'; | |
break; | |
case SCOPE_REGIONAL_OFFICE: | |
$UserInfo.= '<strong>' . getLookupValue(SCOPE_REGIONAL_OFFICE) . '</strong>'; | |
$UserInfo.= ' ==> ' . '<strong>' . getLookupValue($GLOBALS["Security"]->CurrentUserInfo('regional_office_id')) . '</strong>'; | |
break; | |
case SCOPE_UNIT: | |
$UserInfo.= '<strong>' . getLookupValue(SCOPE_UNIT) . '</strong>'; | |
$UserInfo.= ' ==> ' . '<strong>' . getLookupValue($GLOBALS["Security"]->CurrentUserInfo('unit_id')) . '</strong>'; | |
break; | |
} | |
$UserInfo.='</div></div>'; | |
echo $UserInfo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment