View Issue Details

IDProjectCategoryView StatusLast Update
0004083mantisbtsponsorshipspublic2004-08-29 02:35
Reportervboctor Assigned Tothraxisp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version0.19.0rc1 
Summary0004083: Users without email address must not be able to sponsor issues
Description

For a user to be able to sponsor an issue the must have an email set.

TagsNo tags attached.
Attached Files
sponsor_email.diff (1,527 bytes)   
Index: bug_set_sponsorship.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_set_sponsorship.php,v
retrieving revision 1.1
diff -r1.1 bug_set_sponsorship.php
41,44d40
< 		$sponsorship = new SponsorshipData;
< 		$sponsorship->bug_id = $f_bug_id;
< 		$sponsorship->user_id = auth_get_current_user_id();
< 		$sponsorship->amount = $f_amount;
46c42,52
< 		sponsorship_set( $sponsorship );
---
> 		$t_user = auth_get_current_user_id();
> 		if ( is_blank( user_get_email( $t_user ) ) ) {
> 			trigger_error( ERROR_SPONSORSHIP_ASSIGNER_NO_EMAIL, ERROR );
> 		}else{
> 			$sponsorship = new SponsorshipData;
> 			$sponsorship->bug_id = $f_bug_id;
> 			$sponsorship->user_id = $t_user;
> 			$sponsorship->amount = $f_amount;
> 
> 			sponsorship_set( $sponsorship );
> 		}
Index: core/constant_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/constant_inc.php,v
retrieving revision 1.22
diff -r1.22 constant_inc.php
18a19
> 	define( 'AUTO', 2 );
92a94
> 	define( 'NIS', 				7 );
248a251
> 	define( 'ERROR_SPONSORSHIP_ASSIGNER_NO_EMAIL',	1705 );
Index: lang/strings_english.txt
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_english.txt,v
retrieving revision 1.187
diff -r1.187 strings_english.txt
216a217
> $MANTIS_ERROR[ERROR_SPONSORSHIP_ASSIGNER_NO_EMAIL] = 'Sponsor has not provided an email address. Please update your profile.';
sponsor_email.diff (1,527 bytes)   
sponsor_email.tar.gz (13,878 bytes)

Activities

thraxisp

thraxisp

2004-07-19 20:02

reporter   ~0006160

A patch is attached. It will flag an application error if the sponsoring user's email is not set. A new string was added in the english strings that will need translation.