Hmmcrunchy 0 Posted January 29, 2020 Hey folks is it possible to change the Log In To Control Panel button on the manage service page to a custom url ? i have several products that aren't hosting but you do log in to manage them, i just need each of these products to go to a separate login page when you click "log on to control panel" where the user can then login ( the button doesn't have to log the person in they can do that manually) ideally the link would be on the same button (rather than in the side bar) to keep a standard way of accessing the CP for all products thanks :) 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 16 just going to bump this one as even now this would be handy 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 18 anyone at all ? 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 19 It depends. What module (if any) is used for those services? Most likely, that button is added through the module code in a _ClientArea function. 1 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 19 HI Dennis No module at the moment, or the software product doesn't have a module i should say. Im just selling a product in WHMCS, and it would be really handy for clients to be able to go to the product and click that button to be taken to a login page for that product (even if they have to login) 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 19 Are you sure the product is not configured with a module? I don't think WHMCS shows a "Login to Control Panel" button if not. 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 19 Yes so the product would be a zero trust security product, a user would have to login to the control panel to admin it The site has no module available for whmcs but just would like a link for that product in whmcs to go to the login panel for the product to save the client having to go Looking - and it looks more professional if there were a module where we can just stick in a url to direct the button to that would suffice but most modules are specific provisioning modules that send data to one site 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 19 I'm just wondering why you have a "Login to Control Panel" button in the first place. This is the default template for products with no module: I've never seen or heard that a product automatically has any other buttons without being assigned a module. 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 20 I suppose the question is can we put one there at this point i think any way of getting a link on a product page a client can click to go to the login page for that product even in the side bar for a customer logging into whmcs to manage their products with us they click on the product then they have the option to cancel and ideally to go to login page. rather than having the product but then having to go off to another page to try and find a login link which is not really user friendly whether its a button at the bottom, a generic module to allow this or a link in the action bar i dont mind below is an example screen we have 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 20 Oh, I thought the screenshot from your original post was what you currently had. So just to be clear: You don't even have the "Login to Control Panel" button at the moment, or? If not, you would need to build a very simple module. You basically just need to change how the client area pages are rendered. The relevant information can be found here: https://developers.whmcs.com/provisioning-modules/getting-started/ There's multiple ways to do it. One of them is to use the _ClientArea function to add additional code to the service page. It can be done like this: <?php // other functions ... function mymodule_ClientArea($params) { $code = '<a href="'.($params["serversecure"]=='on' ? 'https':'http').'://'.$params["serverhostname"].':'.$params["serverport"].'/login.php">Access Control Panel</a>; return $code; } First, it checks if the 'serversecure' parameter is set for the server added in WHMCS. If it is, it uses https, if not http. Then it adds the server's hostname, port and /login.php. A result could be https://mycontrolpanel.com:8080/login.php You'd have to configure a server with the module in WHMCS for this to work - the positive side is that you can have multiple servers with their own hostname (and thus their own link to login). 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted January 20 ok ill have to come back to this when i have some time. id hoped it would be quite and easy job thanks for your help 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 20 It shouldn't be too difficult to make. If I have time later tonight, I'll create a module that does what you need. 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 104 Posted January 20 Here's a very rough example of how it could be done. Extract the files to /modules/servers/. You'll need to configure a server in WHMCS and select "Custom" as the module. The HTML for the button is located inside /modules/servers/custom/templates/overview.tpl. In the custom_ClientArea function, you can change how the link is going to be rendered on the page. custom.zip 0 Quote Share this post Link to post Share on other sites
Hmmcrunchy 0 Posted Monday at 11:45 AM On 20/01/2023 at 9:47 PM, DennisHermannsen said: Here's a very rough example of how it could be done. Extract the files to /modules/servers/. You'll need to configure a server in WHMCS and select "Custom" as the module. The HTML for the button is located inside /modules/servers/custom/templates/overview.tpl. In the custom_ClientArea function, you can change how the link is going to be rendered on the page. custom.zip 1.58 kB · 2 downloads you absolute legend !! That's exactly what I was looking for, thank you so much ! 0 Quote Share this post Link to post Share on other sites