HELP Error when trying to create users in Phorum from main system

Posted by KWood 
Re: HELP Error when trying to create users in Phorum from main system
November 02, 2008 11:02AM
Hi
I think you got... my set uo is (a bit shortend)
IF ($edit_user==1)
{

"some code (updating userdata in main system)"

$curcwd = getcwd();
chdir("/hsphere/local/home/madam/madammangor.dk/medlemv2/phorum");
define('phorum_page','create_user');
global $PHORUM;
include_once("./common.php");
echo "Opret medlem";
phorum_api_user_save(array(
"user_id" => $idb, // or the user id from your main user database
"username" => $brugernavn,
"real_name" => $brugernavn,
"password" => $passencrypt,
"active" => $PH_status,
"hide_email"=> "TRUE",
"email" => $email1
));
chdir($curcwd);
" some more main DB code"
}ELSE{
"some code to insert a new user in main DB"

IF ($email1)
{
$curcwd = getcwd();
chdir("/hsphere/local/home/madam/madammangor.dk/medlemv2/phorum");
include("./common.php");
phorum_api_user_save(array(
"user_id" => $MID_insert, // or the user id from your main user database
"username" => $brugernavn,
"real_name" => $brugernavn,
"password" => $kodeord_krypt,
"active" => PHORUM_USER_ACTIVE,
"hide_email"=> "TRUE",
"email" => $email1
));
chdir($curcwd);
};
some more main code
};
even though the code only cant be run through once I have to remove the second include of common.php ???
Re: HELP Error when trying to create users in Phorum from main system
November 02, 2008 11:14AM
it shouldn't be run twice I guess but include common.php before the first condition to have the stuff available in both parts. you got lots of duplicated code there.
and like I told already: change the include to include_once.


Thomas Seifert



Edited 1 time(s). Last edit at 11/02/2008 11:15AM by Thomas Seifert.
Re: HELP Error when trying to create users in Phorum from main system
November 02, 2008 11:22AM
Just found my problem.... second set of Phorum is actually placed outside of the Else clause.... sorry :-)
Thanks at lot both of you for your help!!!!
Sorry, only registered users may post in this forum.

Click here to login