Jump to content

xauen

Member
  • Posts

    14
  • Joined

  • Last visited

About xauen

xauen's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. I am also looking for this. Any help guys?
  2. Go to Setup -> General Settings -> Ordering and check "Tick this box to generate random usernames for services rather than use the first 8 letters of the domain". You can have more than 1000 user and password generated for you.
  3. I have a custom Admin Services Tab function in our module. It is not getting errors on page but it is not showing on the Admin Product/Services tab (image link http://prntscr.com/fto3h). My WHMCS install is version 5.03 Please see below the module code: function thismodule_AdminServicesTabFields($params) { $link = mysql_connect($params["configoption1"], $params["configoption3"], $params["configoption4"]); if (!$link) { return 'Could not connect to MySQL'; } # Select DB $db_select = mysql_select_db($params["configoption2"], $link); if (!$db_select) { return 'Could not select database'; } # Select row from database $sql1 = mysql_query("SELECT `port` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); $sql2 = mysql_query("SELECT `port2` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); $sql3 = mysql_query("SELECT `port3` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); if (!$sql1) { return 'Could not select row from database '.mysql_error($link); } else { return 'success'; } $fieldsarray = array( 'Field 1' => '<input type="text" name="modulefields[0]" size="30" value="'.$sql1.'" />', 'Field 2' => '<input type="text" name="modulefields[1]" size="30" value="'.$sql2.'" />', 'Field 3' => '<input type="text" name="modulefields[2]" size="30" value="'.$sql3.'" />', ); return $fieldsarray; } Hope you can help me with this
  4. I have a custom Admin Services Tab function in our module. It is not getting errors on page but it is not showing on the Admin Product/Services tab (image link http://prntscr.com/fto3h). My WHMCS install is version 5.03 Please see below the module code: function thismodule_AdminServicesTabFields($params) { $link = mysql_connect($params["configoption1"], $params["configoption3"], $params["configoption4"]); if (!$link) { return 'Could not connect to MySQL'; } # Select DB $db_select = mysql_select_db($params["configoption2"], $link); if (!$db_select) { return 'Could not select database'; } # Select row from database $sql1 = mysql_query("SELECT `port` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); $sql2 = mysql_query("SELECT `port2` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); $sql3 = mysql_query("SELECT `port3` FROM `userdata` WHERE `username` = '".$params["username"]."'", $link); if (!$sql1) { return 'Could not select row from database '.mysql_error($link); } else { return 'success'; } $fieldsarray = array( 'Field 1' => '<input type="text" name="modulefields[0]" size="30" value="'.$sql1.'" />', 'Field 2' => '<input type="text" name="modulefields[1]" size="30" value="'.$sql2.'" />', 'Field 3' => '<input type="text" name="modulefields[2]" size="30" value="'.$sql3.'" />', ); return $fieldsarray; } Hope you can help me with this
  5. Hi, I am coding a voucher code module but im encountering some problems with CreateAccount() function. 1. The function of the module it to create a voucher code then saving those code to the remote database. The quantity of the voucher code depends on what the client enter in the configurable option named "Voucher Quantity". 2. However, the problem is that It is not saving at all to the database and no voucher code is generated. Also, I doubt the looping is correct also. 3. Some small help would be greatly appreciated. Below is the custom function and createAccount() function: function voucher_ConfigOptions() { # Should return an array of the module options for each product - maximum of 24 $configarray = array( "Database Hostname" => array( "Type" => "text", "Size" => "35", ), "Database Name" => array( "Type" => "text", "Size" => "35", ), "Database Username" => array( "Type" => "text", "Size" => "35", ), "Database Password" => array( "Type" => "password", "Size" => "35", ), "Voucher Qty" => array( "Type" => "text", "Size" => "35", ), ); return $configarray; } function voucher_CreateAccount($params) { # Connect to remote MySQL database $link = mysql_connect($params["configoption1"], $params["configoption3"], $params["configoption4"]); if (!$link) { return 'Could not connect to MySQL'; } # Select DB $db_select = mysql_select_db($params["configoption2"], $link); if (!$db_select) { return 'Could not select database'; } $i = 1; while($i <= $params['configoptions'][$result_row['Voucher Quantity']]) { $voucher_code = voucher_vouchercode() . '-' . voucher_vouchercode() . '-' . voucher_vouchercode(); //$result = $db->sql_query("SELECT code_name FROM vouchers WHERE code_name='$gen'"); //$chk = $db->sql_numrows($result); $sql = mysql_query("INSERT INTO `vouchers` (`code_name`, `duration`) VALUES('".$voucher_code."', '2592000')", $link); if (!$sql) { return 'Could not insert row into database '.mysql_error($link); } break; $i++; } return 'success'; } function voucher_vouchercode() { $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; mt_srand((double)microtime()*1000000); $i = 0; while ($i <= 4) { $num = mt_rand() % 33; $tmp = substr($chars, $num, 1); $pwd = $pwd . $tmp; $i++; } return $pwd; }
  6. Hi, I have almost the same situation as yours. The only difference is i want the tblcustomfieldsvalues.value to be changed as the user updates the tblhosting.password field. However, while the tblhosting.password field is change thru update_query() function, I cannot seem to do it on the tblcustomfieldsvalues.value coz of multilple table referencing. See attached code below: Its not working. Can you please tell me whats wrong with my code?
  7. Hi, This is the project details: 1. Module must insert data like generated username & password into the external mysql database. 2. ConfigOption "slot" shall be admin created in 'Module Settings" and must also be inserted into the external mysql database on module "create". 3. Must be able to terminate a client and remove client data on external db upon module 'terminate" account. $50 is my max price for this simple script. Please email me hypernet28@yahoo.com or reply to this thread for more information.
  8. Hi Bradh, Thank you for the reply. However, I need this as a provisioning module. I think im getting the hang of it already. thank you again!
  9. Hi Htb, Already emailed you. Thank you! xauen
  10. Hi htb make me custom whmcs->mysql(external db) module, so I can manage my openvpn clients. Please email me at hypernet28@yahoo.com for the quote. 1. Must be able to provision: a. client username b. password (md5 hash) c. service (we can talk about what info we can assign here) d. Bandwidth Plan e. Password reset Thank you, xauen
  11. Hi, I would like to connect to a remote mysql server once module "create" is initiated but im having problem what variable (in color red) to use to populate the username, password, email and service in my remote server with the client values in his/her whmcs. Please check the code below. please function sample_CreateAccount($params) { $dbhost = 'fake'; $dbuser = 'fake'; $dbpass = 'fake'; $dbname = 'fake'; $conn = mysql_connect($GLOBALS['db_host'], $GLOBALS['db_username'], $GLOBALS['db_password']); mysql_select_db($GLOBALS['db_name']); mysql_query("INSERT INTO users (username, password, email, service) VALUES ('[color="red"]I dont know what variable name to use??[/color]')", $conn); mysql_close($conn); if ($successful) { $result = "Client Provisioning Successful"; } else { $result = "Client Provisioning Failed"; } return $result; } Hope my explanation is clear sorry for my not so good english. Thank you in advance to anyone who can help me,
  12. HI SpoTTeh, Please email me also at Hypernet28@yahoo.com or you can give me your email and I will message you. We are interested.
×
×
  • 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