I actually figured it out with some help. I hope this will be implemented
in the next SquirrelMail release, some other people may find this helpful.
Final code modifications for the new SquirrelMail /scr/login.php is as
follows:

$header = "<script language=\"JavaScript\" type=\"text/javascript\">\n" .
          "<!--\n".
         "  function addDomain(element) {\n".
         "        var str = element.value; \n".
         "           if(str.search(/[EMAIL PROTECTED]/)==-1) { \n".
         "        element.value = element.value + \"@domain.net\";\n".
         "        }\n".
         "  }\n".
          "  function squirrelmail_loginpage_onload() {\n".
...

html_tag( 'td',
     '<input type="text" name="' . $username_form_name .'" value="' .
$loginname_value .'" onChange="javascript:addDomain(this);" />' ,
      'left', '', 'width="*"' )


further the JS search funcion can be modified to:

"           if(str.search(/\@/)==-1) { \n".

so the script detects only if the @ sign is inserted or not in the
username field and not the whole @domain.net

Thanks for your input.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
--
squirrelmail-users mailing list
List Address: [EMAIL PROTECTED]
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to