Hi,


Another technique I have discussed with Jean-Pierre is with the
mgd_auth_midgard function.
It is more elegant as we don't need to call another page.
I tested it on midgard 1.2.5, but maybe it will need more testing because I
don't know if my version is bugged on cookies.

here is the code:

<!-- page content -->
<form action="&(midgard.uri);" method=post>
<input type=text name=name>
<input type=text name=password>
... other input fields ...
<input type=submit>
</form>

<?
if($name && $password)
{
  $group_id=mgd_get_group_by_name("guests");
  mgd_auth_midgard($admin_name,$admin_pwd);
  if($pid=mgd_create_person($firstname, $lastname, $birthdate, $street,
$postcode, $city, $handphone, $homephone, $workphone, $homepage, $email,
$topic, $department, $office, $extra))  // all parameters passed by form
  {
    mgd_update_password($pid,$name,$password);
    mgd_create_member($pid,$group_id,"");
  }
  mgd_auth_midgard($name,$password);
}
?>
<!-- /page content -->

!!!!! you may want to put set_cookie('MidgardLogin'); at the very beginning
of the code-global page element to erase the cookie set by mgd_auth_midgard
(mine doesn't seem to set any cookie so I can't check this).

Comments ?

[EMAIL PROTECTED]


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to