SMF Support > SMF 2.0.x Support

registerMember() Function Difficulties

(1/4) > >>

LiquidFusi0n:
Hi Guys,

I am trying to integrate the SMF user registration with my own user registration. I have read elsewhere that it's best to use the registerMember() function to accomplish this.

So I've included SSI.php and Subs-Members.php and am passing my data like this.


--- Code: ---$regOptions = array(
'interface' => 'guest',
'username' => $_POST['username'],
'email' => $_POST['email'],
'password' => $_POST['password'],
'password_check' => $_POST['password'],
'check_reserved_name' => true,
'check_password_strength' => false,
'check_email_ban' => false,
'send_welcome_email' => isset($_POST['emailPassword']) || empty($_POST['password']),
'require' => isset($_POST['emailActivate']) ? 'activation' : 'nothing',
'memberGroup' => empty($_POST['group']) || !allowedTo('manage_membergroups') ? 0 : (int) $_POST['group'],
);

include('/Users/business/Sites/forums/SSI.php');
include('/Users/business/Sites/forums/Sources/Subs-Members.php');

registerMember($regOptions);

--- End code ---

The form is submitting and bringing up the shell of the SMF front page, I'm not sure why it is doing this. The main issue however is that the user account is not being created in the DB and I am unable to login?

Any help with this is appreciated greatly!

Regards,
LiquidFusi0n

Arantor:
Personally I'd drop any other system and rely solely on SMF's, but that's just me.

Um, how does the allowedTo() check work when it's used prior to SSI.php (which loads Security.php which defines allowedTo())?

LiquidFusi0n:
Unfortunately I have to rely on my own system because of it's bespoke nature :(

I'm sorry but I don't quite understand what you mean, include Security then run allowedTo? I thought SSI had to be included before anything else could be?

***EDIT***

Just of intuition I ran allowedTo() before SSI and as expected it's an undefined function.

I ran it after and nothing is shown / returned :?

Thanks for the reply.

Arantor:
Well, your own code had SSI.php included AFTER you declared your array - which uses allowedTo().

Anyway, registerMember doesn't show anything, I don't believe it returns anything else - why would it? But does it update the table afterwards?

Failing that, anything in the forum or system error log?

LiquidFusi0n:
My apologies I didn't spot that function in the array.

I have moved the array now this time there is no front page shell loaded, instead my script redirects as it should... however the users are still not being added to the SMF DB.

Nothing in the forum log, and only warnings about Theme not being found in my system error_log which has nothing to do with my current issue.

It's all a little confusing, no error to indicate what I'm doing wrong? Is there any form of debugging output for SMF?

Navigation

[0] Message Index

[#] Next page

Go to full version