youki Posted November 3, 2021 Share Posted November 3, 2021 Hello, i don't know WHMCS and we want to implement the function that a customer can request an Active Directory Account. Do we need an addon for that? I want the following steps: 1. User can enter the required information in corresponding fields/ controls (textboxes, dropdowns, checkboxes) . 2. User sends the request by button. 3. We confirm the request by button and the data will be send automatically to the active directory (by hook?!). Any tutorial? Regards 0 Quote Link to comment Share on other sites More sharing options...
youki Posted November 3, 2021 Author Share Posted November 3, 2021 Hi moderator, can you delete this post, i have to research a few things. 0 Quote Link to comment Share on other sites More sharing options...
youki Posted November 3, 2021 Author Share Posted November 3, 2021 Could you change it to the following questions? 1. I need to send data of a pending order by the "accept order" button to a domain controller. Where do i get the data from (database?) and do i need a hook to query the data that i can send it to the domain controller ? (How to send it, by hook?) 2. I need to query the domain controller for a value (active account) to show it on the product details page, how can i do it? (It has to be refreshed every time the user opens the details page) Regards 0 Quote Link to comment Share on other sites More sharing options...
youki Posted November 5, 2021 Author Share Posted November 5, 2021 Hey, you can delete my post. I've found it. Using the AcceptOrder Hook, getting the order by GetOrder and then sending it to the domain controller (not pretty shure how.) 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted November 10, 2021 Share Posted November 10, 2021 @youki please refer to our Community Guidelines rule 2.5 does indicate "Your posts assist other users, please do not delete content if you find an answer, please share this solution to help other users" therefore we will not be deleting this post. 0 Quote Link to comment Share on other sites More sharing options...
youki Posted November 10, 2021 Author Share Posted November 10, 2021 Hello, I don't get any further. How can i access the nested order data by key? I've tried it also with the json. I only get the first 4 values like: success101 Regards <?php use WHMCS\Database\Capsule; add_hook('AcceptOrder', 1, function($vars) { // Get current order id. $orderID = $vars['orderid']; $command = 'GetOrders'; $postData = array( 'id' => $orderID, ); $adminUsername = 'xxx'; // Optional for WHMCS 7.2 and later $results = localAPI($command, $postData, $adminUsername); $filename = "/WHMCS_TEST/Testfile.txt"; $f = fopen($filename, 'wb'); if (!$f) { die('Error creating the file ' . $filename); } //INFO - JSON Structure: GetOrders - WHMCS Developer Documentation $json = json_encode(array('data' => $results)); foreach($results as $result) { fputs($f, $result); foreach($result as $orders) { fputs($f, $orders); foreach($orders as $order) { $test = $order; fputs($f, $test); } } } fclose($f); }); 0 Quote Link to comment Share on other sites More sharing options...
youki Posted November 12, 2021 Author Share Posted November 12, 2021 Hey, i'm getting the error code 4 by decoding $results and $response. Does it make any sense to use WHMCS any longer?! Is it all broken?! Don't know, if i should try it with Interacting with the Database - WHMCS Developer Documentation, when it's already dead here? Does WHMCS works without bugs in general? 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.