I have a public page which allows users to sign up for their
own sitegroup. My basic algorithm looks like this... (not exact code)

------------------------
  mgd_auth_midgard( ROOT, ROOT_PASS, 0);
  $sg = mgd_create_sitegroup( $newsitename);
  mgd_unsetuid();

  mgd_auth_midgard( ROOT."!".$newsitename, ROOT_PASS, 0);
  $ag = mgd_create_group( $newsitename." admins", ...);
  $ug = mgd_create_group( $newsitename." users", ...);
  mgd_unsetuid();

  mgd_auth_midgard( ROOT, ROOT_PASS, 0);
  $rc = mgd_update_sitegroup( $sg, $newsitename, $ag, "");
-------------------------------

So, I notice a couple of things...

1. The final mgd_auth_midgard _SOMETIMES_ fails mysteriously, for no good reason. 
Printing mgd_errstr() shows something like "Object does not exist". As a result the 
mgd_update_sitegroup also fails.

2. I notice that doing:   unset( $midgard);
After the mgd_unsetuid() seems to help.  Can anyone explain why?

3. Documentation on midgard functions seems to be out of date:
   - mgd_update_sitegroup seems to take 4 args, not 3.

4. Could someone elaborate on the $midgard global var?  Is it always advised to set it 
after doing a mgd_auth_midgard????  E.g. 

   $midgard = mgd_get_midgard();

5. I've also noticed that when switching sitegroups, PHP variables get clobbered. E.g.

    mgd_auth_midgard( ROOT."!sitethree". ROOT_ADMIN, 0);
    $art = mgd_get_article( 12);

    mgd_auth_midgard( ROOT."!sitefive". ROOT_ADMIN, 0);

sometimes even causes apache to segfault!

TIA for any insight into these subjects...

/jim


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to