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.

webmail login customization

Discussion in 'E-mail Discussions' started by stevethyil, May 27, 2010.

  1. stevethyil

    stevethyil Registered

    Joined:
    May 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    hello everyone,

    I would like to customize my webmail login, see i will be creating a login box using ajax with two inputs email and password. So when i click the submit button or login button, which file should should i trigger or target. so that i can enter into my welcoming page of email account. How do i do that.?

    :)
     
  2. thewebhostingdi

    thewebhostingdi Well-Known Member

    Joined:
    Jan 10, 2008
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
  3. bribur

    bribur Registered

    Joined:
    May 29, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Sample script for webmail login box

    The following script worked good for me - maybe you can use it for yourself if you replace our server info on the first line with yours. Here it is:

    Code:
    <div id="content-wrap"><form action="https://ns5.ourchurch.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>
     
    #3 bribur, May 29, 2010
    Last edited by a moderator: Oct 19, 2010
  4. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for sharing that script, it worked well for me. I do have a question, why when I log in, it displays the 3 options for SquirrelMail, Horde and Roundcube for about 2 seconds and then jumps into Roundcube?

    Code:
    <form action="http://domain.tld:2095/login/3rdparty/roundcube/?_task=mail" method="post">
    Can someone help me with this post, not sure how to repost it. This code works, but I am having problems with the login. Thank you

    http://forums.cpanel.net/f5/webmail-login-customization-157378.html
     
  5. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Is the path to Roundcube being used in your custom login form?

    Unrelated to a custom login form, please see the following documentation that explains one possibility that I believe may be occurring in the described circumstances: Troubleshooting Webmail - Why does a particular webmail application load automatically?
     
  6. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    I read the article, but its not that

    thank you, I read the article, but it's not that. Below is the entire code I used for my form if you can help figure out if it is pointing to Roundcube. Thank you

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <body>
    <div id="content-wrap"><form action="http://domain.com:2095/3rdparty/roundcube/?_task=mail" 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>
    
    </body>
    </html>
     
    #6 fearmydesign, Oct 19, 2010
    Last edited by a moderator: Oct 19, 2010
  7. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Try changing the form action:
    • From:
      Code:
      <form action="http://domain.com:2095/3rdparty/roundcube/?_task=mail" method="post">
    • To:
      Code:
      <form action="http://domain.com:2095/login/" method="post">
     
  8. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    thank, but it doesn't work

    Thank you, I had actually tried that yesterday, and it doens't work. I tried it again, and still nothing. I mean, it logs in, but displays the initial Horde, Squirrell and Roundcube options for about 2 seconds, and then automatically jumps to Roundcube.... its weird... do you have any other suggestions?


    Before, what I established for my clients was a subdomain such as myemail.domain.com and I would point this domain to the link below, and it worked, it goes directly into Roundcube.... I just don't understand why it doesn't, on this custom form. I think the custom form looks much more professional and easier for some people. Hope you can help.. Thank you

    http://domain.com:2095/3rdparty/roundcube/?_task=mail
     
  9. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Have you tried disabling the auto-load of Roundcube after logging-in? There should be a link or button to both "Stop" and then "Disable AutoLoad" that can be used it alerts you that a webmail program is about to be auto-loaded. This is detailed in the documentation I referenced in an earlier post.
     
    #9 cPanelDon, Oct 19, 2010
    Last edited: Oct 19, 2010
  10. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    I did, but it didn't work

    The auto load is not enabled! I did read that article, but it's not enabled for this particular domain. Do you know if there are any settings maybe on WHM that I need to change in terms of roundcube for this to work? or maybe it has something to do with the http: instead of https:

    This is driving me nuts...!!! :)

    Thank you for your help, I truly appreciate it.

    Regards
     
  11. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    You are welcome to submit a ticket so that we can take a closer look at the issue. Please consider submitting a support request so that we may assist with inspecting the precise circumstances; I believe direct access is necessary so that an accurate diagnoses can be formed through in-depth investigation. When available, please let me know the ticket ID number of your support request so that we may follow-up internally.
     
  12. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    now i get this error

    Now, I got the folowing error, any idea what this means?
    ________________________________________________
    Functions in cPanel / WHM are available only directly through the cPanel and WHM interfaces or through our XML API. It appears that this request is coming from a referring site and might be malicious. Administrator Note: If new ips were recently bound to this server manually you must restart cpsrvd.

    Request Info:
    Requested page: /3rdparty/roundcube/
    Referring site: http://myemail.domain.com/index.html

    Form Data:
    Key Value
    _task mail
    login_theme cpanel
    user test@domain.com
    pass * * * * * *
    goto_uri /?login_theme=cpanel
    If you wish to continue to this page, you may do so but please note that allowing other sites to tell you which actions to perform in cPanel / WHM could be a security risk. Continue at Your Own Risk!
    ________________________________________________
     
  13. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What is the output of the following command (via root SSH access)?
    Code:
    # egrep -i "^referrer(blank)?safety=[01]" /var/cpanel/cpanel.config
    The output should indicate if the following options are set as configured using WebHost Manager:
    WHM: Main >> Server Configuration >> Tweak Settings >> Security
    • Blank referrer safety check [?] Only permit cpanel/whm/webmail to execute functions when the browser provides a referrer. This will help prevent XSRF attacks but may break integration with other systems, login applications, and billing software. Cookies are required with this option enabled.
      • On
      • Off default
    • Referrer safety check [?] Only permit cpanel/whm/webmail to execute functions when the browser provided referrer (Domain/IP and Port) exactly matches the destination URL. This will help prevent XSRF attacks but may break integration with other systems, login applications, and billing software. Cookies are required with this option enabled.
      • On
      • Off default
     
  14. fearmydesign

    fearmydesign Well-Known Member

    Joined:
    Aug 24, 2009
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    here are the results

    Here are the results, I guess the first one needs to be on? how do I turn it on, and is having this on going to put my server at risk?

    referrerblanksafety=0

    referrersafety=1



    Thank you for your help
     
  15. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Disabling a security mechanism has the potential to increase risk; however, it appears that you experienced difficulty while using the Referrer safety check ("referrersafety=1") and so I would consider evaluating whether or not it causes more of an inconvenience for the amount of protection provided; it is entirely optional. I recommend searching for previous posts within the following forums area that is dedicated to security discussions: cPanel and WHM Security - cPanel Forums
     
Loading...

Share This Page