From 439942db98c2d11fd9101d05d03267fe8f60031f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= <gabor@hojtsy.hu>
Date: Fri, 14 Sep 2007 17:38:08 +0000
Subject: [PATCH] #168261 by mvc: redirect registered users back to the front
 page if admin approval is required, so their user account page is not
 directly accessible after registration

---
 modules/user/user.module | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/user/user.module b/modules/user/user.module
index 9d1c7ff3316e..5581bef8565f 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -2151,6 +2151,8 @@ function user_register_submit($form, &$form_state) {
       // Create new user account, administrator approval required.
       _user_mail_notify('register_pending_approval', $account);
       drupal_set_message(t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.<br />In the meantime, your password and further instructions have been sent to your e-mail address.'));
+      $form_state['redirect'] = '';
+      return;
 
     }
   }
-- 
GitLab