Skip to content

Commit

Permalink
E-Mail profile field within list of members module causes an error o…
Browse files Browse the repository at this point in the history
…n search #1162
  • Loading branch information
Fasse committed Jan 8, 2022
1 parent ec21a85 commit a7783db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions adm_program/modules/members/members_data.php
Expand Up @@ -181,7 +181,7 @@
(SELECT email.usd_value FROM '.TBL_USER_DATA.' email
WHERE email.usd_usr_id = usr_id
AND email.usd_usf_id = ? /* $gProfileFields->getProperty(\'email\', \'usf_id\') */
) AS email, '.
) AS member_email, '.
substr($mainSql, 15);
$queryParamsMain = array(
$gProfileFields->getProperty('EMAIL', 'usf_id')
Expand Down Expand Up @@ -250,7 +250,7 @@
// Administrators can change or send password if login is configured and user is member of current organization
if ($memberOfThisOrganization && $gCurrentUser->isAdministrator()
&& strlen($row['loginname']) > 0 && (int) $row['usr_id'] !== $gCurrentUserId) {
if (strlen($row['email']) > 0 && $gSettingsManager->getBool('enable_system_mails')) {
if (strlen($row['member_email']) > 0 && $gSettingsManager->getBool('enable_system_mails')) {
// if email is set and systemmails are activated then administrators can send a new password to user
$userAdministration = '<a class="admidio-icon-link" href="'.SecurityUtils::encodeUrl(ADMIDIO_URL.FOLDER_MODULES.'/members/members_function.php', array('user_uuid' => $row['usr_uuid'], 'mode' => 5)).'">'.
'<i class="fas fa-key" data-toggle="tooltip" title="' . $gL10n->get('SYS_SEND_USERNAME_PASSWORD') . '"></i></a>';
Expand All @@ -263,14 +263,14 @@
}

// add link to send email to user
if (strlen($row['email']) > 0) {
if (strlen($row['member_email']) > 0) {
if (!$gSettingsManager->getBool('enable_mail_module')) {
$mailLink = 'mailto:'.$row['email'];
$mailLink = 'mailto:'.$row['member_email'];
} else {
$mailLink = SecurityUtils::encodeUrl(ADMIDIO_URL.FOLDER_MODULES.'/messages/messages_write.php', array('user_uuid' => $row['usr_uuid']));
}
$userAdministration .= '<a class="admidio-icon-link" href="'.$mailLink.'">'.
'<i class="fas fa-envelope" data-toggle="tooltip" title="' . $gL10n->get('SYS_SEND_EMAIL_TO', array($row['email'])) . '"></i></a>';
'<i class="fas fa-envelope" data-toggle="tooltip" title="' . $gL10n->get('SYS_SEND_EMAIL_TO', array($row['member_email'])) . '"></i></a>';
}

$userAdministration .= '<a class="admidio-icon-link" href="'.SecurityUtils::encodeUrl(ADMIDIO_URL.FOLDER_MODULES.'/profile/profile_new.php', array('user_uuid' => $row['usr_uuid'], 'copy' => 1)).'">'.
Expand Down

0 comments on commit a7783db

Please sign in to comment.