Security Suite - Display Security Group Name on template

We are using SuiteCRM 7.2.2. Each user is assigned to one Security Group. How can we have the Security Group Name displayed on all pages in the header??

I figured out how to do this. If you have a better idea please reply.
This code displays the Security Group Name in the top menu bar. Code placed in themes/Suite7/tpls/_globalLinks.tpl under the “globalLinks” div.
This works for my situation because each user will only be assigned to One Security Group.

<div style="position:absolute; margin-left:500px;margin-top:10px;color:white;font-weight:bold;font-size:12px;">
{php}

$db = DBManagerFactory::getInstance();
$curUserID = $this->_tpl_vars['CURRENT_USER_ID'];
$uGroup = $db->query("select name
from securitygroups
where id=(select securitygroup_id from securitygroups_users WHERE  user_id like '".$curUserID."')");
$Group = $db->fetchByAssoc($uGroup);
echo $Group['name'];

 {/php}</div>
1 Like