Hi,

> Paul Newby wrote:
>
> > Well, it does work.  Only thing is, it's not obvious (to me)
> > how to return the id from mgd_create_person or other status
> > from the protected page.  Any thoughts?
>
> You'll have to parse back the input if you want to use this method.
>

Yes, but we do not necessarily need to parse anything.
here is a short example :

on page /adduser/ :
<?
if($pid=mgd_create_person($firstname, $lastname, $birthdate, $street,
$postcode, $city, $handphone, $homephone, $workphone, $homepage, $email,
$topic, $department, $office, $extra))  // all parameters passed by url
{
  mgd_update_password($pid,$name,$password);
  mgd_create_member($pid,$group_id,"");
  echo $pid;
}
else
  echo "0";
?>

in fact, it would be better to place this code in the code-global page
element, to avoid the output of html stuff. This way, we just have the
person id in the resulting page, and it is easier to parse.

here is the new code on the self-registration page:
<?
if(isset($user_name) && isset($user_pwd))
{
  $adm_name="admin";
  $adm_pwd="password";

$url_adduser="http://$adm_name:$[EMAIL PROTECTED]/adduser/?name=$u
ser_name&password=$user_pwd&firstname=.........and so on for each
parameter";

  if($file=fopen($url_adduser) && ($pid=fgets($file,128)))
  {
    $person=mgd_get_person($pid);
    ?>Welcome &(person.firstname); &(person.lastname);.<?
    fclose($file);
  }
  else
  {
    ?>Failed adding user &(user_name);<?
  }
}
?>

I didn't test this one either, but this should work fine too...

> emile

[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