View Issue Details

IDProjectCategoryView StatusLast Update
0012646mantisbtemailpublic2011-04-05 14:23
Reporterbeis Assigned Todhx  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.4 
Target Version1.2.5Fixed in Version1.2.5 
Summary0012646: No email with LDAP
Description

I have a correct configuration of email and LDAP-Server.
I have an additional 'normal' administrator account in the database.
If I comment this line in the config_inc.php out:

$g_login_method = LDAP;

and I change the Access Level the user get an email about the change.
If I uncommend the line (LDAP authentification is enabled) the user doesn't get an email.

Tagspatch
Attached Files
0001-Fix-12646-notification-email-not-sent-to-user-when-u.patch (2,133 bytes)   
From 3c10a62edfe0e88b09847b3e827d5fae22b7b8ba Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckserono.net>
Date: Wed, 5 Jan 2011 15:17:55 +0100
Subject: [PATCH] Fix #12646: notification email not sent to user when updating profile and LDAP=on

Problem was introduced in commit 7672ca3d7f000, changing from
$f_email to $t_email: one reference to $f_email was left out in the call to
email_store.

Changed the copyright to 2011.
---
 manage_user_update.php |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/manage_user_update.php b/manage_user_update.php
index f6380a1..ad70b44 100644
--- a/manage_user_update.php
+++ b/manage_user_update.php
@@ -17,7 +17,7 @@
 	/**
 	 * @package MantisBT
 	 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
-	 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
+	 * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 	 * @link http://www.mantisbt.org
 	 */
 	 /**
@@ -50,7 +50,6 @@
 
 	$t_user = user_get_row( $f_user_id );
 
-	$f_email	= trim( $f_email );
 	$f_username	= trim( $f_username );
 
 	$t_old_username = $t_user['username'];
@@ -87,7 +86,7 @@
 	if ( $t_ldap && config_get( 'use_ldap_email' ) ) {
 		$t_email = ldap_email( $f_user_id );
 	} else {
-		$t_email = email_append_domain( $f_email );
+		$t_email = email_append_domain( trim( $f_email ) );
 		email_ensure_valid( $t_email );
 		email_ensure_not_disposable( $t_email );
 	}
@@ -165,7 +164,7 @@
 			$t_subject = '[' . config_get( 'window_title' ) . '] ' . lang_get( 'email_user_updated_subject' );
 			$t_updated_msg = lang_get( 'email_user_updated_msg' );
 			$t_message = $t_updated_msg . "\n\n" . config_get( 'path' ) . 'account_page.php' . "\n\n" . $t_changes;
-			email_store( $f_email, $t_subject, $t_message );
+			email_store( $t_email, $t_subject, $t_message );
 			log_event( LOG_EMAIL, sprintf( 'Account update notification sent to ' . $f_username . ' (' . $t_email . ')' ) );
 			if ( config_get( 'email_send_using_cronjob' ) == OFF ) {
 				email_send_all();
-- 
1.7.1

Activities

dregad

dregad

2011-01-04 12:37

developer   ~0027793

You change the access level of which user, from what to what ?

beis

beis

2011-01-05 02:33

reporter   ~0027803

Every change of every user. E.g. from developer to manager or from manager to developer.

beis

beis

2011-01-05 03:29

reporter   ~0027805

The crazy thing is that:

I'm activated the logging for emails. If I change the access level there is a entry in the log-file. E.g.:

2011-01-04 17:14 CET mail Account update notification sent to xxx (xxx.xxx@xxx.com)

But no email will be send.

dregad

dregad

2011-01-05 08:32

developer   ~0027811

OK, I can replicate your problem now.

I believe it's caused by use of an incorrect variable in manage_user_update.php and should be quite simple to fix. I'll upload a patch later.

dregad

dregad

2011-01-05 09:26

developer   ~0027812

The attached patch fixes the problem for me.

beis

beis

2011-01-05 10:07

reporter   ~0027813

Yes, it works.

Thanks a lot.

dhx

dhx

2011-01-07 04:42

reporter   ~0027838

Thanks for the patch Damien! I have committed it to both branches.

Related Changesets

MantisBT: master 463f6717

2011-01-05 09:17

Damien Regad

Committer: dhx


Details Diff
Fix 0012646: notification email not sent to user when updating profile and LDAP=on

Problem was introduced in commit 7672ca3d7f000, changing from
$f_email to $t_email: one reference to $f_email was left out in the call to
email_store.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0012646
mod - manage_user_update.php Diff File

MantisBT: master-1.2.x 132fd5db

2011-01-05 09:17

Damien Regad

Committer: dhx


Details Diff
Fix 0012646: notification email not sent to user when updating profile and LDAP=on

Problem was introduced in commit 7672ca3d7f000, changing from
$f_email to $t_email: one reference to $f_email was left out in the call to
email_store.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0012646
mod - manage_user_update.php Diff File