[Fusionforge-commits] FusionForge branch master updated. 05de59878fccb6f83c7dc33840b05c6b03cdec09

Franck VILLAUME nerville at fusionforge.org
Sun Nov 24 12:03:18 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  05de59878fccb6f83c7dc33840b05c6b03cdec09 (commit)
      from  86000db068cb0bc26d005fd3e59089b363e7d8ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 05de59878fccb6f83c7dc33840b05c6b03cdec09
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 24 12:02:58 2013 +0100

    bug [#608]: add support for phpcaptcha plugin

diff --git a/src/www/sendmessage.php b/src/www/sendmessage.php
index 5f2f106..f1065ea 100644
--- a/src/www/sendmessage.php
+++ b/src/www/sendmessage.php
@@ -4,7 +4,7 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright 2002-2004 (c) GForge Team
- * Copyright 2010 (c) Franck Villaume
+ * Copyright 2010-2013, Franck Villaume - TrivialDev
  * http://fusionforge.org/
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -30,7 +30,7 @@ $toaddress = getStringFromRequest('toaddress');
 $touser = getStringFromRequest('touser');
 
 if (!$toaddress && !$touser) {
-	exit_missing_param('',array(_('toaddress'),_('touser')),'home');
+	exit_missing_param('', array(_('toaddress'), _('touser')), 'home');
 }
 
 if ($touser) {
@@ -38,11 +38,11 @@ if ($touser) {
 		check to see if that user even exists
 		Get their name and email if it does
 	*/
-	$result=db_query_params ('SELECT email,user_name FROM users WHERE user_id=$1',
-			array($touser)) ;
+	$result = db_query_params('SELECT email,user_name FROM users WHERE user_id=$1',
+			array($touser));
 
 	if (!$result || db_numrows($result) < 1) {
-		exit_error(_('That user does not exist.'),'home');
+		exit_error(_('That user does not exist.'), 'home');
 	}
 }
 
@@ -65,7 +65,7 @@ if (getStringFromRequest('send_mail')) {
 			force them to enter all vars
 		*/
 		form_release_key(getStringFromRequest('form_key'));
-		exit_missing_param('',array(_('Subject'),_('Body'),_('Name'),_('Email')),'home');
+		exit_missing_param('', array(_('Subject'), _('Body'), _('Name'), _('Email')), 'home');
 	}
 
 	// we remove the CRLF in all thoses vars. This is to make sure that there will be no CRLF Injection
@@ -78,10 +78,10 @@ if (getStringFromRequest('send_mail')) {
 		/*
 			send it to the toaddress
 		*/
-		$to=preg_replace('/_maillink_/i','@',$toaddress);
+		$to = preg_replace('/_maillink_/i', '@', $toaddress);
 		$to = util_remove_CRLF($to);
-		util_send_message($to,$subject,$body,$email,'',$name);
-		$HTML->header(array('title'=>forge_get_config ('forge_name').' ' ._('Contact')   ));
+		util_send_message($to, $subject, $body, $email, '', $name);
+		$HTML->header(array('title' => forge_get_config('forge_name').' ' ._('Contact')));
 		echo '<p>'._('Message has been sent').'.</p>';
 		$HTML->footer(array());
 		exit;
@@ -89,10 +89,10 @@ if (getStringFromRequest('send_mail')) {
 		/*
 			figure out the user's email and send it there
 		*/
-		$to=db_result($result,0,'email');
+		$to = db_result($result,0,'email');
 		$to = util_remove_CRLF($to);
-		util_send_message($to,$subject,$body,$email,'',$name);
-		$HTML->header(array('title'=>forge_get_config ('forge_name').' '._('Contact')));
+		util_send_message($to, $subject, $body, $email, '', $name);
+		$HTML->header(array('title' => forge_get_config('forge_name').' '._('Contact')));
 		echo '<p>'._('Message has been sent').'</p>';
 		$HTML->footer(array());
 		exit;
@@ -109,9 +109,11 @@ if (session_loggedin()) {
 	$user  =& session_get_user();
 	$name  = $user->getRealName();
 	$email = $user->getEmail();
+	$is_logged = true;
 } else {
 	$name  = '';
 	$email = '';
+	$is_logged = false;
 }
 $subject = getStringFromRequest('subject');
 
@@ -143,7 +145,7 @@ $HTML->header(array('title'=>forge_get_config ('forge_name').' Staff'));
 </p>
 <p>
 <strong><?php echo _('Your Email Address').utils_requiredField()._(':'); ?></strong><br />
-<input type="text" required="required" name="email" size="40" maxlength="255" value="<?php echo $email ?>" />
+<input type="email" required="required" name="email" size="40" maxlength="255" value="<?php echo $email ?>" />
 </p>
 <p>
 <strong><?php echo _('Subject').utils_requiredField()._(':'); ?></strong><br />
@@ -153,6 +155,11 @@ $HTML->header(array('title'=>forge_get_config ('forge_name').' Staff'));
 <strong><?php echo _('Message').utils_requiredField()._(':'); ?></strong><br />
 <textarea name="body" required="required" rows="15" cols="60"></textarea>
 </p>
+<?php
+if (!$is_logged) {
+	plugin_hook('captcha_form');
+}
+?>
 <p align="center">
 <input type="submit" name="send_mail" value="<?php echo _('Send Message') ?>" />
 </p>

-----------------------------------------------------------------------

Summary of changes:
 src/www/sendmessage.php |   33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list