in

Dotnetpanel Forums

Community support forums for DotNetPanel products

WHMCS DotNetPanel Login Script

Last post 05-05-2010 10:49 AM by dotmaster. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-03-2010 11:32 AM

    WHMCS DotNetPanel Login Script

    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 &amp; 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

    TJ Havens
    TJ NETWORKS, INC
    tj@tjnetworksinc.com
    USA 713.581.0257
  • 03-03-2010 1:26 PM In reply to

    Re: WHMCS DotNetPanel Login Script

    Hello,

    You put this in your WHMCS header.tpl file, or anywhere else you want for that matter. This was already a feature of Steve's mod, I just wanted to use it in my menu, in a slightly different manner. I also wanted to be able to use a link instead of a button, his code was a button with form post. I looked and looked, wasnt really happy with the JavaScript method of posting a button from a link. After a little digging and some talking with Steve, I figured it out. If they have an account, we add the Menu Item and build thier login link. Of course you can style it any way you want easily. Thought it would be useful for DotNetPanel WHMCS Integrators.

    Regards

    TJ Havens
    TJ NETWORKS, INC
    tj@tjnetworksinc.com
    USA 713.581.0257
  • 05-05-2010 9:22 AM In reply to

    Re: WHMCS DotNetPanel Login Script

    Thanks for a great script!!

    Did you ever find a way to remove the 'Edit Password' link inside of DNP (or WSP)? Would like the customers not to see that since the passwords are being generated thru WHMCS and if they mess with it they will no longer be able to get in.

     

    Thanks!

  • 05-05-2010 9:31 AM In reply to

    Re: WHMCS DotNetPanel Login Script

    Hello,

    With the password link and such. Just add style "display:none;" to whatever item you want to hide.

    Regards,

    TJ Havens
    TJ NETWORKS, INC
    tj@tjnetworksinc.com
    USA 713.581.0257
  • 05-05-2010 10:49 AM In reply to

    Re: WHMCS DotNetPanel Login Script

    Just commented out this line in C:\WebsitePanel\Portal\DesktopModules\WebsitePanel\UserAccountDetails.ascx and its no longer visible.

     <!--<div class="ToolLink">
            <asp:HyperLink ID="lnkChangePassword" runat="server" meta:resourcekey="lnkChangePassword" Text="Change Password"></asp:HyperLink>
        </div>-->

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems