On Mon, 30 Jul 2001, pp wrote:

> > > I want to use multi database system so I do not see any sense 
> > > to use sitegroup
> 
> good, I thought that sitegroup is neccesary

No it is not, but some admin interfaces expect it. 

> ok, have a look:
> 
> if ( isset ($TestCookie)) { 
> // was sent in code-init, returns true
>  mgd_auth_midgard(login,pass); 
   
use mgd_auth_midgard(login,pass,0) if you don't want to send a cookie.

>  $newmidgard = mgd_get_midgard(); 
>  $uzer = mgd_get_person($newmidgard->user); 
>  $k = mgd_get_person($uzer->id); 

strange... wouldn't $uzer and $k now be object referring to the same
person record?

> echo "$uzer->username....$k->id";  // works good

> mgd_create_topic($t->id,$TestCookie,'1','1',$uzer->id,'2'); 

should create a topic under topic with id $t->id, with name =
"$TestCookie", description = '1', extra='1', owner = $uzer->id, code =
'2');

however, a topic should be owned by a group, not a person. If you indeed
have the parent topic in an object $t, probably you want to replace
$uzer->id with $t->owner.

> // $uzer is in $t group owner
> and here return false

Try this for the last bit of the script:

  if(mgd_create_topic($t->id,$TestCookie,'1','1',$t->owner,'2')) {
     /* okay, continue with what you want to do */
  } else {
    echo "create topic failed. Reason: " . mgd_errstr();
  }

This would hopefully provide you with a descriptive message as to why the
topic could not be created.

-- 
Envida                     http://www.envida.net/
Armand A. Verstappen       Graadt van Roggenweg 328
[EMAIL PROTECTED]       3531 AH Utrecht
tel: +31 (0)30 298 2255    Postbus 19127
fax: +31 (0)30 298 2111    3501 DC Utrecht


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

Reply via email to