Toggle between Member Activation and Member Approval during Registration

Started by stealth420, March 28, 2006, 03:00:49 PM

Previous topic - Next topic

stealth420

I am new to SMF coming from phpbb... I hacked a mod in phpbb to check the email address during registration and let people self-activate if they are in the list of approved email addresses. Everyone else had to have admin approval.

Can anyone give me a pointer or two on the best way to do this in SMF?

I'm thinking it could be as simple as setting $register_vars 'is_activated' to 1 after these values are initialized in register.php line 209. I would do my check and then set the value to 1 if they are on the list. Not sure if I also need to do something with 'validation_code'

Appreciate any pointers.

Thanks!

stealth420

Okay... I found this:
http://www.simplemachines.org/community/index.php?topic=37296.0

but, it looks like 1.0 code.

'is_activated' => in_array($_POST['email'], $emails) || empty($modSettings['registration_method']) || (!isset($_POST['emailActivate']) && $user_info['is_admin']) ? 1 : 0,

if (in_array($_POST['email'], $emails) || empty($modSettings['registration_method']))

I decided to go with 1.1 RC2.

Anyone have any update that will work with 1.1?

'require' => !empty($modSettings['coppaAge']) && !isset($_POST['skip_coppa']) ? 'coppa' : (empty($modSettings['registration_method']) ? 'nothing' : ($modSettings['registration_method'] == 1 ? 'activation' : 'approval')),

stealth420

Well....I think I got it... Thanks for the help  8)


      'require' => !empty($modSettings['coppaAge']) && !isset($_POST['skip_coppa']) ? 'coppa' : (empty($modSettings['registration_method']) ? 'nothing' : ($modSettings['registration_method'] == 1 || $_POST['email'] == '[email protected]' ? 'activation' : 'approval')),


and

         'description' => $modSettings['registration_method'] == 2 && $_POST['email'] != '[email protected]' ? $txt['approval_after_registration'] : $txt['activate_after_registration']

Advertisement: