Skip to content

Commit

Permalink
Roles will not be hide in email list if email is deactivated #827
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Sep 20, 2018
1 parent 1c5d94f commit 81ad80a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions adm_program/modules/messages/messages_write.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
}

$list = array();
$arrAllVisibleRoles = $gCurrentUser->getAllVisibleRoles();
$arrAllMailRoles = $gCurrentUser->getAllMailRoles();

if ($gValidLogin && $getMsgType === TableMessage::MESSAGE_TYPE_PM && count($arrAllVisibleRoles) > 0)
if ($gValidLogin && $getMsgType === TableMessage::MESSAGE_TYPE_PM && count($arrAllMailRoles) > 0)
{
$sql = 'SELECT usr_id, first_name.usd_value AS first_name, last_name.usd_value AS last_name, usr_login_name
FROM '.TBL_MEMBERS.'
Expand All @@ -105,7 +105,7 @@
LEFT JOIN '.TBL_USER_DATA.' AS first_name
ON first_name.usd_usr_id = usr_id
AND first_name.usd_usf_id = ? -- $gProfileFields->getProperty(\'FIRST_NAME\', \'usf_id\')
WHERE rol_id IN ('.replaceValuesArrWithQM($arrAllVisibleRoles).')
WHERE rol_id IN ('.replaceValuesArrWithQM($arrAllMailRoles).')
AND cat_name_intern <> \'EVENTS\'
AND ( cat_org_id = ? -- $currOrgId
OR cat_org_id IS NULL )
Expand All @@ -121,7 +121,7 @@
$gProfileFields->getProperty('LAST_NAME', 'usf_id'),
$gProfileFields->getProperty('FIRST_NAME', 'usf_id')
),
$arrAllVisibleRoles,
$arrAllMailRoles,
array(
$currOrgId,
DATE_NOW,
Expand Down Expand Up @@ -346,7 +346,7 @@
if(count($sqlRoleIds) === 0)
{
// if only send mail to one user than this user must be in a role the current user is allowed to see
$listVisibleRoleArray = $arrAllVisibleRoles;
$listVisibleRoleArray = $gCurrentUser->getAllVisibleRoles();
}
else
{
Expand Down Expand Up @@ -381,7 +381,7 @@
}

$list = array_merge($list, $listFormer, $listActiveAndFormer);
$listVisibleRoleArray = array_intersect($listRoleIdsArray, $arrAllVisibleRoles);
$listVisibleRoleArray = array_intersect($listRoleIdsArray, $gCurrentUser->getAllVisibleRoles());
}

if($getRoleId === 0 && count($listVisibleRoleArray) > 0)
Expand Down
1 change: 0 additions & 1 deletion adm_program/modules/roles/roles_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
{
$_POST['rol_assign_roles'] = 1;
$_POST['rol_all_lists_view'] = 1;
$_POST['rol_mail_to_all'] = 1;
}

if($role->getValue('cat_name_intern') === 'EVENTS')
Expand Down

0 comments on commit 81ad80a

Please sign in to comment.