connect.php
12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
$depreciationLink = '<a href="' . esc_url( 'https://marketplace.zoom.us/docs/guides/build/jwt-app/jwt-faq/#jwt-app-type-deprecation-faq--omit-in-toc-' ) . '"
target="_blank" rel="noreferrer noopener">' . __( 'JWT App Type Depreciation FAQ', 'video-conferencing-with-zoom-api' ) . '</a>';
$migration_wizard_url = esc_url( add_query_arg(
[
'post_type' => 'zoom-meetings',
'page' => 'zoom-video-conferencing-settings',
'migrate' => 'now',
],
admin_url( 'edit.php' )
) );
$migration_wizard_link = '<a href="' . $migration_wizard_url . '">migration wizard</a>';
$is_jwt_active = vczapi_is_jwt_active();
?>
<div id="zvc-cover" style="display: none;"></div>
<div class="zvc-row">
<div class="zvc-position-floater-left" style="width: 70%;margin-right:10px;border-top:1px solid #ccc;">
<form action="" method="post">
<?php
wp_nonce_field( 'verify_vczapi_zoom_connect', 'vczapi_zoom_connect_nonce' );
?>
<?php if ( apply_filters( 'vczapi_show_jwt_keys', ( $is_jwt_active ) ) ): ?>
<!-- Legacy JWT Implementation -->
<div id="vczapi-s2sOauth-jwt-credentials" class="vczapi-admin-accordion expanded">
<div class="vczapi-admin-accordion--header">
<div class="vczapi-admin-accordion--header-title">
<h3><?php _e( 'JWT Credentials ( Legacy )', 'video-conferencing-with-zoom-api' ); ?></h3>
</div>
<div class="vczapi-admin-accordion--header-trigger">
<a href="#"><span class="dashicons dashicons-arrow-up-alt2"></span></a>
</div>
</div>
<div class="vczapi-admin-accordion--content" class="show">
<?php
printf( __( 'Zoom is deprecating their JWT app from June of 2023, please see %s for more details, Until the deadline all your current settings will work, however to ensure a smooth transition to the new Server to Server OAuth system + New App SDK (required for Join Via Browser) - we recommend that you migrate as soon as possible. Run the %s now to complete the migration process in 2 easy steps ', 'video-conferencing-with-zoom-api' ), $depreciationLink, $migration_wizard_link );
?>
<table class="form-table">
<tbody>
<tr>
<th><label><?php _e( 'JWT API Key', 'video-conferencing-with-zogit coom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;" name="zoom_api_key" id="zoom_api_key" value="<?php echo ! empty( $zoom_api_key ) ? esc_html( $zoom_api_key ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#zoom_api_key">Show</a></td>
</tr>
<tr>
<th><label><?php _e( 'JWT API Secret Key', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;" name="zoom_api_secret" id="zoom_api_secret" value="<?php echo ! empty( $zoom_api_secret ) ? esc_html( $zoom_api_secret ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#zoom_api_secret">Show</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- End Legacy JWT Implementation -->
<?php endif; ?>
<!-- OAuth Credentials -->
<div id="vczapi-s2sOauth-credentials" class="vczapi-admin-accordion expanded">
<div class="vczapi-admin-accordion--header">
<div class="vczapi-admin-accordion--header-title">
<h3><?php _e( 'Server to Server Oauth Credentials', 'video-conferencing-with-zoom-api' ); ?></h3>
</div>
<div class="vczapi-admin-accordion--header-trigger">
<a href="#"><span class="dashicons dashicons-arrow-up-alt2"></span></a>
</div>
</div>
<div class="vczapi-admin-accordion--content" class="show">
<p class="description">
<?php
$oauth_documentation_link = '<a href="https://zoomdocs.codemanas.com/setup/#generating-api-credentials" target="_blank" rel="noreferrer noopener">setup guide</a>';
$sdk_app_link = '<a href="#vczapi-s2sOauth-app-sdk-credentials" class="vczapi-go-to-open-accordion" onclick="javascript:void(0);">SDK App Credentials</a>';
printf( __( 'Please see %s on how to generate credentials, additionally for Join via Browser to work please also add %s', 'video-conferencing-with-zoom-api' ), $oauth_documentation_link, $sdk_app_link );
?>
</p>
<table class="form-table">
<tbody>
<?php if ( isset( $oauth_error_message ) && ! empty( $oauth_error_message ) ) : ?>
<tr>
<th colspan="2">
<?php echo $oauth_error_message; ?>
</th>
</tr>
<?php endif; ?>
<tr>
<th><label for="vczapi_oauth_account_id"><?php _e( 'Oauth Account ID', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;"
name="vczapi_oauth_account_id"
id="vczapi_oauth_account_id" value="<?php echo ! empty( $vczapi_oauth_account_id ) ? esc_html( $vczapi_oauth_account_id ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#vczapi_oauth_account_id">Show</a></td>
</tr>
<tr>
<th><label for="vczapi_oauth_client_id"><?php _e( 'Oauth Client ID', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;"
name="vczapi_oauth_client_id"
id="vczapi_oauth_client_id" value="<?php echo ! empty( $vczapi_oauth_client_id ) ? esc_html( $vczapi_oauth_client_id ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#vczapi_oauth_client_id">Show</a></td>
</tr>
<tr>
<th><label for="vczapi_oauth_client_secret"><?php _e( 'Oauth Client Secret', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;"
name="vczapi_oauth_client_secret"
id="vczapi_oauth_client_secret"
value="<?php echo ! empty( $vczapi_oauth_client_secret ) ? esc_html( $vczapi_oauth_client_secret ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#vczapi_oauth_client_secret">Show</a></td>
</tr>
<?php if ( $is_jwt_active ): ?>
<tr>
<th><?php _e( 'Delete JWT Keys', 'video-conferencing-with-zoom-api' ); ?></th>
<td><input type="checkbox" id="vczapi-delete-jwt-keys" name="vczapi-delete-jwt-keys"/>
<span class="description"><?php _e( 'Check this box to delete JWT (legacy keys) after saving and verifying Server-to-Server Oauth Keys', 'video-conferencing-with-zoom-api' ); ?></span>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<!-- End Oauth Credentials -->
<!-- App SDK Credentials -->
<div id="vczapi-s2sOauth-app-sdk-credentials" class="vczapi-admin-accordion expanded">
<div class="vczapi-admin-accordion--header">
<div class="vczapi-admin-accordion--header-title">
<h3><?php _e( 'Meeting SDK App Credentials', 'video-conferencing-with-zoom-api' ); ?></h3>
</div>
<div class="vczapi-admin-accordion--header-trigger">
<a href="#"><span class="dashicons dashicons-arrow-up-alt2"></span></a>
</div>
</div>
<div class="vczapi-admin-accordion--content">
<?php
$appSDK_documentation_link = '<a href="https://zoomdocs.codemanas.com/setup/#setup-app-sdk-credentials" target="_blank" rel="noreferrer noopener">see the documentation</a>';
echo '<p class="description">' . sprintf( __( 'SDK App Credentials are required for Join Via Browser to work, %s on how to generate you App SDK keys', 'video-conferencing-with-zoom-api' ), $appSDK_documentation_link ) . '</p>'; ?>
<table class="form-table">
<tbody>
<tr>
<th><label for="vczapi_sdk_key"><?php _e( 'SDK key / Client ID', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;"
name="vczapi_sdk_key"
id="vczapi_sdk_key"
value="<?php echo ! empty( $vczapi_sdk_key ) ? esc_html( $vczapi_sdk_key ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#vczapi_sdk_key">Show</a></td>
</tr>
<tr>
<th><label for="vczapi_sdk_secret_key"><?php _e( 'SDK / Client Secret', 'video-conferencing-with-zoom-api' ); ?></label></th>
<td>
<input type="password" style="width: 400px;"
name="vczapi_sdk_secret_key"
id="vczapi_sdk_secret_key"
value="<?php echo ! empty( $vczapi_sdk_secret_key ) ? esc_html( $vczapi_sdk_secret_key ) : ''; ?>">
<a href="javascript:void(0);" class="vczapi-toggle-trigger" data-visible="0" data-element="#vczapi_sdk_secret_key">Show</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- End App SDK Credentials -->
<!-- Save Actions -->
<div class="vczapi-save-actions">
<table class="form-table">
<tfoot>
<tr>
<th>
<input type="submit" value="Save" class="button button-primary">
</th>
</tr>
</tfoot>
</table>
</div>
<!-- End Save Actions -->
</form>
</div>
<div class="zvc-position-floater-right">
<?php require_once ZVC_PLUGIN_VIEWS_PATH . '/additional-info.php'; ?>
</div>
</div>
<?php
include_once ZVC_PLUGIN_VIEWS_PATH . '/migration.php';