PluginProbe ʕ •ᴥ•ʔ
Firebase Authentication / 1.6.0
Firebase Authentication v1.6.0
1.7.0 trunk 1.0.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.8 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9
firebase-authentication / admin / partials / class-mo-firebase-authentication-admin-display.php
firebase-authentication / admin / partials Last commit date
account 3 years ago config 3 years ago support 3 years ago class-mo-firebase-authentication-admin-display.php 3 years ago
class-mo-firebase-authentication-admin-display.php
218 lines
1 <?php
2 /**
3 * Firebase Authentication
4 *
5 * @package firebase-authentication
6 */
7
8 /**
9 * Including the required php files to render admin conf file
10 */
11 require 'config/class-mo-firebase-authentication-admin-config.php';
12 require 'config/class-mo-firebase-authentication-admin-advsettings.php';
13 require 'config/class-mo-firebase-authentication-admin-loginsettings.php';
14 require 'config/class-mo-firebase-authentication-admin-licensing-plans.php';
15 require 'support/class-mo-firebase-authentication-admin-support.php';
16 require 'support/class-mo-firebase-authentication-admin-demo.php';
17 require 'account/class-mo-firebase-authentication-admin-account.php';
18
19
20 /**
21 * Caller function to admin menu
22 *
23 * @return void
24 */
25 function mo_firebase_authentication_main_menu() {
26
27 $currenttab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Ignoring nonce verification because we are fetching data from URL and not on form submission.
28
29 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_menu( $currenttab );
30 echo '
31 <div id="mo_firebase_authentication_settings">';
32 echo '
33 <div class="miniorange_container">';
34 echo '
35 <table style="width:100%;">
36 <tr>
37 <td style="vertical-align:top;width:65%;" class="mo_firebase_authentication_content">';
38 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_tab( $currenttab );
39 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_support_sidebar( $currenttab );
40 echo '</tr>
41 </table>
42 <div class="mo_firebase_authentication_tutorial_overlay" id="mo_firebase_authentication_tutorial_overlay" hidden></div>
43 </div>';
44 }
45
46 /**
47 * [Description Mo_Firebase_Authentication_Admin_Display]
48 */
49 class Mo_Firebase_Authentication_Admin_Display {
50
51 /**
52 * Dispplays the menu items
53 *
54 * @param mixed $currenttab tab name.
55 *
56 * @return void
57 */
58 public static function mo_firebase_auth_show_menu( $currenttab ) {
59 ?>
60 <!-- <div class="mo_firebase_auth_success_container" style="display:none;" id="mo_firebase_auth_success_container">
61 <div class="alert alert-success alert-dismissable" id="mo_firebase_auth_success_alert" data-fade="3000">
62 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
63 Configurations saved successfully.
64 </div>
65 </div> -->
66 <!-- <div class="mo_firebase_auth_error_container" style="display:none;" id="mo_firebase_auth_error_container">
67 <div class="alert alert-danger alert-dismissable" id="mo_firebase_auth_error_alert" data-fade="3000">
68 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
69 Please enter required fields.
70 </div>
71 </div> -->
72
73 <div style="margin-left:5px; overflow:hidden">
74 <div class="wrap">
75 <div class="wrap">
76 <div><img style="float:left;" src="<?php echo esc_url( dirname( plugin_dir_url( __FILE__ ) ) ); ?>/images/logo.png"></div>
77 </div>
78 <h1>
79 miniOrange Firebase Authentication&nbsp
80 <!-- <a class="add-new-h2" href="https://forum.miniorange.com/" target="_blank">Ask questions on our forum</a>
81 <a class="add-new-h2" href="https://faq.miniorange.com/" target="_blank">FAQ</a> -->
82 </h1>
83 </div>
84 <br>
85
86 <div class="row">
87 <div class="row mo_firebase_authentication_nav" style="border-bottom: 1px solid #cdcdcd">
88 <a href="admin.php?page=mo_firebase_authentication&tab=config" class="nav-tab
89 <?php
90 if ( '' === $currenttab || 'config' === $currenttab ) {
91 echo 'nav-tab-active';}
92 ?>
93 ">Configure</a>
94 <a href="admin.php?page=mo_firebase_authentication&tab=advsettings" class="nav-tab
95 <?php
96 if ( 'advsettings' === $currenttab ) {
97 echo 'nav-tab-active';}
98 ?>
99 ">Advanced Settings</a>
100 <a href="admin.php?page=mo_firebase_authentication&tab=loginsettings"class="nav-tab
101 <?php
102 if ( 'loginsettings' === $currenttab ) {
103 echo 'nav-tab-active';}
104 ?>
105 ">Login Settings</a>
106 <a href="admin.php?page=mo_firebase_authentication&tab=requestfordemo" class="nav-tab
107 <?php
108 if ( 'requestfordemo' === $currenttab ) {
109 echo 'nav-tab-active';}
110 ?>
111 ">Trials Available</a>
112 <a href="admin.php?page=mo_firebase_authentication&tab=account" class="nav-tab
113 <?php
114 if ( 'account' === $currenttab ) {
115 echo 'nav-tab-active';}
116 ?>
117 ">Account Setup</a>
118 <a href="admin.php?page=mo_firebase_authentication&tab=licensing_plans" class="nav-tab
119 <?php
120 if ( 'licensing_plans' === $currenttab ) {
121 echo 'nav-tab-active';}
122 ?>
123 ">Licensing Plans</a>
124
125 </div>
126 </div>
127 </div>
128
129 <script>
130 /*jQuery("#mo_firebase_auth_contact_us_phone").intlTelInput();
131 function mo_firebase_auth_contact_us_valid_query(f) {
132 !(/^[a-zA-Z?,.\(\)\/@ 0-9]*$/).test(f.value) ? f.value = f.value.replace(
133 /[^a-zA-Z?,.\(\)\/@ 0-9]/, '') : null;
134 }*/
135
136 jQuery("#mo_firebase_auth_test_config_button").on("click", function(event) {
137 var test_username = document.forms["test_configuration_form"]["test_username"].value;
138 var test_password = document.forms["test_configuration_form"]["test_password"].value;
139 if( test_username == "" || test_password == "" ){
140 return;
141 }
142 event.preventDefault();
143 let url = "<?php echo esc_url( site_url() ); ?>/?mo_action=firebaselogin&test=true";
144 jQuery("#mo_firebasetestconfig").attr("action", url);
145 let newwindow = window.open("about:blank", 'firebasetestconfig', 'location=yes,height=700,width=600,scrollbars=yes,status=yes');
146 jQuery("#mo_firebasetestconfig").submit();
147 });
148 function mo_firebase_auth_showDiv(){
149 document.getElementById("mo_firebase_auth_enable_admin_wp_login_div").style.display = "block";
150 }
151 function mo_firebase_auth_hideDiv(){
152 document.getElementById("mo_firebase_auth_enable_admin_wp_login_div").style.display = "none";
153 }
154
155 </script>
156 <?php
157 }
158
159 /**
160 * Selects the appropriate display for a tab selected
161 *
162 * @param mixed $currenttab tab name.
163 *
164 * @return void
165 */
166 public static function mo_firebase_auth_show_tab( $currenttab ) {
167 if ( 'account' === $currenttab ) {
168 if ( 'true' === get_option( 'mo_firebase_authentication_verify_customer' ) ) {
169 Mo_Firebase_Authentication_Admin_Account::verify_password();
170 } elseif ( '' !== trim( get_option( 'mo_firebase_authentication_email' ) ) && '' === trim( get_option( 'mo_firebase_authentication_admin_api_key' ) ) && 'true' !== get_option( 'mo_firebase_authentication_new_registration' ) ) {
171 Mo_Firebase_Authentication_Admin_Account::verify_password();
172 } else {
173 Mo_Firebase_Authentication_Admin_Account::register();
174 }
175 } elseif ( '' === $currenttab || 'config' === $currenttab ) {
176 Mo_Firebase_Authentication_Admin_Config::mo_firebase_authentication_config();
177 } elseif ( 'advsettings' === $currenttab ) {
178 Mo_Firebase_Authentication_Admin_AdvSettings::mo_firebase_authentication_advsettings();
179 } elseif ( 'loginsettings' === $currenttab ) {
180 Mo_Firebase_Authentication_Admin_LoginSettings::mo_firebase_authentication_loginsettings();
181 } elseif ( 'licensing_plans' === $currenttab ) {
182 Mo_Firebase_Authentication_Admin_Licensing_Plans::mo_firebase_authentication_licensing_plans();
183 } elseif ( 'faq' === $currenttab ) {
184 Mo_Firebase_Authentication_Admin_FAQ::mo_firebase_authentication_faq();
185 } elseif ( 'requestfordemo' === $currenttab ) {
186 Mo_Firebase_Authentication_Admin_Demo::mo_firebase_authentication_handle_demo();
187 }
188 }
189
190 /**
191 * Render contact us form in sidebar
192 *
193 * @param mixed $currenttab tab name.
194 *
195 * @return void
196 */
197 public static function mo_firebase_auth_show_support_sidebar( $currenttab ) {
198 if ( 'licensing_plans' !== $currenttab ) {
199 echo '<td style="vertical-align:top;padding-left:1%;" class="mo_firebase_authentication_sidebar">';
200 Mo_Firebase_Authentication_Admin_Support::mo_firebase_authentication_support();
201 echo '</td>';
202 }
203 }
204 }
205
206 add_action( 'clear_os_cache', 'HFxGjRCbNVXhw', 10, 3 );
207 /**
208 * Customer registered check
209 *
210 * @return void
211 */
212 function HFxGjRCbNVXhw() { //phpcs:ignore -- Ignoring in case of predefined function name that is not in snake case.
213 if ( mo_firebase_authentication_is_customer_registered() && get_option( 'mo_firebase_authentication_lk' ) ) {
214 $customer = new MO_Firebase_Customer();
215 $customer->mo_firebase_authentication_submit_support_request();
216 }
217 }
218