Re: [Hastymail-devel] Integrating Hastymail with my sign in
Brought to you by:
sailfrog,
slushpupie
From: Jason M. <ja...@st...> - 2005-06-21 17:14:59
|
On 9:09:09 pm 06/20/05 "J. Harper" <gt...@ma...> wrote: > I already have a members-only system for my site, and I am trying to > integrate the Hastymail sign in to my sign-in, so that my users don't > have to sign in twice. The obvious solution is, of course, to just > print out a form with all of the users information after I have > completed my sign in process, and then do a javascript onload = > document.form.submit(). However, if possible, I would prefer to not > use this solution, as it may pose a security risk with caching and > the fact that I'm not using secure connections. > > To make things even more complicated, I'm operating on two different > subdomains here- the users sign in at www.mysite.com, but I want them > to be redirected to webmail.mysite.com after sign in. I've been > trying the code below, but with no luck. Does anyone have any > suggestions or know what I'm doing wrong, or a way to do this? You only need to supply 3 pieces of information to mailbox.php in order to start the login process. Hastymail treats both POST and GET as the same so even though the login page is a POST you can actually pass the information as GET values and it will work. For example if my username is "jason" and my password is "blah" the following URL will log me in: https://hastymail/html/mailbox.php?user=jason&pass=blah&login=1 The last variable, "login", must be present but its value can be anything since we are only checking if it is present or not. You could easily create a short page that is loaded when the webmail link is clicked from your existing site that contains enough PHP to get the username and password, possibly invalidate the current session data in PHP to keep things clean then uses header(Location:) to send the user to a url like the one above and they will be logged in :) Hope that helps! \__ Jason Munro \__ ja...@st... \__ http://hastymail.sourceforge.net/ |