
steven99
Member-
Content Count
685 -
Joined
-
Last visited
-
Days Won
17
steven99 last won the day on January 9
steven99 had the most liked content!
Community Reputation
84 ExcellentAbout steven99

-
Rank
Level 2 Member
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Using the ClientLoginShare hook in WHMCS that then authenticates against the Laravel users would work for logging in via the WHMCS client area. If you wanted to authenticate WHMCS users at the laravel side, you could use the ValidateLogin API call at laravel .
-
steven99 started following eNom Configuration, Hide Configurable Option based on selection, WHMCS API and and 5 others
-
Hide Configurable Option based on selection
steven99 replied to Oliver F's topic in Developer Corner
I believe the only option is injecting javascript that waits for field changes and decides what to do next. There might a module out there that does this already but bit swamped to search. 😉 Using an output hook or template variable override hook would give you the chance to inject that javascript. -
If you mean can you pull all the data that is shown in WHMCS client area and display that within your own Laravel panel? Should be able to pull services, invoices, tickets, etc . Just decide what you want to show there and check the API for the call. https://developers.whmcs.com/api/api-index/ lists all the built-in api calls.
-
Making addon A required to order addon B
steven99 replied to Newton's topic in Admin & Configuration Questions
That would work but it presumes that both addons are wanted and not just addon A without addon b. -
If you're trying to include another smarty template file, I have just passed a templatefolder variable that puts to __DIR__ . "/templates/" but that has been on server modules .
-
Making addon A required to order addon B
steven99 replied to Newton's topic in Admin & Configuration Questions
I don't think that is possible out of the box. What could be done is checkout validation hook and if trying to add addon B without A produce an error. ShoppingCartValidateCheckout would likely be best option. This does require PHP skills though. -
You would need an addon module to do the authentication against. A hook watching for a specific GET might work also. Following the article about setting up SSO should help with at least discourse's side.
-
In the server module's _Clientarea() function, status is in $params['status']. For example: if ($params['status'] == "Cancelled") { $Cancel = Capsule::table('tblcancelrequests')->where('relid', '=', $params['serviceid'])->first(); if ($Cancel) $Reason = $Cancel->reason; else $Reason = "Reason not provided"; return array( 'tabOverviewReplacementTemplate' => "templates/fatal_error", 'vars' => array('message'=>"Service has been cancelled with the following reason:<br><br>$Reason" ) ); } Then in templates/fatal_error, have: <div class="alert alert-danger">Error: {$message}</div> (templates is relative to the server module's directory) For template it self, within the server module template at least, you would use:{if $status eq "Cancelled"} but that isn't needed if you use the above within the server module.
-
Payment Gateways disallow based on invoice total
steven99 replied to anderbytes's topic in Developer Corner
You'll want the token as that is for CSRF and the token is used to ensure the request is coming from a form that was generated by the app and not some bot trying to do XSS attacks. -
Take a clean install of WHMCS and place it on a dev.example.com where example.com is your real domain and ensure you block public access. Or if you have a dev environment setup for PHP locally, set it up there. Deploying a module to whmcs can be done in two methods and depends on how WHMCS is setup - locally or remotely. For locally, you could just setup the module folder within the install and setup git within that folder. For remotely setup dev of WHMCS, the method I use is pushing to remote git repo and then cloning the repo in the addons / servers folders. Then when needed, I'll do a git pull using SSH within that module's folder. Plesk has a git support built-in with git repo hosting and will use that for now. But a git repo hosting can be setup on a VPS and isn't to hard if you know Linux and apache or nginx. Or you can simply use FTP and upload the files but it makes it harder to track the files on the server then -- are you sure you uploaded that one file? Git ensures it and if a file is different, it wont pull changes down and will complain. I use phpStorm and it handles most of the git actions. If your IDE has git support, great. If not, total bummer and you'll need to do commits, pushes, etc from command line. I would suggest using an IDE that has built-in git support as it just makes it so much easier.
-
Just to confirm, you're putting in your enom username in and the token created in https://www.enom.com/apitokens/default.aspx ? And not the "token name" on the token page. I believe that is the combo that is needed.
-
@WHMUp did you look at doing the open ticket and then closing it I mentioned earlier? Check https://developers.whmcs.com/api-reference/openticket/ for opening the ticket.
-
Had some free time between coders blocker on another project. So here you go. Place following in a file called "hook_invoice_highlight_service_suspend.php" in the whmcs_install_folder/includes/hooks . It will highlight invoice on the main unpaid invoices page and in the client invoices page for any service that is suspended. <?php use WHMCS\User\Client; /** * Invoice Highlight: by service status * @Author: steven99 * #version: 0.1 */ add_hook('AdminAreaFooterOutput', 1, function ($vars) { if (isset($_GET['userid']) and is_numeric($_GET['userid'])) { $Client = Client::find($_GET['userid']); if ($Client) { $Invoices = $Client->invoices ; $InvoicesWithSuspendedServices = array(); foreach($Invoices as $invoice) { $Items = $invoice->items; foreach($Items as $item) { if (isset($item->service) AND $item->service->status === 'Suspended') { $InvoicesWithSuspendedServices[] = $invoice->getInvoiceNumber(); } } } } } else { // We are not on a client page, aer we on the invoices page? if ( isset($vars['filename']) and $vars['filename'] == 'invoices' and isset($_GET['status']) AND $_GET['status']=='Unpaid') { $results = localAPI('GetInvoices', array( 'status'=>'Unpaid' )); if ($results['result'] == 'success' and isset($results['invoices']['invoice'])) { foreach($results['invoices']['invoice'] as $inv) { /** @var \WHMCS\Billing\Invoice $invoice */ $invoice = \WHMCS\Billing\Invoice::find($inv['id']); if ($invoice) { /** @var $item */ foreach($invoice->items as $item) { if (isset($item->service) AND $item->service->status === 'Suspended') { //WHMCS 8 $InvoicesWithSuspendedServices[] = $invoice->getInvoiceNumber(); } } } } } } } if (isset($InvoicesWithSuspendedServices) and !empty($InvoicesWithSuspendedServices ) and isset($vars['filename']) ) { $HTML = "<script>$( document ).ready(function() {"; foreach($InvoicesWithSuspendedServices as $invoice) { if ($vars['filename'] == 'clientsinvoices') $HTML .= "$('#sortabletbl1 td a:contains(\"$invoice\")').parent().css('background-color','#ffae80');"; elseif ($vars['filename'] == 'invoices') $HTML .= "$('#sortabletbl0 td a:contains(\"$invoice\")').parent().css('background-color','#ffae80');"; } $HTML .=" }); </script>"; return $HTML; } });
-
It would be best to post in that thread about that hook not working so any adjustments to make it work in 8.1 can be recorded there. With that said, the menu item names likely do not match up any more.