Initial commit: MeetLet Adobe Connect Bridge Marketplace edition (Moodle plugin).

Single-plugin source tree for mod_meetletacbmarketplace — admin, licensing, and marketplace integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 22:07:11 +03:30
commit b04221433a
93 changed files with 20819 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Ajax endpoint: run one Adobe Connect connection-test step.
*
* @package mod_meetletacbmarketplace
* @copyright 2026 MeetLet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
require_once('../../../config.php');
use mod_meetletacbmarketplace\local\conntest_runner;
require_login();
require_capability('moodle/site:config', context_system::instance());
require_sesskey();
\mod_meetletacbmarketplace\registration\manager::require_registered();
$step = required_param('step', PARAM_ALPHA);
$result = conntest_runner::run_step($step);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($result);
+83
View File
@@ -0,0 +1,83 @@
<?php
// This file is part of Moodle - http://moodle.org/
/**
* Ajax endpoint: activate / recheck / deactivate MeetLet site registration.
*
* @package mod_meetletacbmarketplace
* @copyright 2026 MeetLet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
require_once('../../../config.php');
use mod_meetletacbmarketplace\registration\error_mapper;
use mod_meetletacbmarketplace\registration\manager;
use mod_meetletacbmarketplace\registration\registration_exception;
require_login();
require_capability('moodle/site:config', context_system::instance());
require_sesskey();
$action = required_param('action', PARAM_ALPHA);
$apiurl = optional_param('registration_api_url', '', PARAM_URL);
header('Content-Type: application/json; charset=utf-8');
try {
if ($apiurl !== '') {
set_config(manager::CONFIG_API_URL, rtrim($apiurl, '/'), 'meetletacbmarketplace');
}
if ($action === 'activate') {
manager::activate();
echo json_encode([
'success' => true,
'message' => get_string('registration_activated', 'meetletacbmarketplace'),
'summary' => manager::status_summary(),
]);
exit;
}
if ($action === 'recheck' || $action === 'refresh' || $action === 'validate') {
manager::recheck(true);
echo json_encode([
'success' => true,
'message' => get_string('registration_rechecked', 'meetletacbmarketplace'),
'summary' => manager::status_summary(),
]);
exit;
}
if ($action === 'deactivate') {
manager::deactivate();
echo json_encode([
'success' => true,
'message' => get_string('registration_deactivated', 'meetletacbmarketplace'),
'summary' => manager::status_summary(),
]);
exit;
}
if ($action === 'status') {
echo json_encode([
'success' => true,
'summary' => manager::status_summary(),
]);
exit;
}
throw new moodle_exception('invalidparameter');
} catch (Throwable $e) {
$ex = registration_exception::from_throwable($e);
$mapped = error_mapper::from_exception($ex);
echo json_encode([
'success' => false,
'error' => $mapped['message'] ?? $ex->get_api_message(),
'error_code' => $ex->get_error_code(),
'request_id' => $ex->get_request_id(),
'summary' => manager::status_summary(),
]);
}
+69
View File
@@ -0,0 +1,69 @@
<?php
// This file is part of Moodle - http://moodle.org/
/**
* Reset site access settings (role mapping or feature matrix) to built-in defaults.
*
* @package mod_meetletacbmarketplace
* @copyright 2026 MeetLet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
require_once('../../../config.php');
use mod_meetletacbmarketplace\local\featureaccess;
use mod_meetletacbmarketplace\local\roles;
require_login();
require_capability('moodle/site:config', context_system::instance());
require_sesskey();
\mod_meetletacbmarketplace\registration\manager::require_registered();
$section = required_param('section', PARAM_ALPHA);
header('Content-Type: application/json; charset=utf-8');
try {
if ($section === 'rolemapping') {
$rules = roles::builtin_site_defaults();
$json = json_encode($rules, JSON_UNESCAPED_UNICODE);
set_config('default_participants', $json, 'meetletacbmarketplace');
echo json_encode([
'success' => true,
'section' => 'rolemapping',
'matrix' => roles::matrix_from_rules($rules),
'message' => get_string('reset_success_rolemapping', 'meetletacbmarketplace'),
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
if ($section === 'featureaccess') {
$matrix = featureaccess::builtin_defaults();
$json = json_encode($matrix, JSON_UNESCAPED_UNICODE);
set_config('featureaccess', $json, 'meetletacbmarketplace');
echo json_encode([
'success' => true,
'section' => 'featureaccess',
'matrix' => $matrix,
'message' => get_string('reset_success_featureaccess', 'meetletacbmarketplace'),
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
throw new moodle_exception('invalidparameter');
} catch (Throwable $e) {
$error = $e->getMessage();
if ($e instanceof moodle_exception) {
$info = get_exception_info($e);
if (!empty($info->message)) {
$error = (string)$info->message;
}
}
echo json_encode([
'success' => false,
'error' => $error !== '' ? $error : get_string('reset_error', 'meetletacbmarketplace'),
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}