You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
548 B

<?php
/**
* Tests whether a user is in a specific group, usage:
*
* {if 'Admins'|in_group}...
* or
* {if 'Group Name'|in_group:'testuser'}...
*
* @param string $group group name to test (string being "modified")
* @param string $auser user name to check if not current logged-in user
* @return bool
* @throws Exception
*/
function smarty_modifier_in_group($group, $auser = '')
{
global $user;
if (! $auser) {
$auser = $user;
}
return TikiLib::lib('user')->user_is_in_group($auser, $group);
}