Hi Tom,

> I have raised the issue before about logging into sites that
> require session id's and the like. I was looking at one today
> that is like this with the wizard pulling back:
>   <input type="hidden" name="authenticity_token"
>    value="55a1820d6538b36c0129c590dc4e4591007c38f9" />
> Shawn has mentioned I think that one needs to do a first pass
> to get this authentication code. Is there any common javascript
> routine we could have that we could call to do some of this
> work?

If you look in yy.xml you'll see an example that's based on the
"yyfsupport" function. Here's one (that doesn't require a supporting
function) specific to the field you posted (replace "yourform" with
whatever your form name is):

  try{
    var r;
    idSession = "";
    sUrl = "http://example.com/";;
    var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
    xmlHttp.open("GET", sUrl, false);
    xmlHttp.send("");
    var sBody = xmlHttp.responseText;
    var rx = /authenticity\_token"\svalue\="([^"]+)"\>/g;
    while ((r = rx.exec(sBody)) != null){
      idSession = r[1];
    }
    document.formname.login.value = idSession;
  }catch(e){}

That SHOULD do it for you. :)

We could put something similar to the yyfsupport function in the base
code, I think, which would make this kind of thing a lot easier.

-Shawn



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
DQSD-Users@lists.sourceforge.net
http://sourceforge.net/mailarchive/forum.php?forum_id=8601

Reply via email to