Jump to content

Create custom module and set automatic Custom Fields


stelz

Recommended Posts

Hello, i want integrate our control panel and write module, but i don`t understand how to write Custom Field value from module script to billing system automatic.

I create Custom Field - veid

How i can set "veid" parmeter(returned from control panel api) in function myadmin_CreateAccount($params) for save it?

I see this work in HyperVM and SolusVM modules, but sources is closed.

Please help me, thanks!

Link to comment
Share on other sites

Answer on my ticket:

 

Hi,

 

To set a custom field value from within a module function you would need to perform an SQL update query on the database directly, for example:

 

mysql_query("UPDATE tblcustomfieldsvalues SET value='xxxx' WHERE fieldid=X and relid=$params['serviceid']");

 

Regards,

 

Matt

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 years later...

Opening up an old thread because my question seems relevant.

 

I have written a custom module, which has 3 custom fields to store the server, username and password for the product. The custom fields are displayed in the client area. All the integration (create, suspend, unsuspend, delete) works great, and now I want to allow changing passwords by the user. I've written a <module>_ChangePassword function and got it to work fine. To update the custom field with the new password, I use:

 

# Update the DB

$ChangePassword_query = "UPDATE tblcustomfieldsvalues SET value='".$vpn_password."' WHERE fieldid='5' AND relid=".$params['serviceid'];

mysql_query($ChangePassword_query);

 

The only problem is that the password displayed after a successful update is the previous password. To see the new password, I have to go back to services list then view details again, at which point the new password is displayed.

 

Is there any way to update the display of the custom fields in the ChangePassword function, or are the values already loaded into the template before the function runs?

 

Thanks in advance.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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