| @@ 60-67 (lines=8) @@ | ||
| 57 | user = User.from_omniauth(@auth) |
|
| 58 | ||
| 59 | # Add pending role if approval method and is a new user |
|
| 60 | if approval_registration && !@user_exists |
|
| 61 | user.add_role :pending |
|
| 62 | ||
| 63 | # Inform admins that a user signed up if emails are turned on |
|
| 64 | send_approval_user_signup_email(user) if Rails.configuration.enable_email_verification |
|
| 65 | ||
| 66 | return redirect_to root_path, flash: { success: I18n.t("registration.approval.signup") } |
|
| 67 | end |
|
| 68 | ||
| 69 | send_invite_user_signup_email(user) if Rails.configuration.enable_email_verification && |
|
| 70 | invite_registration && !@user_exists |
|
| @@ 46-51 (lines=6) @@ | ||
| 43 | @user.save |
|
| 44 | ||
| 45 | # Set user to pending and redirect if Approval Registration is set |
|
| 46 | if approval_registration |
|
| 47 | @user.add_role :pending |
|
| 48 | ||
| 49 | return redirect_to root_path, |
|
| 50 | flash: { success: I18n.t("registration.approval.signup") } unless Rails.configuration.enable_email_verification |
|
| 51 | end |
|
| 52 | ||
| 53 | send_registration_email if Rails.configuration.enable_email_verification |
|
| 54 | ||