LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Really Simple SquirrelMail problem (https://www.linuxquestions.org/questions/linux-newbie-8/really-simple-squirrelmail-problem-470781/)

cyberguy03 08-04-2006 11:33 AM

Really Simple SquirrelMail problem
 
So on a webpage, I have (on the sidebar) two textFields for inputting the user's name and pass, as well as a button for submitting it. How do I make it send this information to SquirrelMail to authenticate?

The webmail login page is located at
'http://webmail.mydomain.com/src/login.php'

Thanks in advance.

cyberguy03 08-04-2006 04:12 PM

Once again, I have found the solution after alot of digging.

I couldn't get the form to work (it would give me errors like 'you must be logged in' or 'bad user/pass' because I forgot these to hidden fields in the form:

Code:

<input type="hidden" name="js_autodetect_results" value="0">
          <input type="hidden" name="just_logged_in" value="1">

and I got this bit of JS from SquirrelMail's own doc:

Code:

function squirrelmail_loginpage_onload() {
  document.forms[0].js_autodetect_results.value = '1';
  for (i = 0; i < document.forms[0].elements.length; i++) {
    if (document.forms[0].elements[i].type == "text" || document.forms[0].elements[i].type == "password") {
      document.forms[0].elements[i].focus();
      break;
    }
  }
}

this you add to the head and call in the body.

Hope this can be helpful to anyone else.


All times are GMT -5. The time now is 07:21 AM.