<?xml version="1.0" encoding="utf-8"?>
<service name="magnolia"
         version="$Id: magnolia.xml 19845 2008-08-08 21:12:47Z manish $"
         xmlns="http://www.flock.com/web-detective#">

  <strings>
    <string name="domains" value="gnolia.com"/>

    <string name="homePageURL" locale="default">
      <![CDATA[http://ma.gnolia.com/]]>
    </string>

    <string name="loginURL" locale="default">
      <![CDATA[http://ma.gnolia.com/signin]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host="ma.gnolia.com" name="_Ma.gnolia_session" path="/" />
    <cookie host="ma.gnolia.com" name="Magnolia_Auth_Method" path="/" />
  </sessioncookies>

  <detect type="login">
    <url domain="ma.gnolia.com"/>
    <form>
      <xpath extract="value">
        <![CDATA[//select[@id="preferred_auth_provider_name"]]]>
        <regexp><![CDATA[/Magnolia/i]]></regexp>
      </xpath>
      <xpath name="username" extract="value">
        <![CDATA[[contains(@action,"authentication/signin_dispatcher")]//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="password"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup">
    <url domain="ma.gnolia.com"><path contains="/join"/></url>
    <form>
      <field tagname="input" fieldid="signup_user_screen_name" extractas="username"/>
      <field tagname="input" fieldid="password_confirmation" type="password" extractas="password"/>
    </form>
  </detect>

  <detect type="changepassword">
    <url domain="ma.gnolia.com"><path contains="/account/profile"/></url>
    <document>
      <regexp re1="username">
        <![CDATA[/ma.gnolia.com\/people\/(.*)\/tags"/]]>
      </regexp>
    </document>
    <form>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="password_confirm"][@type="password"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="loggedin">
    <url domain="ma.gnolia.com"/>
    <xpath>
      <![CDATA[//head/meta[@name="session-loggedin"][@content="y"]]]>
    </xpath>
  </detect>

  <detect type="loggedout">
    <url domain="ma.gnolia.com"/>
    <xpath>
      <![CDATA[//head/meta[@name="session-loggedin"][@content="n"]]]>
    </xpath>
  </detect>

  <detect type="accountinfo">
    <url domain="ma.gnolia.com"/>
    <xpath name="accountid" extract="attribute:content">
      <![CDATA[//head/meta[@name="session-userid"]]]>
    </xpath>
  </detect>

</service>
