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.

Adding webmail to your site

Discussion in 'E-mail Discussions' started by nileshwarade, Jan 5, 2006.

  1. nileshwarade

    nileshwarade Member

    Joined:
    Jan 3, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Hi friends, please can somebody tell me how to add webmail login to site. o know thread allrady posted in 2004. i was gone through that. there is php script. i attact that php script. please tell me how to add. or procedure to do the same.
     

    Attached Files:

  2. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    Extract the file from the zip.

    Rename it to cplogin.php or any name you prefer.

    Edit Login configuration to look like this:
    Code:
    #Login Configuration
    
    #cPanel
    #$protocol = 'http';
    #$port = 2082;
    
    #Secure cPanel
    #$protocol = 'https';
    #$port = 2083;
    
    #WHM
    #$protocol = 'http';
    #$port = 2086;
    
    #Secure WHM
    #$protocol = 'https';
    #$port = 2087;
    
    #Webmail
    $protocol = 'http';
    $port = 2095;
    
    #Secure Webmail
    #$protocol = 'https';
    #$port = 2096;
    ?>
    Change the #Webmail to #Secure Webmail, if you prefer, by adding a # infront of the $protocal and $port of #Webmail and removing the # in front of the #$protocal and #$port of #Secure Webmail.

    Edit and put in your site details in the html part [Web Hosting Company Name Here]

    Edit this "http://" to show your preferred page that will show on an error.
    It can be the login script page so it returns to the log in page again on an error or it can be a seperate error page with a link back to the login script page.
    Code:
    <?php
    print "<input type=hidden name=failurl value=\"http://" .  $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
    ?>
    Remove this from the bottom of the script (you don't need your clients seeing it)
    Code:
    <br>
    <a href="cpanel-login.phps">Source</a><br>
    Note: This examples requires cPanel 9.4.1 or later!
    Then upload it to your web site.

    Create a link in the web page you want to call the login script.

    Click on the link you created and it should load the login in page in your browser.

    You can dress it up with addition html of your choice like centering background images etc to match your web site theme.

    There are also ways to include the code in the zip file into a web page.

    Copy and paste the code into a page where you want to show the cPanel log in info.

    Do the edits above.

    This will then be a part of your web site theme without the need for a seperate login page.
    Remeber to save the page with a php extension not a html (htm) extension as now it will need to be parsed by your server as a php script file. ie index.php not index.html
    HTH

    Just to add.
    If you want to be really smart then you can have login boxes on your web pages for all the cPanel pages (cPanel/WHM/Webmail, secure or not) by pasting in a seperate occurance of the script, using the above method, but change the 'Login Configuration' for each seperate login box required.

    :)
     
    #2 Izzee, Jan 5, 2006
    Last edited: Jan 5, 2006
  3. nileshwarade

    nileshwarade Member

    Joined:
    Jan 3, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    call php scritp in html

    Thanks for help i done it. but can u explan me after creating php cript in frontpage how can we call the php script in html page....Soryyyyyyyy i am biginer........... :confused: :confused:
     
  4. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    Not familiar with FrontPage. So I am taking a guess.

    Do you mean how do you preview your php script in FP?

    To preview a php script it has to be parsed by a web server.

    So you will have to upload your file(s) to the server and preview them there.

    Make edits again in FP then upload and preview again. There is no way to preview php scripts in FP.

    Remember if your file has a mix of html and php the file must have an extension of .php

    :)
     
  5. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    A file with .php extension will never open in FP.
     
  6. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    I believe my reply was more accurate and less misleading, because from the desktop, you can File/Open.. any.php with mixed html/php or php only coded files in FP2003 but it won't preview or show (parse) the php code in wysiwyg mode. It will show the php code (text) in the Code tab for editing.

    Php encoded only files open in code edit mode only.

    Test it by opening phpinfo.php using File/Open.. in FP

    Test it by right mouse click on any html/php or php only file in a windows folder. If needed right click and select Open with...

    Test it with any html/php coded mixed file like this test file:
    Code:
    <HTML>
    <HEAD>
    <title>Welcome <? echo $SERVER_NAME; ?></title>
    </HEAD>
    <body>
    Welcome <b><? echo $SERVER_NAME; ?></b>
    </body>
    </html>
    Save this file as index.php and then test open it in FP.

    All these methods will open any file with php extension in FP from the desktop for editing then follow my edit/upload instructions above.

    I am now a much more familiar with FrontPage. ;)

    :)
     
    #6 Izzee, Jan 6, 2006
    Last edited: Jan 6, 2006
  7. nileshwarade

    nileshwarade Member

    Joined:
    Jan 3, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    I done the webmail login in my site but some problem

    Hi friends, i done the change as per explain, it going to straight my webmail but before going to direct login once again login box is apperaring as attached in photo. how can i avoid that login box after login through webpage login.

    i attached my webmaillogin.php file with this. and relogin window.
    please tell me what is the correction to avoid relogin window as shown in photo.
     

    Attached Files:

  8. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    I copied and pasted your script to a file on a server of mine. It loaded straight into Hoarde Web Mail without any problems.

    If you would like to PM me I can give you the address so you can confirm for yourself that your script is, indeed, working on a test account I set up.

    Just to add. I changed passwords to check it was not a stored password issue and yes after changing the password I was presented with the login box like in your attachment.

    I entered my login details in the boxes and was then given the Webmail login screen. I logged in using those login boxes and was sent to the Web Mail interface with no problems but too many logins (3 now).

    So now, I reloaded your form again on my test account and entered the very same user/pass as above and was taken to the Web Mail Client Horde without having to enter my user/pass again. Not sure about this behaviour unless it is cookie related or some other browser behavior.

    More added. It is indeed a cookie issue. Once the cookie is stored in your browser you will be able to login straight form this form with no problems at all. I just tested it with no cookies allowed then with allow session cookies and allow all cookies and with session and all cookies it worked perfectly.

    Some wise old coder (not me) might be able to come up with a piece of code that will overcome the cookie issue. Or there may be a tweak in WHM somewhere for it that someone may point out for you.

    Another piece added. I just came accross this link on a post in these forums (can't recall the postee) but looks very interesting and might be an alternative to this script if you are using Horde as your Web Mail Client.

    Its called cPanel-Horde Bridge and the link:
    http://www.nnexxezz.com/hbridge

    :)
     
    #8 Izzee, Jan 6, 2006
    Last edited: Jan 6, 2006
  9. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Please don't take me wrong,, I never ment to say that your reply was misleading...but this one would realy help ......
    Well I tried your method and that works :D
    And yes... you ARE more familiar with FP now...LOL ;)
     
  10. JColvard

    JColvard Member

    Joined:
    May 15, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
  11. nileshwarade

    nileshwarade Member

    Joined:
    Jan 3, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    setting.php in horde/hbridge

    I friend,
    I downloaded the horde bride. as per installation file, i seen the setting.php but when i open that file nothing is there. could you help me what is that file and the sample or your setting.php file means i can use it for mine domain. please give me information how do you used that horde bridge.????????????????????
     
Loading...

Share This Page