View Full Version : Create custom module and set automatic Custom Fields
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!
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
zoilodiaz
02-20-10, 05:09 AM
Hello,
a module for SolusVM like this one ?
http://wiki.solusvm.com/index.php/HostBill_Module
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.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.