Переглянути джерело

[svn r15800] Hide password in installation process - see FS#2680 - by Daniel Perales

Yannick Warnier 16 роки тому
батько
коміт
efac786fb7

+ 2 - 2
main/install/index.php

@@ -537,7 +537,7 @@ elseif($_POST['step5'])
 
 	<?php echo get_lang('DBHost').' : '.$dbHostForm; ?><br />
 	<?php echo get_lang('DBLogin').' : '.$dbUsernameForm; ?><br />
-	<?php echo get_lang('DBPassword').' : '.$dbPassForm; ?><br />
+	<?php echo get_lang('DBPassword').' : '.str_repeat('*',strlen($dbPassForm)); ?><br />
 	<?php if(!empty($dbPrefixForm)) echo get_lang('DbPrefixForm').' : '.$dbPrefixForm.'<br />'; ?>
 	<?php echo get_lang('MainDB').' : <b>'.$dbNameForm; ?></b><?php if($installType == 'new') echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)'; ?><br />
 	<?php 
@@ -680,4 +680,4 @@ else
 	&nbsp;
 </div>
 </body>
-</html>
+</html>

+ 2 - 2
main/install/install_db.inc.php

@@ -61,7 +61,7 @@ if(mysql_errno() > 0)
 	Please check these values:<br /><br />
 	<b>host</b> : '.$dbHostForm.'<br />
 	<b>user</b> : '.$dbUsernameForm.'<br />
-	<b>password</b> : '.$dbPassForm.'<br /><br />
+	<b>password</b> : '.str_repeat('*',strlen($dbPassForm)).'<br /><br />
 	Please go back to step 3.
 	<p><input type="submit" name="step3" value="&lt; Back" /></p>
 	</td></tr></table></form></body></html>';
@@ -223,4 +223,4 @@ mysql_select_db($mysqlUserDb) or die(mysql_error());
 
 load_database_script('dokeos_user.sql');
 
-?>
+?>

+ 6 - 2
main/install/install_functions.inc.php

@@ -731,7 +731,11 @@ function display_database_parameter($install_type, $parameter_name, $form_field_
 	}
 	else
 	{
-		echo '<td><input type="text" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$form_field_name.'" id="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'."</td>\n";
+		if ( $form_field_name == 'dbPassForm' ) {
+			echo '<td><input type="password" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$form_field_name.'" id="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'."</td>\n";
+		} else {
+			echo '<td><input type="text" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$form_field_name.'" id="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'."</td>\n";
+		}
 		echo "<td>$extra_notice</td>\n";
 	}
 	echo "</tr>\n";
@@ -1154,4 +1158,4 @@ function test_db_connect ($dbHostForm, $dbUsernameForm, $dbPassForm, $singleDbFo
 	return($dbConnect); //return "1"if no problems, "0" if, in case of multiDB we can't create a new DB and "-1" if there is no connection.
 }
 
-?>
+?>