Baja Posted November 13, 2007 Share Posted November 13, 2007 Troy, Thank you very much for the clarification. I did actually have my server setup in whmcs but with only the first part of the server hostname. And you are correct "name" is being pulled from tblservers as you stated. I have not finished my site and do not have a ssl yet as a ssl will be one of the last things I purchase before I go live. Out of curiosity are you providing a ssl per server? And what benefit will this have other then a client not having to click the security warning? Baja 0 Quote Link to comment Share on other sites More sharing options...
Troy Posted November 14, 2007 Share Posted November 14, 2007 Troy, Out of curiosity are you providing a ssl per server? And what benefit will this have other then a client not having to click the security warning? Baja Yes, we secure every web server with an inexpensive RapidSSL certificate to give clients a secure control panel, and we use the SSL and "redirect to hostname" options in CPanel's tweak settings area in WHM so that all control panel access is secured. Security warnings give an unprofessional impression to clients, IMO, and IE7's default settings make it more difficult for the average user to get around the security warning. 0 Quote Link to comment Share on other sites More sharing options...
rodeoXtreme Posted November 14, 2007 Share Posted November 14, 2007 Outstanding job Troy! I changed the "name" to "domain" and I have already received praise from our links. Maybe Matt will add this script into a new version. Our clients say that it is easier to find it. Incidentally, we added it to the left side menu in a table using the "navbox" and "navbar" classes. Keith 0 Quote Link to comment Share on other sites More sharing options...
BionHostStan Posted November 24, 2007 Share Posted November 24, 2007 great work! looks wonderful 0 Quote Link to comment Share on other sites More sharing options...
Troy Posted November 24, 2007 Share Posted November 24, 2007 Incidentally, we added it to the left side menu in a table using the "navbox" and "navbar" classes. Keith That's an excellent idea! I may do that too. It would certainly keep the customers' control panel links available to them at all times while logged in to their account. 0 Quote Link to comment Share on other sites More sharing options...
Cleiton Posted December 3, 2007 Share Posted December 3, 2007 OMG! owner of script remove from his website! http://www.wobminteractive.com.au/billing/index.php hummmm 0 Quote Link to comment Share on other sites More sharing options...
robbo Posted December 3, 2007 Author Share Posted December 3, 2007 Cleiton, this is only visible to logged in users, which is why you cannot see it on that page. 0 Quote Link to comment Share on other sites More sharing options...
RCourtade Posted December 17, 2007 Share Posted December 17, 2007 So I added the cp.php file and entered: {include_php file="cp.php"} on the clientareahome.tpl and nothing changed. Is there something I am missing??? Ryan Here's what I did: Created the following cp.php file and put it in the whmcs root: <?php $query_string = "select s.name, s.type, h.packageid, h.domain, h.username, h.password from tblhosting h, tblservers s where h.server = s.id and s.type in ('cpanel','helm') and h.userid = ".$_SESSION['uid']." and h.domainstatus = 'Active' order by h.domain"; $query = mysql_query($query_string); if (mysql_num_rows($query)) { ?> [b]Control Panel Links[/b]</p> <table align="center" style="width:90%" class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"> <td>Domain</td> <td>Links</td> </tr> <?php while ($row = mysql_fetch_assoc($query)) { switch ($row["type"]) { case "cpanel": echo '<tr class="clientareatableactive">'; echo '<td>'.$row["domain"].'</td>'; echo '<td>[url="https://'.$row['name'].':2083/login?user='.$row['username'].'&pass='.decrypt($row['password']).'"]Control Panel[/url]'; if ($row['packageid'] >= 3 && $row['packageid'] <= 7) { echo ', [url="https://'.$row['name'].':2087/login/?user='.$row['username'].'&pass='.decrypt($row['password']).'"]Web Host Manager[/url]'; } echo '</td>'; echo '</tr>'; break; case "helm": echo '<tr class="clientareatableactive">'; echo '<td>'.$row["domain"].'</td>'; echo '<td>[url="https://'.$row['name'].'/default.asp?txtUsername='.$row['username'].'&txtPassword='.decrypt($row['password']).'&&selLanguageCode=EN&selInterface=standard_XP'.'"]Control Panel[/url]</td>'; echo '</tr>'; } } ?> </table> <?php } ?> We only do CPanel and Helm, so it only covers those two control panels. The links are simple links, no forms/javascript required, and they forward the user to the control panel with no need to enter the control panel username/password. The code expects the servername set up in whmcs to be the actual hostname of the server, and to be secured with an SSL certificate. It also places a WHM link for resellers, but the code that does it will have to be adjusted for your reseller package ids. It's this bit: if ($row['packageid'] >= 3 && $row['packageid'] <= 7) { echo ', [url="https://'.$row['name'].':2087/login/?user='.$row['username'].'&pass='.decrypt($row['password']).'"]Web Host Manager[/url]'; } Our reseller packages have ids between 3 and 7, hence the if ($row['packageid'] >= 3 && $row['packageid'] <= 7), which needs to be taylored to your packages. Otherwise everything else is done by server type, (only cpanel or helm), in whmcs and will accomodate any number of servers. Then you simply do this wherever you want the links: {include_php file="cp.php"} I put it in the clientareahome.tpl right above the ticket list. The code above looks poorly formatted, but that's just due to the word wrapping. If you copy and paste it, it should be well formatted (I hope). 0 Quote Link to comment Share on other sites More sharing options...
BionHostStan Posted December 21, 2007 Share Posted December 21, 2007 I hope this external file isn't a risk 0 Quote Link to comment Share on other sites More sharing options...
winzor Posted January 2, 2008 Share Posted January 2, 2008 I followed the directions and it displays well in the client area but it links to nothing. The correct domain shows with the words "Control Panel" next to it but it's not "clickable". Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
allynne Posted January 24, 2008 Share Posted January 24, 2008 We just did a very simple template change. No extra files required. In clientareaproductdetails.tpl, find <td width="50%" align="center">{$serverclientarea}</td> and replace it with <td width="50%" align="center"> <input class="button" type="button" onclick="window.open('https://{$server.name}:2083/login?user={$username}&pass={$password}')" value="Login to cPanel"/> <input class="button" type="button" onclick="window.open('https://{$server.name}:2096/login?user={$username}&pass={$password}')" value="Login to Webmail"/> </td> The only drawback is that there is no WHM login button (but this was not an issue for us because we haven't yet gone down the reseller route) 0 Quote Link to comment Share on other sites More sharing options...
Nick Posted January 25, 2008 Share Posted January 25, 2008 It'd be simple enough to add a bit of code checking account type, and displaying a link to WHM if necessary. 0 Quote Link to comment Share on other sites More sharing options...
allynne Posted January 25, 2008 Share Posted January 25, 2008 The easiest thing would be to have a tick box on the product setup that indicates the package is a reseller account, and then passing that variable through to the template. Ooooh Matt ..... 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 25, 2008 WHMCS CEO Share Posted January 25, 2008 The easiest thing would be to have a tick box on the product setup that indicates the package is a reseller account, and then passing that variable through to the template. Ooooh Matt ..... The product type does that - shared account, reseller account, server or other. Matt 0 Quote Link to comment Share on other sites More sharing options...
zippohosting Posted February 1, 2008 Share Posted February 1, 2008 I have read this thread and got very confused at the end.. Can someone bundle this up into a nice clean set of steps to add the Cpanel Link to the client area.. I thought I understood it but then I saw that it was modified a few times for this and that.... Can someoene place up the finalized exact steps? Thanks 0 Quote Link to comment Share on other sites More sharing options...
TerrasIOI Posted February 8, 2008 Share Posted February 8, 2008 Troy & Co. I have been using this add on hack for a while and it works well. However, yesterday I have encountered a interesting phenomena. For clients that has ordering largest hosting plan, it show 'cpanel login' AND 'WebHostManager login'! I haven't changed anything in WHMCS. Can someone give me some tip here? Regards. 0 Quote Link to comment Share on other sites More sharing options...
Zorro67 Posted March 8, 2008 Share Posted March 8, 2008 We just did a very simple template change. No extra files required. In clientareaproductdetails.tpl, find <td width="50%" align="center">{$serverclientarea}</td> and replace it with <td width="50%" align="center"> <input class="button" type="button" onclick="window.open('https://{$server.name}:2083/login?user={$username}&pass={$password}')" value="Login to cPanel"/> <input class="button" type="button" onclick="window.open('https://{$server.name}:2096/login?user={$username}&pass={$password}')" value="Login to Webmail"/> </td> The only drawback is that there is no WHM login button (but this was not an issue for us because we haven't yet gone down the reseller route) @allynne. Implemented, but couldn't get either of the logins to work. Loggin as client, but the link kept taking me to my server then i realised that the {$server.name} should be replaced by {$domain} in both cases. So the code becomes <td width="50%" align="center">{$serverclientarea}</td> and replace it with <td width="50%" align="center"> <input class="button" type="button" onclick="window.open('https://{$domain}:2083/login?user={$username}&pass={$password}')" value="Login to cPanel"/> <input class="button" type="button" onclick="window.open('https://{$domain}:2096/login?user={$username}&pass={$password}')" value="Login to Webmail"/> </td> or http:// instead of https, as the case may be. Could you verify? 0 Quote Link to comment Share on other sites More sharing options...
Mjhorsy Posted March 26, 2008 Share Posted March 26, 2008 Zorro thanks very much! It worked for me =] 0 Quote Link to comment Share on other sites More sharing options...
Mercurial Posted May 8, 2008 Share Posted May 8, 2008 What happens if the user changes the cpanel password within cpanel? That means if you guys are passing the password in via the whmcs db then it's out of date/invalid? Could cause confusion for the user. Or does WHMCS pull updated passwords from cpanel somehow? I've yet to install/test. 0 Quote Link to comment Share on other sites More sharing options...
Nick Posted May 8, 2008 Share Posted May 8, 2008 Most people turn off the ability to change passwords in cPanel itself as, as you correctly thought, WHMCS' record of user passwords would be out of date. 0 Quote Link to comment Share on other sites More sharing options...
NoDoze Posted May 20, 2008 Share Posted May 20, 2008 This script looks cool....if I could get it to work! I installed Troy's script cpanel.php, but I get a bunch of mysql database errors...looks like unable to connect and query errors... any ideas? 0 Quote Link to comment Share on other sites More sharing options...
NoDoze Posted May 21, 2008 Share Posted May 21, 2008 want specifics? here ya go... Warning: mysql_query() [function.mysql-query]: Access denied for user 'user'@'localhost' (using password: NO) in /home/user/public_html/cp.php on line 3 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/user/public_html/cp.php on line 3 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/cp.php on line 4 Looks to me issues with DB connections, but the last one looks script related. I even tried the original posted script, but that just gave me a blank page! What gives!?! Like Zippohost's request, could someone make it more black and white? clearly something is missing and incomplete here... Thanks! 0 Quote Link to comment Share on other sites More sharing options...
NoDoze Posted May 22, 2008 Share Posted May 22, 2008 Hmmm... no responses....why's that...? My WHMCS works perfect, so I dunno why this mod wouldn't be able to work. ...still waiting for help.... Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Troy Posted May 23, 2008 Share Posted May 23, 2008 Hmmm... no responses....why's that...? My WHMCS works perfect, so I dunno why this mod wouldn't be able to work. ...still waiting for help.... Thanks! Do you have your cp.php file in the WHMCS home directory? 0 Quote Link to comment Share on other sites More sharing options...
NoDoze Posted May 23, 2008 Share Posted May 23, 2008 Yes...everything is in the corect place.... 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.