register.php
143 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Customer accounts tab screens |
| 4 | * |
| 5 | * @package firebase-authentication |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Show registration form in accounts tab |
| 10 | * |
| 11 | * @return void |
| 12 | */ |
| 13 | function mo_firebase_auth_register_ui() { |
| 14 | update_option( 'mo_firebase_authentication_new_registration', 'true' ); |
| 15 | $current_user = wp_get_current_user(); |
| 16 | ?> |
| 17 | <form name="f" method="post" action=""> |
| 18 | <input type="hidden" name="option" value="mo_firebase_authentication_register_customer" /> |
| 19 | <?php wp_nonce_field( 'mo_fb_register_form', 'mo_fb_register_form_nonce' ); ?> |
| 20 | <div class="" style="width:100%"> |
| 21 | <div class="mo_table_layout"> |
| 22 | <h3 style="margin-top: 0px;">Register with miniOrange<small style="font-size: x-small;"> [OPTIONAL]</small></h3> |
| 23 | <p style="font-size:14px;"><strong style="font-weight: 600;">Why should I register? </strong></p> |
| 24 | <div id="help_register_desc" style="background: aliceblue; padding: 10px 10px 10px 10px; border-radius: 10px;font-size: 12px;"> |
| 25 | You should register so that in case you need help, we can help you with step by step instructions. |
| 26 | <b>You will also need a miniOrange account to upgrade to the premium version of the plugins.</b> We do not store any information except the email that you will use to register with us. |
| 27 | </div> |
| 28 | </p> |
| 29 | <table class="mo_settings_table"> |
| 30 | <tr> |
| 31 | <td><strong><font color="#FF0000">*</font>Email:</strong></td> |
| 32 | <td><input class="mo_table_textbox3" type="email" name="email" |
| 33 | required placeholder="person@example.com" |
| 34 | value="<?php echo esc_attr( get_option( 'mo_firebase_authentication_admin_email' ) ); ?>" /> |
| 35 | </td> |
| 36 | </tr> |
| 37 | <tr class="hidden"> |
| 38 | <td><b><font color="#FF0000">*</font>Website/Company Name:</b></td> |
| 39 | <td><input class="" type="text" name="company" |
| 40 | required placeholder="Enter website or company name" |
| 41 | value="<?php echo isset( $_SERVER['SERVER_NAME'] ) ? esc_url( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : ''; //phpcs:ignore -- Using esc_url() instead of esc_url_raw() ?>"/></td> |
| 42 | </tr> |
| 43 | <tr class="hidden"> |
| 44 | <td><b> First Name:</b></td> |
| 45 | <td><input class="" type="text" name="fname" |
| 46 | placeholder="Enter first name" value="<?php echo esc_attr( $current_user->user_firstname ); ?>" /></td> |
| 47 | </tr> |
| 48 | <tr class="hidden"> |
| 49 | <td><b> Last Name:</b></td> |
| 50 | <td><input class="" type="text" name="lname" |
| 51 | placeholder="Enter last name" value="<?php echo esc_attr( $current_user->user_lastname ); ?>" /></td> |
| 52 | </tr> |
| 53 | |
| 54 | <tr class="hidden"> |
| 55 | <td><b> Phone number :</b></td> |
| 56 | <td><input class="" type="text" name="phone" pattern="[\+]?([0-9]{1,4})?\s?([0-9]{7,12})?" id="phone" title="Phone with country code eg. +1xxxxxxxxxx" placeholder="Phone with country code eg. +1xxxxxxxxxx" value="<?php echo esc_attr( get_option( 'mo_firebase_authentication_admin_phone' ) ); ?>" /> |
| 57 | This is an optional field. We will contact you only if you need support.</td> |
| 58 | </tr> |
| 59 | </tr> |
| 60 | <tr class="hidden"> |
| 61 | <td></td> |
| 62 | <td>We will call only if you need support.</td> |
| 63 | </tr> |
| 64 | <tr> |
| 65 | <td><strong><font color="#FF0000">*</font>Password:</strong></td> |
| 66 | <td><input class="mo_table_textbox3" required type="password" |
| 67 | name="password" placeholder="Choose your password (Min. length 8)" /></td> |
| 68 | </tr> |
| 69 | <tr> |
| 70 | <td><strong><font color="#FF0000">*</font>Confirm Password:</strong></td> |
| 71 | <td><input class="mo_table_textbox3" required type="password" |
| 72 | name="confirmPassword" placeholder="Confirm your password" /></td> |
| 73 | </tr> |
| 74 | <tr> |
| 75 | <td> </td> |
| 76 | <td> </td> |
| 77 | </tr> |
| 78 | <tr> |
| 79 | <td> </td> |
| 80 | <td><input type="submit" name="submit" value="Register" class="button button-primary button-large" style="margin-right: 15%;"/><input type="button" name="mo_firebase_authentication_goto_login" id="mo_firebase_authentication_goto_login" value="Already have an account?" class="button button-primary button-large" /></td> |
| 81 | </tr> |
| 82 | </table> |
| 83 | <!-- <div style="width: 50%; margin:auto;"> |
| 84 | <br><input type="submit" name="submit" value="Register" class="button button-primary button-large" style="margin-right: 15%;"/> |
| 85 | <input type="button" name="mo_firebase_authentication_goto_login" id="mo_firebase_authentication_goto_login" value="Already have an account?" class="button button-primary button-large" /><br> |
| 86 | </div> --> |
| 87 | <br> |
| 88 | </div> |
| 89 | </div> |
| 90 | </form> |
| 91 | <form name="f1" method="post" action="" id="mo_firebase_authentication_goto_login_form"> |
| 92 | <?php wp_nonce_field( 'mo_firebase_authentication_goto_login_form', 'mo_firebase_authentication_goto_login_form_field' ); ?> |
| 93 | <input type="hidden" name="option" value="mo_firebase_authentication_goto_login"/> |
| 94 | </form> |
| 95 | <script> |
| 96 | jQuery("#phone").intlTelInput(); |
| 97 | jQuery('#mo_firebase_authentication_goto_login').click(function () { |
| 98 | jQuery('#mo_firebase_authentication_goto_login_form').submit(); |
| 99 | } ); |
| 100 | </script> |
| 101 | <?php |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Show logged in customer info in account tab |
| 106 | * |
| 107 | * @return void |
| 108 | */ |
| 109 | function mo_firenase_auth_show_customer_info() { |
| 110 | ?> |
| 111 | <div class="mo_table_layout"> |
| 112 | <h6 style="margin-top: 0px;">Thank you for registering with miniOrange.</h6><br> |
| 113 | |
| 114 | <table border="1" style="background-color:#FFFFFF; border:1px solid #CCCCCC; border-collapse: collapse; padding:0px 0px 0px 10px; margin:2px; width:85%"> |
| 115 | <tr> |
| 116 | <td style="width:45%; padding: 10px;">miniOrange Account Email</td> |
| 117 | <td style="width:55%; padding: 10px;"><?php echo esc_attr( get_option( 'mo_firebase_authentication_admin_email' ) ); ?></td> |
| 118 | </tr> |
| 119 | <tr> |
| 120 | <td style="width:45%; padding: 10px;">Customer ID</td> |
| 121 | <td style="width:55%; padding: 10px;"><?php echo esc_attr( get_option( 'mo_firebase_authentication_admin_customer_key' ) ); ?></td> |
| 122 | </tr> |
| 123 | </table> |
| 124 | <br /><br /> |
| 125 | |
| 126 | <table> |
| 127 | <tr> |
| 128 | <td> |
| 129 | <form name="f1" method="post" action="" id="mo_firebase_authentication_goto_login_form"> |
| 130 | <input type="hidden" value="change_miniorange" name="option"/> |
| 131 | <?php wp_nonce_field( 'change_miniorange_form', 'change_miniorange_form_nonce' ); ?> |
| 132 | <input type="submit" value="Change Email Address" class="button button-primary button-large"/> |
| 133 | </form> |
| 134 | </td><td> |
| 135 | </td> |
| 136 | </tr> |
| 137 | </table> |
| 138 | <br> |
| 139 | </div> |
| 140 | |
| 141 | <?php |
| 142 | } |
| 143 |