tor, 18,.11.2004 kl. 19.37 +0100, skrev Medina Mennert: > Hi all, > > this problem was posted before > ( http://marc.theaimsgroup.com/?l=midgard-user&m=108239314929128&w=2 ) > but I did not find an answer to it in the list. > Why does mgd_create_member fail when used by root (= SG0-admin)? > I tried with the "normal" mgd_create_member() function and > the oo-method, both return an mgd_errstr like "access denied"... > > By the way, how does Aegir manage to create new members when I am logged in > as SG0-admin? > > just to clarify, here is the code: > <? > $uid = 123; //a person with this id exists in my system > $gid = 456; // same for group > $new_member = mgd_create_member($uid,$gid,'new member'); > if(!$new_member) die(mgd_errstr()); > ?> > > desperately looking for an answer, Hi, what you do, is to use the mgd_auth_midgard function to change to a user that is in the sitegroup you want to create a group for.
beware that this function is the midgard equivalent of a torturechamber to work with so be very carefull that nothing is emmitted from your scripts before you run it as it will then _silently_ fail! Tarjei > > Alex > > PS: i am using midgard 1.5.0 with aegir 1.0.1, > everything else seems to work just fine... > -- Tarjei Huse <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
