浏览代码

Merge pull request #2003 from smeda/issue1995

gh-1995 Encrypt attributes of view type password

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父节点
当前提交
6400f2b38f
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 0
      esp/files/scripts/configmgr/navtree.js
  2. 2 2
      esp/services/WsDeploy/WsDeployService.cpp

+ 1 - 0
esp/files/scripts/configmgr/navtree.js

@@ -2265,6 +2265,7 @@ function promptVerifyPwd(category, params, attrName, oldValue, newValue, recordI
       var xmlArgs = "<XmlArgs><Setting category=\"" + category;
       xmlArgs += "\" params=\"" + params;
       xmlArgs += "\" attrName=\"" + attrName;
+      xmlArgs += "\" viewType=\"password";
       xmlArgs += "\" rowIndex=\"" + recordIndex;
       xmlArgs += "\" oldValue=\"" + escape(oldValue);
       xmlArgs += "\" newValue=\"" + escape(pwd) + "\"/></XmlArgs>";

+ 2 - 2
esp/services/WsDeploy/WsDeployService.cpp

@@ -929,6 +929,7 @@ bool CWsDeployFileInfo::saveSetting(IEspContext &context, IEspSaveSettingRequest
       const char* pszOldValue = pSetting->queryProp("@oldValue");
       const char* pszNewValue = pSetting->queryProp("@newValue");
       const char* pszOnChange = pSetting->queryProp("@onChange");
+      const char* pszViewType = pSetting->queryProp("@viewType");
 
       StringBuffer xpath;
       xpath.clear().appendf("%s[@name='%s']", pszCompType, pszCompName);
@@ -1293,8 +1294,7 @@ bool CWsDeployFileInfo::saveSetting(IEspContext &context, IEspSaveSettingRequest
         {
           xpath.clear().appendf("@%s", pszAttrName);
 
-          String strAttrName(pszAttrName);
-          if (strAttrName.toLowerCase()->endsWith("password"))
+          if (pszViewType && *pszViewType && !strcmp(pszViewType, "password"))
           {
             encrypt(encryptedText, pszNewValue);
             pszNewValue = encryptedText.str();