[Fusionforge-commits] r7583 - in trunk/gforge: . etc/local.d www/account

Roland Mas lolando at libremir.placard.fr.eu.org
Tue May 5 13:28:11 CEST 2009


Author: lolando
Date: 2009-05-05 13:28:11 +0200 (Tue, 05 May 2009)
New Revision: 7583

Modified:
   trunk/gforge/etc/local.d/25features
   trunk/gforge/setup
   trunk/gforge/www/account/register.php
Log:
Make the acceptance of conditions a configurable item

Modified: trunk/gforge/etc/local.d/25features
===================================================================
--- trunk/gforge/etc/local.d/25features	2009-05-05 11:28:02 UTC (rev 7582)
+++ trunk/gforge/etc/local.d/25features	2009-05-05 11:28:11 UTC (rev 7583)
@@ -49,3 +49,5 @@
 //
 $sys_user_reg_restricted={sys_user_reg_restricted};
 
+// Require acceptance of terms and conditions
+$sys_require_accept_conditions={sys_require_accept_conditions};

Modified: trunk/gforge/setup
===================================================================
--- trunk/gforge/setup	2009-05-05 11:28:02 UTC (rev 7582)
+++ trunk/gforge/setup	2009-05-05 11:28:11 UTC (rev 7583)
@@ -117,6 +117,7 @@
 	DEFAULTsys_use_private_project=true
 	DEFAULTsys_project_reg_restricted=false
 	DEFAULTsys_user_reg_restricted=false
+	DEFAULTsys_require_accept_conditions=false
 	DEFAULTsys_localinc=$ETCDIR/local.inc
 	DEFAULTsys_jabber_pass=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
 	DEFAULTsys_plugins_path=$SHAREDIR/plugins/

Modified: trunk/gforge/www/account/register.php
===================================================================
--- trunk/gforge/www/account/register.php	2009-05-05 11:28:02 UTC (rev 7582)
+++ trunk/gforge/www/account/register.php	2009-05-05 11:28:11 UTC (rev 7583)
@@ -68,7 +68,10 @@
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
 		exit_form_double_submit();
 	}
-	if ($accept_conditions) {
+	
+	if ($GLOBALS['sys_require_accept_conditions'] && ! $accept_conditions) {
+		$feedback = _("You can't register an account unless you accept the terms of use.") ;
+	} else {
 		$new_user = new GFUser();
 		$register = $new_user->create($unix_name,$firstname,$lastname,$password1,$password2,
 					      $email,$mail_site,$mail_va,$language_id,$timezone,$jabber_address,$jabber_only,$theme_id,'',
@@ -82,8 +85,6 @@
 		} else {
 			$feedback = $new_user->getErrorMessage();
 		}
-	} else {
-		$feedback = _("You can't register an account unless you accept the terms of use.") ;
 	}
 }
 
@@ -188,12 +189,14 @@
 <input type="checkbox" name="mail_va" value="1" />
 <?php echo _('Receive additional community mailings. <i>(Low traffic.)</i>'); ?>
 </p>
+<?php if ($GLOBALS['sys_require_accept_conditions']) { ?>
+	<p>
+	<input type="checkbox" name="accept_conditions" value="0" />
+	<?php printf (_('Do you accept the <a href="%1$s">terms of use</a> for this site?'),
+		      util_make_url ('/terms.php')); ?>
+	</p>
+<?php } ?>
 <p>
-<input type="checkbox" name="accept_conditions" value="0" />
-				    <?php printf (_('Do you accept the <a href="%1$s">terms of use</a> for this site?'),
-						  util_make_url ('/terms.php')); ?>
-</p>
-<p>
 <?php printf(_('Fields marked with %s are mandatory.'), utils_requiredField()); ?>
 </p>
 <p>




More information about the Fusionforge-commits mailing list