Restrict Registration Form

Hello,

In my virtual airline’m using a separate system PHPVMS to the evaluation and admission of new crew. (And a kind of training center)

I would like to leave the PHPVMS the registration page restricted to staff.

After the pilot is approved in the proof of the training center, a staff makes the registration manually in PHPVMS.

core/modules/Registration/Registration.php

find this

$this->render('registration_mainform.tpl');

replace it with this

if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
$this->render('registration_mainform.tpl');
} else {
echo 'Not Authorised!';
}

I see now, they are not logged in, ha. (get forgetful once every while)

Grandes obras, mas eu tenho um outro problema. Por padrão logado usuários não possam fazer o registro, sabe poderia mudar isso?

Managed to solve, it only took delete the line:

if(Auth::LoggedIn()) // Make sure they don't over-ride it
 {
  $this->render('login_already.tpl');
  return;
 }

Thank you so much for services armpits.