lamjed001 Posted December 29, 2020 Share Posted December 29, 2020 From WHMCS 8.0 i noticed that Custom Field of type password become encrypted, how ? when i get Custom Field ( type password ) value via my module to make account with this password i saw that password is encrypted i used decrypt($password) it works fine but when i change the custom field type to text so decrypt($password) will not work because password already decoded ( original value ) So my question is : how to get password from custom field ( type text btw this is not encrypted ) and from custom field ( type password encrypted ) because i need my addon to be compatible with both typesNote : custom field of type text do not encryptcustom field of type password it become encrypted 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted December 29, 2020 Share Posted December 29, 2020 You'll need to check the custom field type and decide from there what to do. Using the internal classes, that should be as easy as: if ($customfield->type === 'password') decryptpassword($customfield->customFieldValues->value); https://classdocs.whmcs.com/8.0/WHMCS/CustomField.html Getting the field it self can be done via a service object. 0 Quote Link to comment Share on other sites More sharing options...
lamjed001 Posted December 30, 2020 Author Share Posted December 30, 2020 10 hours ago, steven99 said: You'll need to check the custom field type and decide from there what to do. Using the internal classes, that should be as easy as: if ($customfield->type === 'password') decryptpassword($customfield->customFieldValues->value); https://classdocs.whmcs.com/8.0/WHMCS/CustomField.html Getting the field it self can be done via a service object. But it's like this in $parms The type is not known maybe WHMCS forgot to add it or something like that Any other solution ? [customfields] => Array ( [acc_password] => hnnk+njRWHJYVCgjf/D3TeHKGtEqFlxrwcbyq5s= ) 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.