jrsweets Posted January 29, 2004 Posted January 29, 2004 Is there a way to edit this script so that you do not need the enter your domain name with your username to login to squirrel mail? I want the user to be able to enter "username" not "username@domain.com" in the user field. Is there a way to have that filled in automatically. Any thought would be appreciated. Thanks Jeff <head> <script language="JavaScript" type="text/javascript"> <!-- function squirrelmail_loginpage_onload() { document.forms[0].js_autodetect_results.value = '1'; } // --> </script> </head> <form method="post" action="http://your.host.com/sqmail/src/redirect.php"> <input type="hidden" name="js_autodetect_results" value="0"> User: <input type="text" name="login_username" size="10"> Password: <input type="password" name="secretkey" size="10"> <input type="submit" value="Login"> </form> Quote
DarqFlare Posted January 29, 2004 Posted January 29, 2004 You could try to write up a javascript that adds the @domain.com before the form is submitted... www.hotmail.com does this. Quote
jrsweets Posted January 29, 2004 Author Posted January 29, 2004 Thanks, I took a look at hotmail. I added the lines in bold, however it does fill in the domain for me. I am new to java script and I am trying to learn it. If anyone knows what I am doing wrong, any help would be greatly appreciated. Thanks, Jeff <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/javascript"> <!-- function squirrelmail_loginpage_onload() { document.forms[0].js_autodetect_results.value = '1'; var sLogin=document.forms[0].login_username.value; if (sLogin.indexOf('@') == -1) {document.forms[0].login_username.value = document.forms[0].login_username.value + "@jeffrusso.net";} } // --> </script> </head> <body> <form method="post" action="http://www.jeffrusso.net/sqmail/src/redirect.php"> <input type="hidden" name="js_autodetect_results" value="0"> User : <input type="text" name="login_username" size="30"><br><br> Password: <input type="password" name="secretkey" size="30"> <input type="submit" value="Login"> </form> </body> </html> Quote
TCH-Rick Posted January 29, 2004 Posted January 29, 2004 There is a Webmail Javascript on the Help Pages that will do what you want. It is written for Horde but can be changed to access NeoMail and possibly SquirrelMail. I have not tried rewriting it woth SquirrelMail so I cannot say for sure. Quote
jrsweets Posted January 29, 2004 Author Posted January 29, 2004 I've tried using that script as is (I added my domain to the one line). The problem I had is that a box always came up where it asks you to enter a network password. "username + domain.com" is already filled in. If you try using the demo from the link you gave me, you will see the same problem I had. Quote
ankanoju Posted December 22, 2004 Posted December 22, 2004 I've tried using that script as is (I added my domain to the one line). The problem I had is that a box always came up where it asks you to enter a network password. "username + domain.com" is already filled in. If you try using the demo from the link you gave me, you will see the same problem I had. <{POST_SNAPBACK}> Has a solution ever been found for this question? Removing the need for a domain name would add a "professional" touch to the webmail interface. Quote
LisaJill Posted December 22, 2004 Posted December 22, 2004 Because these are shared and there may be many usernames on the server, it is important that they be differentiated - the way to do that is with the domain name. For instance, I could be lisa+lisa-jill.com, and I could also (and do) have lisa+distantearlymorning.com - if I just used lisa, the server would have no way of knowing WHICH lisa. So I don't believe there will be a solution for this because it's not really broken.... Quote
ankanoju Posted December 22, 2004 Posted December 22, 2004 Because these are shared and there may be many usernames on the server, it is important that they be differentiated - the way to do that is with the domain name. For instance, I could be lisa+lisa-jill.com, and I could also (and do) have lisa+distantearlymorning.com - if I just used lisa, the server would have no way of knowing WHICH lisa. So I don't believe there will be a solution for this because it's not really broken.... <{POST_SNAPBACK}> I understand the need for the domain. My question is if it is possible to have the domain be defaulted in the javascript so that the user doesn't have to enter it. Quote
ankanoju Posted December 22, 2004 Posted December 22, 2004 This works for me. Replace the ?'s with the domain and server number. <html> <head> <script language="JavaScript" type="text/javascript"> <!-- function add_domain() { var sLogin=document.forms[0].login_username.value; if ((sLogin.indexOf('@') == -1) && (sLogin != "")) { document.forms[0].login_username.value = document.forms[0].login_username.value + "@?????.com"; } } function squirrelmail_loginpage_onload() { document.forms[0].js_autodetect_results.value = '1'; } // --> </script> </head> <body onLoad="self.focus();document.forms[0].login_username.focus()"> <form method="post" action="http://server??.totalchoicehosting.com/sqmail/src/redirect.php"> <input type="hidden" name="js_autodetect_results" value="0"> User: <input type="text" onBlur="add_domain();" name="login_username" size="20"><br><br> Password: <input type="password" name="secretkey" size="20"><br><br> <input type="submit" value="Login"> </form> </body> </html> Quote
TCH-Bruce Posted December 22, 2004 Posted December 22, 2004 (edited) Thank you for posting your solution. I'm sure others will benefit from it. Edited December 22, 2004 by TCH-Bruce Quote
ankanoju Posted December 22, 2004 Posted December 22, 2004 Bruce, Can you update this page with working code? http://totalchoicehosting.com/help/id38.htm Quote
TCH-Bruce Posted December 22, 2004 Posted December 22, 2004 I can't but I will pass along the information to someone who can. Quote
Samrc Posted December 23, 2004 Posted December 23, 2004 Code works like a charm! Thank you for providing it. Added it to my site for easier access when I am out of town. 2 out of 4 wishes granted in 2 days WOW! Still to go but not expected to be resolved soon: - Wish there were some way to use a similar entry form into a password protected page instead of the default popup window when using Web Protect feature in cpanel. - Free website search code that includes PDF files (FastFind is great...but doesn't support PDF) -Samantha Quote
TCH-Thomas Posted December 23, 2004 Posted December 23, 2004 (edited) - Free website search code that includes PDF files (FastFind is great...but doesn't support PDF) Try this one: http://www.kscripts.com/scripts.shtml Don´t know if it works since I never tried it. Edited December 23, 2004 by TCH-Thomas Quote
FarmerTodd Posted April 18, 2007 Posted April 18, 2007 When implementing the squirelmail script, it pops up another login screen (so kinda defeats the purpose): The server www.my domain name.com at WebMail requires a username and password. Warning: This server is requesting that your username and password be sent in an insecure manner (basic authentication without a secure connection). When modifying the script for my server, I had to change the server path to <form method="post" action="http://www.my domain name.com/3rdparty/squirrelmail/src/webmail.php"> and I tried with the redirect.php ending, but both act the same. Any ideas? Thanks, Todd Quote
TCH-Don Posted April 24, 2007 Posted April 24, 2007 Thanks for the update. What was the solution? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.