Код:$Password = genPassword(8);
$IsChecked = ($nc_core->get_settings('premoderation', 'auth') || $nc_core->get_settings('confirm', 'auth')) ? 0 : 1;
$groups = explode(',', $nc_core->get_settings('group', 'auth'));
// добавляю пользователя с Checked = 0 и RegistrationCode
$message = $nc_core->user->add( array(
'Login' => $AUTH_USER,
'Email' => $AUTH_USER),
$groups,
$Password,
array(
'Checked' => $IsChecked,
'RegistrationCode' => md5(uniqid(rand())),
'Catalogue_ID' => $catalogue) );
// подтверждение через почту
if ( $settings['confirm'] ) {
$mailinfo = $nc_auth->get_confirm_mail( $message );
$mail_body = nc_mail_attachment_attach($mailer, $mailinfo['body'], 'auth_confirm_' . $catalogue);
$mailer->mailbody( strip_tags($mail_body), $mailinfo['html'] ? $mail_body : "");
$mailer->send($mailinfo['user_email'], $system_env['SpamFromEmail'], $system_env['SpamFromEmail'], $mailinfo['subject'], $system_env['SpamFromName']);
}