Skip to content

Instantly share code, notes, and snippets.

@arabsalem
Created November 27, 2014 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arabsalem/8f99d41e29ceef180c71 to your computer and use it in GitHub Desktop.
Save arabsalem/8f99d41e29ceef180c71 to your computer and use it in GitHub Desktop.
phpmaker user info
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.='&nbsp;&nbsp;Level: ';
$UserInfo.='<strong>' . $GLOBALS["Security"]->CurrentUserLevelName() . '</strong>';
$UserInfo.='&nbsp;&nbsp;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.= '&nbsp;&nbsp;==>&nbsp;&nbsp;' . '<strong>' . getCountryName($GLOBALS["Security"]->CurrentUserInfo('country_id')) . '</strong>';
break;
case SCOPE_REGIONAL_OFFICE:
$UserInfo.= '<strong>' . getLookupValue(SCOPE_REGIONAL_OFFICE) . '</strong>';
$UserInfo.= '&nbsp;&nbsp;==>&nbsp;&nbsp;' . '<strong>' . getLookupValue($GLOBALS["Security"]->CurrentUserInfo('regional_office_id')) . '</strong>';
break;
case SCOPE_UNIT:
$UserInfo.= '<strong>' . getLookupValue(SCOPE_UNIT) . '</strong>';
$UserInfo.= '&nbsp;&nbsp;==>&nbsp;&nbsp;' . '<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