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.

cpanel login form

Discussion in 'General Discussion' started by ZapX.net, Apr 22, 2005.

  1. ZapX.net

    ZapX.net Well-Known Member

    Joined:
    Feb 24, 2005
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sidman, PA
    hi,

    I'm trying to make a CPanel login form, but can't seem to get it to work. Would appreciate it very much if someone would help me with this.

    This is the HTML:

    HTML:
    <div id="cpanel_login">
    <form action=""
    method="post"
    id="login"
    onsubmit="return doLogin();">
    <label for="user" accesskey="u">
    Username
    <input type="text" name="user" id="user" />
    </label>
    
    <label for="pass" accesskey="p">
    Password
    <input type="password" name="pass" id="pass" />
    </label>
    
    <label for="server" accesskey="e">
    Server
    <select name="server"
    id="server"
    onchange="selectServer();">
    <option value=""
    selected="selected">
    -----
    </option>
    <option value="mercury">
    Mercury
    </option>
    </select>
    </label>
    
    <label for="login_location">
    Location
    <select name="login_location" id="login_location" onchange="locationSelect();">
    <option value="">-----</option>
    <option value="cpanel">CPanel</option>
    <option value="whm">WHM</option>
    <option value="clientarea">Client area</option>
    </select>
    </label>
    
    <input type="hidden" name="username" />
    <input type="hidden" name="password" />
    
    <input type="submit" value="Login" />
    
    </form>
    </div>
    
    The extra username and password fields is for when logging into the client area of WHM Autopilot. Here's the javascript:

    Code:
    server = '';
    login_location = '';
    
    function selectServer()
    {
    
    var serverselect = document.getElementById('server');
    server = serverselect.options[serverselect.selectedIndex].value;
    
    }
    
    
    function locationSelect()
    {
    
    var locationselect = document.getElementById('login_location');
    login_location = locationselect.options[locationselect.selectedIndex].value;
    
    }
    
    
    function doLogin()
    {
    
    
    if (!server && location != 'clientarea') {
    alert('You must select the server you are on.');
    document.getElementById('server').focus();
    return false;
    }
    
    if (!login_location) {
    alert('Please select the location to login');
    document.getElementById('login_location').focus();
    	return false;
    }
    
    form = document.getElementById('login');
    
    switch (login_location) {
    case 'cpanel':
    form.action = 'https://'+server+'.zapx.net:2083';
    break;
    
    case 'whm':
    form.action = 'https://'+server+'.zapx.net:2087';
    break;
    
    case 'clientarea':
    form.username.value = form.user.value;
    form.password.value = form.pass.value;
    form.action = 'https://secure.zapx.net/login.php';
    break;
    
    }
    
    return true;
    }
    
    When it submits, it goes to the selected location, but the password prompt pops up.

    thank you for any help.

    Brandon
     
  2. ZapX.net

    ZapX.net Well-Known Member

    Joined:
    Feb 24, 2005
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sidman, PA
    Oh nevermind, I fixed i t. I just had to add /login/ to the URL's.

    Thanks,

    Brandon
     
  3. theunf

    theunf Registered

    Joined:
    Apr 25, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Mail Management Login and Menu user personalization...

    Hi,

    Do you have any tip about personalizing both login and menu pages of Mail
    Management/Webmail ?

    I found at this site the login page, but couldnt find if there´s any hidden option...
    such as .. open only /horde/ after login.

    I´m a CPanel user, not an administrator.
     
  4. soporteiws

    soporteiws Registered

    Joined:
    Aug 28, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mexico City
    Webmail

    Only the administrator can edit the webmail look and feel. Buy a dedicated server with cpanel.
     
Loading...

Share This Page