You have several alternatives here. Firstly, the best way I can think of to "reject" a user registration is to send them to the home so I'm going to follow that approach in the following examples. I've listed them here based on how soon you want to reject the request (#1 is sooner than #2).
1. Block access via .htaccess to the register URL or make a 302 redirect to your home. Make sure to make it case insensitive. PHP is not even involved in this stage.
public function init_page() {
if (qa_request() === 'register') {
qa_redirect(''); // Also performs a 302 redirect to the home
}
}
function qa_page_routing() {
$routes = qa_page_routing_base();
unset($routes['register']);
return $routes;
}
4. Use a layer plugin and overwrite the doctype() function:
public function doctype() {
if ($this->template === 'register') {
qa_redirect(''); // Also performs a 302 redirect to the home
}
}
5. Apply the same code in #4 in the qa-theme.php file
Finally, bear in mind that for #2, #3, #4 and #5 you should remove all links to the register page.