Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Need help modifying Register.php

Aloittaja borish, tammikuu 05, 2014, 12:11:09 IP

« edellinen - seuraava »

borish

Hallo,

I installed Password Mod, which requires a registration password upon which applicants are assigned to a membergroup. However, it doesn't work the way I want. I want applicants to be rejected if they don't enter a correct registration password. This is what I want to do in function Register2($verifiedOpenID = false) in Register.php:

/** start Registration Password Mod **/
if(isset($modSettings['registration_password_use']))
{
if(isset($_POST['registration_password']))
{
$request = $smcFunc['db_query']('', "
SELECT `id_group`, `group_name`
FROM `{$db_prefix}membergroups`
WHERE `min_posts` = -1 AND `id_group` != '1' AND `id_group` != '2' AND `id_group` != '3'",
array(
)
);
while ($row = $smcFunc['db_fetch_assoc']($request)){
$registration_field_name = 'registration_password_'.$row['id_group'];
if($modSettings[$registration_field_name] == $_POST['registration_password'] && $modSettings[$registration_field_name] != '')
{
$registration['gid'] = $row['id_group'];
break;
}
}
$smcFunc['db_free_result']($request);
}
else /** show error message & reject **/
}
/** end Registration Password Mod **/

There may be several registration password / membergroup combinations, hence the loop. How do I reject the applicant?

Greg Zimmerman

Your members will be assigned to the membergroup registered for them, they will also need a password, passwords are required to install the some mods as you said. Other bars that come in and register do not enter a password for the new Administration, if the registration has been rejected, this will be your number of registrations decreased by 1.


Advertisement: