The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script to add cPanel/Wemail Login to Website

Discussion in 'E-mail Discussions' started by bribur, May 29, 2010.

  1. bribur

    bribur Registered

    Joined:
    May 29, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I couldn't find a good script to add a simple webmail login to our domain homepage, so I cut and paste and tweaked until I got something to work for us. Maybe it can work for others too. You'll have to replace the https://yourdomain.com:2096 in the first line with your webmail server info. Here is the script:

    Code:
    <div id="content-wrap"><form action="https://yourdomain.com:2096/login/" method="post"> <input name="login_theme" type="hidden" value="cpanel" /> 
    <table class="login" style="width: 200px;" border="0" cellspacing="0" cellpadding="0">
    <tbody style="text-align: left;">
    <tr style="text-align: left;">
    <td style="text-align: left;"><strong>Login</strong></td>
    <td style="text-align: left;">&nbsp;</td>
    </tr>
    <tr style="text-align: left;">
    <td class="login_lines" style="text-align: left;">Email:</td>
    <td class="login_lines" style="text-align: left;"><input id="user" name="user" size="16" type="text" tabindex="1" /></td>
    </tr>
    <tr class="row2" style="text-align: left;">
    <td class="login_lines" style="text-align: left;">Password:</td>
    <td class="login_lines" style="text-align: left;"><input id="pass" name="pass" size="16" type="password" tabindex="2" /></td>
    </tr>
    <tr style="text-align: left;">
    <td style="text-align: left;" colspan="2"><input id="login" class="input-button" type="submit" value="Login" tabindex="3" /></td>
    </tr>
    </tbody>
    </table>
    <input name="goto_uri" type="hidden" value="/?login_theme=cpanel" /> </form> <br /> <br />
    <script type="text/javascript"><!--
    /* Must not include external javascript -jnk 06.20.09 */
        var init = function() {
            document.getElementById("user").value = '';
            document.getElementById("pass").value = '';
            document.getElementById("user").focus();
        };
    if( window.addEventListener ) {
        window.addEventListener('load',init,false);
    } else if( document.addEventListener ) {
        document.addEventListener('load',init,false);
    }
    // --></script>
    </div>
     
    #1 bribur, May 29, 2010
    Last edited by a moderator: May 31, 2010
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. Patrick Hunlock

    Joined:
    Jun 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, TX
    You might want to remove the <script> block

    If you remove the <script>...</script> block from the code in the original post, it will allow the browser to auto-populate the input fields so you'll most likely only need to fill out the form once. The script makes your webmail more secure (in case anyone gets access to your browser); the absence of the script makes the form much more convenient to use.
     
Loading...

Share This Page