Results 1 to 3 of 3

Thread: auto login code for email accounts

  1. #1
    salmon is offline Certified Glow Sage
    Join Date
    May 2008
    Posts
    30

    Default auto login code for email accounts

    We want to add code to our site that will auto allow logged in web application users into squirrel mail.

    Example:

    https://domainname.com/webmail/src/redirect.php?login_username=<? echo $store_row['ncpa_number']; ?>

  2. #2
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,208

    Default

    The concept is possible but you would need to store cPanel logins in your script's database otherwise they will not be able to login to webmail without a user and password since cPanel doesn't know anything about who is trying to login to what account.

    As for the code, I will let the PHP guru's answer that.

    You might want to be more specific however as the original post is a bit terse.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  3. #3
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    I have a form that you could probably modify to achieve what you want.

    HTML Code:
    <form action="/formprocessor.php" method="post" target="_blank">
                                      <input type="hidden" value="2096" name="port" />
                                        <table width="300" style="border:solid 1px #999"align="center" cellpadding="5" cellspacing="0" >
                                          <tr>
                                            <td colspan="2" ><span class="content_emphasis"><div class="webmail"><img src="/images/clearpixel.gif" width="24" height="24" alt="check webmail" /></div>Check Your Webmail:</span><span class="content_dark"><br />                                        
                                            <br />                                        
                                            </span></td>
                                          </tr>
                                          <tr>
                                            <td ><span class="content_dark">Username:</span></td>
                                            <td align="left"> <span class="content_dark">
                                            <input name="user" type="text" class="content" onfocus="clearDefaultandCSS(this)" value="<?php if (isset($email)) {echo $email;} else {echo 'yourname@yourdomain.com';} ?>" size="35" maxlength="50" />                                        
                                            </span></td>
                                          </tr>
                                          <tr>
                                            <td ><span class="content_dark">Password:</span></td>
                                            <td align="left"> <span class="content_dark">
                                            <input name="pass" type="password" class="content" size="35" maxlength="12" value="" />
                                            </span></td>
                                          </tr>
                                         
                                          <tr>
                                            <td align="right" colspan="2"><div align="center">
                                              <input name="login" type="submit" class="content_dark" style="cursor:pointer" value="login" /> 
                                              <br />
                                              <span class="content">For webmail, please use your full email address (yourname@yourdomain.com) as your username. </span></div></td>
                                          </tr>
                                        </table>
    </form>
    Form Processor:
    Code:
    <?php
    #your domain or ip
    $domain = "domainname.com";
    if(!$_POST['login']) {
    exit;
    }
    $user = $_POST['user'];
    $pass = $_POST['pass'];
    $port = $_POST['port'];
    $port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
    ?>
    <body onLoad="setTimeout('document.forms[0].submit();',10)">
    <form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
    <input type="hidden" name="user" value="<?php echo $user; ?>">
    <input type="hidden" name="pass" value="<?php echo $pass; ?>">
    </form>
    Thank you,
    Lynne Hanson
    RL Hanson-Online

Similar Threads

  1. [Email] Email Limits - How many emails per hour?
    By Matt in forum Knowledge Base
    Replies: 21
    Last Post: 11-05-2012, 10:30 AM
  2. Code hosting
    By JeffDarcy in forum General Support
    Replies: 0
    Last Post: 01-15-2009, 09:41 AM
  3. Replies: 0
    Last Post: 01-18-2005, 05:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14