Hello,
I have been integrating DotNetPanel and WHMCS. We wanted a consistent look and feel. And we also wanted to integrate our Main Menu as much as possible with both apps. One condition we had was, once they have logged into WHMCS, I wanted an additional Main Menu Item to appear that said Control Panel, then when clicked it would automatically pass through the Customers User & PWD for DNP and auto login to the control panel, which also has been branded. The 2nd condition was, even if they had a WHMCS account, it doesn’t mean they have a DNP server account, for example, support and domain only customers. In this case, I wouldn’t want the control panel link to show, because they have no need for it. Below is my script with an unordered list item in there for my menu item. The script on login first, checks to see if the User has a DotNetPanel server account; if it does it will display the item, and will retrieve the user and pwd and add the variables to the login link. Thanks to Steve @ TsHosting & Web Design. I created it from one of his mods just for my DNP Control Panel menu item.
<!-- START SERVER LOGIN -->
{php}
// Show an error if the login failed
if(($_GET['failed'] == "1") or ($error == 1)) {
echo '<div align="center"><font color="#FF0000"><strong>Your login attempt failed!</strong></font></div><br />';
}{/php}
<div id="main_menu">
<ul>
<li><a href="default.aspx" mce_href="default.aspx"><span><span>Home Page</span></span></a></li>
<li><a href="#" mce_href="#"><span><span>Products & Services</span></span></a></li>
<li><a class="selected" href="" mce_href=""><span><span>Customer Service</span></span></a></li>
{php}
$result = mysql_query("SELECT tblservers.ipaddress,tblservers.hostname,tblproducts.servertype,tblhosting.domain,tblhosting.username,tblhosting.password,tblproducts.type FROM tblservers,tblhosting,tblproducts WHERE tblservers.id = tblhosting.server AND tblhosting.userid='".$_SESSION["uid"]."' AND tblhosting.domainstatus='Active' AND tblhosting.server!='0' AND tblhosting.packageid = tblproducts.id");
while ($row = mysql_fetch_array($result)) {
$hostname = $row['hostname'];
$servertype = $row['servertype'];
$domain = $row['ipaddress'];
$reseller = $row['type'];
$faillink = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?failed=1";
$password = decrypt ($row['password'], $encryption_key);
$username = $row['username'];
if ($servertype == 'dotnetpanel') {
echo '<li><a href="Control">https://'.$hostname.'/Default.aspx?pid=Login&user='.$username.'&password='.$password.'"><span><span>Control Panel</span></span></a></li>';}
}
if (!$servertype) {
echo '';
}{/php}
<li class="last"><a href="#" mce_href="#"><span><span>Contact Us</span></span></a></li>
</ul>
</div>
Regards,
TJ Havens