magento如何加密連接
Magento后臺(tái)配置設(shè)置的時(shí)候有時(shí)候需要加密保存,如一些關(guān)鍵的賬號(hào)密碼就不應(yīng)該明文保存到數(shù)據(jù)庫和顯示在前臺(tái)。
那么你知道m(xù)agento如何加密連接嗎?<appsecret translate="label"> <label>appsecret</label> <frontendtype>password</frontendtype> <backendmodel>adminhtml/systemconfigbackendencrypted</backendmodel> <sortorder>2</sortorder> <showindefault>1</showindefault> <showinwebsite>1</showinwebsite> <showinstore>0</showinstore> </appsecret> 獲取值得代碼 $appSecret = Mage::getStoreConfig('facebooklogin/setting/appsecret', $storeId);直接拿getStoreConfig 獲取到的值是經(jīng)過加密的,還需要解密才能用。
解密代碼$appSecret = Mage::helper('core')->decrypt($appSecret);配置文件中設(shè)置<frontendtype>password</frontendtype,前臺(tái)可以看到字符。
frontend-type-password 不顯示配置文件中設(shè)置<frontendtype>obscure</frontendtype>即可。
本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點(diǎn)和立場。
轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。