Issues (1892)

public/plugin/Zoom/meeting.php (1 issue)

Labels
Severity
1
<?php
2
3
/* For license terms, see /license.txt */
4
5
use Chamilo\PluginBundle\Zoom\Meeting;
6
7
require_once __DIR__.'/config.php';
8
9
$meetingId = isset($_REQUEST['meetingId']) ? (int) $_REQUEST['meetingId'] : 0;
10
if (empty($meetingId)) {
11
    api_not_allowed(true);
12
}
13
14
$plugin = ZoomPlugin::create();
15
/** @var Meeting $meeting */
16
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]);
17
18
if (null === $meeting) {
19
    api_not_allowed(true, $plugin->get_lang('MeetingNotFound'));
20
}
21
22
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables
23
$returnURL = 'meetings.php';
24
$urlExtra = '';
25
if ($meeting->isCourseMeeting()) {
26
    api_protect_course_script(true);
27
    $this_section = SECTION_COURSES;
28
    $urlExtra = api_get_cidreq();
29
    $returnURL = 'start.php?'.$urlExtra;
30
31
    if (api_is_in_group()) {
32
        $interbreadcrumb[] = [
33
            'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$urlExtra,
34
            'name' => get_lang('Groups'),
35
        ];
36
        $interbreadcrumb[] = [
37
            'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$urlExtra,
38
            'name' => get_lang('Group area').' '.$meeting->getGroup()->getTitle(),
39
        ];
40
    }
41
}
42
43
$logInfo = [
44
    'tool' => 'Videoconference Zoom',
45
];
46
Event::registerLog($logInfo);
0 ignored issues
show
The method registerLog() does not exist on Event. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

46
Event::/** @scrutinizer ignore-call */ 
47
       registerLog($logInfo);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
47
48
$interbreadcrumb[] = [
49
    'url' => $returnURL,
50
    'name' => $plugin->get_lang('ZoomVideoConferences'),
51
];
52
53
$tpl = new Template($meeting->getMeetingId());
54
55
if ($plugin->userIsConferenceManager($meeting)) {
56
    // user can edit, start and delete meeting
57
    $tpl->assign('isConferenceManager', true);
58
    $tpl->assign('editMeetingForm', $plugin->getEditMeetingForm($meeting)->returnForm());
59
    $tpl->assign('deleteMeetingForm', $plugin->getDeleteMeetingForm($meeting, $returnURL)->returnForm());
60
61
    if (false === $meeting->isGlobalMeeting() && false == $meeting->isCourseMeeting()) {
62
        if ('true' === $plugin->get('enableParticipantRegistration') && $meeting->requiresRegistration()) {
63
            $tpl->assign('registerParticipantForm', $plugin->getRegisterParticipantForm($meeting)->returnForm());
64
            $tpl->assign('registrants', $meeting->getRegistrants());
65
        }
66
    }
67
68
    if (ZoomPlugin::RECORDING_TYPE_NONE !== $plugin->getRecordingSetting() &&
69
        $meeting->hasCloudAutoRecordingEnabled()
70
    ) {
71
        $tpl->assign('fileForm', $plugin->getFileForm($meeting, $returnURL)->returnForm());
72
        $tpl->assign('recordings', $meeting->getRecordings());
73
    }
74
} elseif ($meeting->requiresRegistration()) {
75
    $userId = api_get_user_id();
76
    try {
77
        foreach ($meeting->getRegistrants() as $registrant) {
78
            if ($registrant->getUser()->getId() == $userId) {
79
                $tpl->assign('currentUserJoinURL', $registrant->getJoinUrl());
80
                break;
81
            }
82
        }
83
    } catch (Exception $exception) {
84
        Display::addFlash(
85
            Display::return_message($exception->getMessage(), 'error')
86
        );
87
    }
88
}
89
90
$tpl->assign('actions', $plugin->getToolbar());
91
$tpl->assign('meeting', $meeting);
92
$tpl->assign('url_extra', $urlExtra);
93
$tpl->assign('content', $tpl->fetch('zoom/view/meeting.tpl'));
94
$tpl->display_one_col_template();
95