added a new feature that allows you to create files by uploading files. this also allows creation of directories.
added new configuration items: commit_notification and commit_review_notification
This commit is contained in:
		| @ -257,6 +257,16 @@ code_folder_readme = "README.wiki,README.txt,README" | ||||
| ;------------------------------------------------------------------------------ | ||||
| email_sender = "" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; Send notification upon a new commit if yes | ||||
| ;------------------------------------------------------------------------------ | ||||
| commit_notification = "yes" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; Send commit review notification if yes | ||||
| ;------------------------------------------------------------------------------ | ||||
| commit_review_notification = "yes" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; URL to include when sending a commit notification message. | ||||
| ; You can specify multiple urls. in fact, it's a free text. | ||||
|  | ||||
| @ -55,6 +55,7 @@ sub get_config | ||||
| 		database_prefix => $cfg->param ("database_prefix"), | ||||
|  | ||||
| 		email_sender => $cfg->param ("email_sender"), | ||||
| 		commit_notification => $cfg->param ("commit_notification"), | ||||
| 		commit_notification_url => $cfg->param ("commit_notification_url") | ||||
| 	}; | ||||
|  | ||||
| @ -340,6 +341,11 @@ sub email_message_to_project_members | ||||
| 		Message => $message | ||||
| 	); | ||||
|  | ||||
| 	if (length($cfg->{email_sender}) > 0) | ||||
| 	{ | ||||
| 		$mail{From} .= $cfg->{email_sender}; | ||||
| 	} | ||||
|  | ||||
| 	Mail::Sendmail::sendmail (%mail); | ||||
| 	return (1, undef); | ||||
| } | ||||
| @ -383,19 +389,22 @@ if (!defined($dbh)) | ||||
|  | ||||
| write_commit_log ($dbh, $cfg->{database_prefix}, $REPOBASE, $REV, $AUTHOR); | ||||
|  | ||||
| my $commit_subject = "Commit r$REV by $AUTHOR in $REPOBASE"; | ||||
| my $commit_message = ''; | ||||
|  | ||||
| if ($cfg->{commit_notification_url} eq '') | ||||
| if (lc($cfg->{commit_notification}) eq 'yes') | ||||
| { | ||||
| 	$commit_message = $commit_subject; | ||||
| } | ||||
| else | ||||
| { | ||||
| 	$commit_message = 'See ' . format_commit_url($cfg->{commit_notification_url}, $REPOBASE, $AUTHOR, $REV); | ||||
| } | ||||
| 	my $commit_subject = "Commit r$REV by $AUTHOR in $REPOBASE"; | ||||
| 	my $commit_message = ''; | ||||
|  | ||||
| email_message_to_project_members ($cfg, $dbh, $cfg->{database_prefix}, $REPOBASE, $commit_subject, $commit_message); | ||||
| 	if ($cfg->{commit_notification_url} eq '') | ||||
| 	{ | ||||
| 		$commit_message = $commit_subject; | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		$commit_message = 'See ' . format_commit_url($cfg->{commit_notification_url}, $REPOBASE, $AUTHOR, $REV); | ||||
| 	} | ||||
|  | ||||
| 	email_message_to_project_members ($cfg, $dbh, $cfg->{database_prefix}, $REPOBASE, $commit_subject, $commit_message); | ||||
| } | ||||
|  | ||||
| close_database ($dbh); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user