Jump to content

[Help] Product Custom Fields and Module


lamjed001

Recommended Posts

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 types

Note : custom field of type text do not encrypt
custom field of type password it become encrypted

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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=
        )

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated