Zoom_Webinar_Helpers::get_user_info()

Get the connected user from Zoom API.


Return Return

(string) The HTML of the user.


Source Source

File: src/integrations/zoom-webinar/helpers/zoom-webinar-helpers.php

	public function get_user_info() {

		ob_start();

		$zoom_user = $this->api_get_user_info();

		// Bail out if zoom user if empty.
		if ( false === $zoom_user ) {
			return;
		}
		?>

		<?php $this->get_inline_style(); ?>

		<p>
			<div class="uo-zoom-user-info">

				<div class="uo-zoom-user-info__avatar">
					<?php if ( ! isset( $zoom_user->pic_url ) ) : ?>
						<div class="uo-zoom-user-info-placeholder-avatar">
							<span class="dashicons dashicons-admin-users"></span>
						</div>
					<?php else : ?>
						<img width="32" src="<?php echo esc_url( $zoom_user->pic_url ); ?>" alt="<?php esc_attr_e( 'Profile Pic', 'uncanny-automator' ); ?>" />
					<?php endif; ?>
				</div>

				<div class="uo-zoom-user-info__email">
					<?php echo esc_html( $zoom_user->email ); ?>
				</div>

				<div class="uo-zoom-user-info__name">
					<?php echo esc_html( sprintf( '(%s %s)', ! empty( $zoom_user->first_name ) ? $zoom_user->first_name : '', $zoom_user->last_name ? $zoom_user->first_name : '' ) ); ?>
				</div>

			</div><!--.uo-zoom-user-info-->
		</p>
		<p>
			<?php
			$disconnect_uri = add_query_arg(
				array(
					'action' => 'uap_automator_zoom_webinar_api_disconnect',
					'nonce'  => wp_create_nonce( 'uap_automator_zoom_webinar_api_disconnect' ),
				),
				admin_url( 'admin-ajax.php' )
			);
			?>
			<a class="uo-settings-btn uo-settings-btn--error" href="<?php echo esc_url( $disconnect_uri ); ?>" title="<?php esc_attr_e( 'Disconnect', 'uncanny-automator' ); ?>">
				<?php esc_html_e( 'Disconnect', 'uncanny-automator' ); ?>
			</a>
			<br/>
		</p>
		<?php

		return ob_get_clean();
	}