firebase-authentication
/
admin
/
partials
/
config
/
class-mo-firebase-authentication-admin-loginsettings.php
class-mo-firebase-authentication-admin-advsettings.php
1 year ago
class-mo-firebase-authentication-admin-config.php
3 weeks ago
class-mo-firebase-authentication-admin-licensing-plans.php
3 weeks ago
class-mo-firebase-authentication-admin-loginsettings.php
2 weeks ago
class-mo-firebase-authentication-admin-loginsettings.php
130 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Firebase Authentication Login Settings |
| 4 | * |
| 5 | * @package firebase-authentication |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Displays Login Settings screen |
| 10 | */ |
| 11 | class Mo_Firebase_Authentication_Admin_LoginSettings { |
| 12 | /** |
| 13 | * Function to render login settings screen |
| 14 | * |
| 15 | * @return void |
| 16 | */ |
| 17 | public static function mo_firebase_authentication_loginsettings() { |
| 18 | $host = ''; |
| 19 | if ( isset( $_SERVER['HTTP_HOST'] ) ) { |
| 20 | $host = sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ); |
| 21 | } |
| 22 | ?> |
| 23 | <div class="row"> |
| 24 | <div class="col-md-12"> |
| 25 | <div class="mo_firebase_auth_card" style="width:100%"> |
| 26 | <div style="display: inline-block;"><h3 style="margin: 10px 0;">Sign in options </h3></div> <small style="color: #FF0000"><a href="admin.php?page=mo_firebase_authentication&tab=licensing_plans">[ENTERPRISE]</a></small><br> |
| 27 | <strong style="font-weight: 600; vertical-align: top; ">Option 1: Place different social login buttons on WordPress default Login Form</strong> |
| 28 | <ol> |
| 29 | <p>1. Go to the Advanced Settings tab.<br> |
| 30 | 2. Select <b>"Show Login button on WP login page"</b>.</p> |
| 31 | </ol> |
| 32 | <strong style="font-weight: 600; vertical-align: top; ">Option 2: Use a Shortcode for login</strong> |
| 33 | <ol> |
| 34 | <p>1. Place shortcode <b>[mo_firebase_auth_login_ui]</b> to add Firebase Phone Login button on WordPress pages.<br> |
| 35 | 2. Place shortcode <b>[mo_firebase_auth_login]</b> in WordPress pages or posts where you want to give social login option to your users.<br> |
| 36 | 3. Place shortcode <b>[mo_firebase_auth_display_login_form]</b> to add Firebase Login form on WordPress pages.<br> |
| 37 | 4. Place shortcode <b>[mo_firebase_auth_display_registration_form]</b> to add Firebase Registration form on WordPress pages.</p> |
| 38 | </ol> |
| 39 | </div> |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | <div class="row"> |
| 44 | <div class="col-md-12"> |
| 45 | <div class="mo_firebase_auth_card" style="width:100%"> |
| 46 | <div style="display: inline-block;"><h3 style="margin: 10px 0;">Advanced Sign in options</h3></div> <small style="color: #FF0000"><a href="admin.php?page=mo_firebase_authentication&tab=licensing_plans">[PREMIUM]</a></small><br> |
| 47 | <form name="f" method="post" action=""> |
| 48 | <?php wp_nonce_field( 'mo_firebase_auth_sign_in_option_form', 'mo_firebase_auth_sign_in_option_field' ); ?> |
| 49 | <input type="hidden" name="option" value="mo_firebase_authentication_sign_in_option" /> |
| 50 | <div class="row"> |
| 51 | <div class="col-md-6"> |
| 52 | <p style="margin-bottom: 3px"><b>Custom redirect URL after login </b></p> |
| 53 | <p>(Keep blank in case you want users to redirect to page from where SSO originated)</p> |
| 54 | </div> |
| 55 | <div class="col-md-6"> |
| 56 | <input name="custom_after_login_url" value="" pattern="https?://.+" title="Include https://" placeholder="https://" style="width:80%; font-size: 14px;" type="url" disabled=""> |
| 57 | </div> |
| 58 | </div> |
| 59 | <div class="row"> |
| 60 | <div class="col-md-6"> |
| 61 | <p style="margin-bottom: 3px"><b>Custom redirect URL after logout </b></p> |
| 62 | </div> |
| 63 | <div class="col-md-6"> |
| 64 | <input name="custom_after_logout_url" value="" pattern="https?://.+" title="Include https://" placeholder="https://" style="width:80%; font-size: 14px;" type="url" disabled=""> |
| 65 | </div> |
| 66 | </div><br/> |
| 67 | <div class="row"> |
| 68 | <div class="col-md-6"> |
| 69 | <p style="margin-bottom: 3px"><b>Redirect URL if email is not verified </b></p> |
| 70 | </div> |
| 71 | <div class="col-md-6"> |
| 72 | <input name="custom_after_logout_url" value="" pattern="https?://.+" title="Include https://" placeholder="https://" style="width:80%; font-size: 14px;" type="url" disabled=""> |
| 73 | </div> |
| 74 | </div><br/> |
| 75 | <div class="row"> |
| 76 | <div class="col-md-6"> |
| 77 | <p style="margin-bottom: 3px"><b>Redirect URL if Oob code is invalid </b></p> |
| 78 | </div> |
| 79 | <div class="col-md-6"> |
| 80 | <input name="custom_after_logout_url" value="" pattern="https?://.+" title="Include https://" placeholder="https://" style="width:80%; font-size: 14px;" type="url" disabled=""> |
| 81 | </div> |
| 82 | </div><br/> |
| 83 | <div class="row"> |
| 84 | <div class="col-md-6"> |
| 85 | <p style="margin-bottom: 3px"><b>Redirect URL if Oob code is invalid </b></p> |
| 86 | </div> |
| 87 | <div class="col-md-6"> |
| 88 | <input name="custom_after_logout_url" value="" pattern="https?://.+" title="Include https://" placeholder="https://" style="width:80%; font-size: 14px;" type="url" disabled=""> |
| 89 | </div> |
| 90 | </div><br/> |
| 91 | <div class="row"> |
| 92 | <div class="col-md-6"> |
| 93 | <p style="margin-bottom: 3px"><b>Error message to be displayed if user email is not verified</b></p> |
| 94 | </div> |
| 95 | <div class="col-md-6"> |
| 96 | <input name="error_message_if_email_not_verified" value="" placeholder="Your email is not verified. Please verify your email"style="width:80%;" type="text" disabled=""> |
| 97 | </div> |
| 98 | </div><br/> |
| 99 | <br> |
| 100 | <div class="row"> |
| 101 | <div class="col-md-6"> |
| 102 | <p style="margin-bottom: 3px"><b>Set cookies for the domain</b></p> |
| 103 | <p>This will set Firebase JWT of the user in the<b> mo_firebase_jwt_cookie </b></p> |
| 104 | </div> |
| 105 | <div class="col-md-6"> |
| 106 | <input name="set_cookie_for_domain" value=""placeholder=".<?php echo esc_attr( $host ); ?>"style="width:80%;" type="text" disabled=""> |
| 107 | </div> |
| 108 | </div> |
| 109 | <br> |
| 110 | <div class="row"> |
| 111 | <div class="col-md-10"> |
| 112 | <input type="checkbox" id="mo_firebase_email_verified_login" name="mo_firebase_email_verified_login" value="1" <?php echo esc_attr( get_option( 'mo_firebase_email_verified_login' ) ? 'checked' : '' ); ?>> |
| 113 | <label for="mo_firebase_email_verified_login" style="font-weight: bolder;font-size: 13px">Do Not allow login if email is not verified </label><br> |
| 114 | <p><strong>Note:</strong> If this check is enabled then all users (except admin users) can login only with email & password and not with username & password.</p> |
| 115 | </div> |
| 116 | </div> |
| 117 | <div class="row"> |
| 118 | <div class="col-md-12"> |
| 119 | <input type="submit" style="text-align:center; font-size: 14px; font-weight: 400;" class="btn btn-primary" name="custom_login_settings" value=" Save Settings" id = "mo_firebase_auth_custom_login_url_save_settings_button"><br> |
| 120 | </div> |
| 121 | </div> |
| 122 | <br> |
| 123 | </form> |
| 124 | </div> |
| 125 | </div> |
| 126 | </div> |
| 127 | <?php |
| 128 | } |
| 129 | } |
| 130 |