ManagedCloud-Hosting Posted February 14, 2020 Author Share Posted February 14, 2020 Hi @brian! Yes it's working. Perfect as always, I replied back via 'Messages'. Client has checked and we mentioned about you, client and us both thank you for all your help and support for his cause. --------------------- Can you please help me with a different issue (i) I installed a plugin 'EASY WHMCS Module' and I deleted some services / products in bulk some of them were being used by clients. (ii) Now the clients does not have any services under their account (ii) They are still receiving their renewal emails even without the services / products under their account. (iv) I can recreate all services / products manually and update their account with them but how do I stop the emails being sent out for the current non existent - services / products ( If I update the newly created products now our clients will receive all the new renewal emails along with the old ones which will create confusion) How do I handle this very confused... 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted February 17, 2020 Author Share Posted February 17, 2020 On 2/14/2020 at 9:25 PM, VirtualWorldGlobal said: --------------------- Can you please help me with a different issue (i) I installed a plugin 'EASY WHMCS Module' and I deleted some services / products in bulk some of them were being used by clients. (ii) Now the clients does not have any services under their account (ii) They are still receiving their renewal emails even without the services / products under their account. (iv) I can recreate all services / products manually and update their account with them but how do I stop the emails being sent out for the current non existent - services / products ( If I update the newly created products now our clients will receive all the new renewal emails along with the old ones which will create confusion) How do I handle this very confused... Hi EASY WHMCS issue we faced is now resolved. By chance is there a way to migrate invoices from one customer to another ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 17, 2020 Share Posted February 17, 2020 https://docs.whmcs.com/Products_Management Quote Invoices cannot be moved between clients, therefore when moving a product/service any invoices will remain under the old owner. Therefore it would be advisable to check the old owner's Invoices tab for any unpaid invoices for this service and cancel them. If you wish to invoice the new owner for the service, move the Next Due Date forward/back by one day and a new invoice will be generated when the cron next runs. 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted March 2, 2020 Author Share Posted March 2, 2020 --------------------------------------------------------- yes - but only with a hook, not from settings. by default, any contact can see the list of all services on the My Services/Products page (possiibly that could be limited to "thier" product, but that's not simple... it would be possible to assign access to each specific product details page to one or more contacts. regards Brian --------------------------------------------------------- Please help on how to achieve this as I need to active for one client. Thanks 0 Quote Link to comment Share on other sites More sharing options...
JesusSuarz Posted July 28, 2020 Share Posted July 28, 2020 On 2/6/2020 at 1:19 PM, brian! said: <?php # Primary Sidebar cPanel Login Form # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $client = Menu::context('client'); $clientid = 4; if ($client->id == $clientid) { $service = Menu::context('service'); $servertype = $service->product->servertype; if ($servertype != ""){ return; } $username = 'username'; $password = 'password'; $cpanelhref = 'https://www.domain.com:2083/login/'; $webmailhref = 'https://www.domain.com:2096/login/'; $bodyhtml = '<form method="post" action="'.$cpanelhref.'" target="_blank"> <input type="hidden" name="user" value ="'.$username.'"/> <input type="hidden" name="pass" value ="'.$password.'"/> <input class="btn btn-success btn-sm btn-block" type="submit" value="'.Lang::trans('cpanellogin').'"/> <input class="btn btn-primary btn-sm btn-block" type="submit" formaction="'.$webmailhref.'" value="'.Lang::trans('cpanelwebmaillogin').'"/> </form>'; if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions') ->removeChild('Login to cPanel') ->removeChild('Login to Webmail'); } $primarySidebar->addChild('cPanel Login', array( 'label' => 'cPanel Logins', 'icon' => 'fa-server', 'order' => 20, 'footerHtml' => $bodyhtml, )); } }); there are a handful of variables that you will have to update... $clientid -> this is the client's ID value - you can get it from their client summary in the admin area. username & password -> obviously change these to those given by your client. cpanelhref & webmailhref -> replace domain.com with the url of your client. if you don't want to show the webmail link, then just remove the last <input> line from the hook. for the given user, assuming you get the username, password and URL correct, it should log them directly into cPanel without asking for login details. Hello I have improved your code to make it work for resellers and users. basically if the customer's account is a reseller then the cpanel and whm buttons appear but if a cpanel account, then cpanel only appears. I have also added a condition to verify if the domain uses cloudflare, since if the domain uses cloudflare then it cannot be accessed through: https://domain.com:2083 or 2086,2087. also for some reason the btn-block class does not work for me. therefore I made a new class to make it look like the original. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $service = Menu::context('service'); $servertype = $service->product->servertype; if ($servertype!="cpanel"){ return; } $domain = $service->domain; $username = $service->username; $cloudflare = 'http://'.$domain.''; $get_cf = get_headers($cloudflare, 1)[Server]; if ($get_cf != 'cloudflare'){ $cpanelhref = 'https://'.$domain.':2083/login/'; $webmailhref = 'https://'.$domain.':2096/login/'; $webwhmhref = 'https://'.$domain.':2087/login/'; $command = 'DecryptPassword'; $postData = array('password2' => $service->password); $results = localAPI($command, $postData); $password = $results['password']; if ($service->product->type=="reselleraccount"){ $whmcpanel = '<input class="btn btn-primary btn-sm block-btn mb-1" type="submit" formaction="'.$webwhmhref.'" value="'.Lang::trans('cpanelwhmlogin').'"/>'; } $bodyhtml = '<form method="post" action="'.$cpanelhref.'" target="_blank"> <input type="hidden" name="user" value ="'.$username.'"/> <input type="hidden" name="pass" value ="'.$password.'"/> <input class="btn btn-success btn-sm block-btn mb-1" type="submit" value="'.Lang::trans('cpanellogin').'"/> <input class="btn btn-danger btn-sm block-btn mb-1" type="submit" formaction="'.$webmailhref.'" value="'.Lang::trans('cpanelwebmaillogin').'"/>'.$whmcpanel.''.' </form> <a href="/contact.php" class="btn btn-info btn-sm block-btn mb-1" data-toggle="tooltip" data-placement="bottom" title="Si tiene problemas para ingresar a su panel, puede deberse a que usa una CDN o proxy como CloudFlare en su dominio, en este caso, contacte con soporte.">Ayuda <i class="fas fa-question-circle"></i></a> <style>.block-btn {width: 100%;}</style>'; if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions') ->removeChild('Login to cPanel') ->removeChild('Login to Webmail') ->removeChild('Login to WHM'); } $primarySidebar->addChild('cPanel Login', array( 'label' => 'Ingresar a cPanel/WHM', 'icon' => 'fa-server', 'order' => 20, 'footerHtml' => $bodyhtml, )); } }); Sorry for the texts in Spanish. you can edit if you want. for resellers it looks like this: and for customers it looks like this: and if the site has cloudflare then leave the default panel of whmcs. 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted July 28, 2020 Author Share Posted July 28, 2020 Hi @JesusSuarz How does a reseller benefited by this script ? If you explain it would help...thanks 10 hours ago, JesusSuarz said: I have improved your code to make it work for resellers and users. 0 Quote Link to comment Share on other sites More sharing options...
JesusSuarz Posted July 28, 2020 Share Posted July 28, 2020 21 minutes ago, VirtualWorldGlobal said: Hi @JesusSuarz How does a reseller benefited by this script ? If you explain it would help...thanks hi, the reseller button is only available if the cpanel account is a reseller account. in other words, if the cpanel account is not a reseller account then the WHM button for port 2086 or 2087 will then not be available. that's the advantage. In addition, the official whmcs plugin accesses the cpanel login through the server host link, not through the domain. in other words, the official plugin allows users to access using (example): cpanel.yourhost.com while this hook allows users to directly access the domain that has the hosting account. example: yourhost.com/cpanel 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted July 28, 2020 Author Share Posted July 28, 2020 Thanks 0 Quote Link to comment Share on other sites More sharing options...
Hostmegate Posted September 18, 2022 Share Posted September 18, 2022 This is my client area primary side bar menu. that client cannot access CPanel using that side menu. After Click it nothing happen. How Can I solve that issue 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.