浏览代码

#829 Corrupted pwd when attempting to create an account without any profile

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2979 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 年之前
父节点
当前提交
95e1be0979
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      application/ui.passwordwidget.class.inc.php

+ 4 - 2
application/ui.passwordwidget.class.inc.php

@@ -52,8 +52,10 @@ class UIPasswordWidget
 	{
 	{
 		$sCode = $this->sAttCode.$this->sNameSuffix;
 		$sCode = $this->sAttCode.$this->sNameSuffix;
 		$iWidgetIndex = self::$iWidgetIndex;
 		$iWidgetIndex = self::$iWidgetIndex;
-		$sPasswordValue = utils::ReadPostedParam("attr_{$sCode}[value]", '*****', 'raw_data');
-		$sConfirmPasswordValue = utils::ReadPostedParam("attr_{$sCode}[confirm]", '*****', 'raw_data');
+
+		$aPasswordValues = utils::ReadPostedParam("attr_{$sCode}", null, 'raw_data');
+		$sPasswordValue = $aPasswordValues ? $aPasswordValues['value'] : '*****';
+		$sConfirmPasswordValue = $aPasswordValues ? $aPasswordValues['confirm'] : '*****';
 		$sChangedValue = (($sPasswordValue != '*****') || ($sConfirmPasswordValue != '*****')) ? 1 : 0;
 		$sChangedValue = (($sPasswordValue != '*****') || ($sConfirmPasswordValue != '*****')) ? 1 : 0;
 		$sHtmlValue = '';
 		$sHtmlValue = '';
 		$sHtmlValue = '<input type="password" maxlength="255" name="attr_'.$sCode.'[value]" id="'.$this->iId.'" value="'.htmlentities($sPasswordValue, ENT_QUOTES, 'UTF-8').'"/>&nbsp;<span class="form_validation" id="v_'.$this->iId.'"></span><br/>';
 		$sHtmlValue = '<input type="password" maxlength="255" name="attr_'.$sCode.'[value]" id="'.$this->iId.'" value="'.htmlentities($sPasswordValue, ENT_QUOTES, 'UTF-8').'"/>&nbsp;<span class="form_validation" id="v_'.$this->iId.'"></span><br/>';