Rename marketplace plugin to meetletacbfree (mdl_modules.name limit + CI table prefixes)

This commit is contained in:
2026-09-01 23:24:11 +03:30
parent 555cd725f7
commit d987994ded
77 changed files with 1497 additions and 1322 deletions
+12 -12
View File
@@ -17,14 +17,14 @@
/**
* Meeting content download helpers (Adobe Connect proxy).
*
* @package mod_meetletacbmarketplace
* @package mod_meetletacbfree
* @copyright 2026 MeetLet <info@meetlet.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_meetletacbmarketplace\local;
namespace mod_meetletacbfree\local;
use mod_meetletacbmarketplace\api\service;
use mod_meetletacbfree\api\service;
use stdClass;
defined('MOODLE_INTERNAL') || die();
@@ -37,7 +37,7 @@ class content {
* Opaque, HMAC-signed, current-user download URL.
*/
public static function download_url(int $userid, int $cmid, int $scoid): \moodle_url {
return new \moodle_url('/mod/meetletacbmarketplace/download_content.php', [
return new \moodle_url('/mod/meetletacbfree/download_content.php', [
'k' => self::make_download_token($userid, $cmid, $scoid),
]);
}
@@ -50,7 +50,7 @@ class content {
public static function unpack_download_token(string $token): array {
$token = trim($token);
if (!preg_match('/^[A-Za-z0-9_-]+$/', $token)) {
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbmarketplace');
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbfree');
}
$b64 = strtr($token, '-_', '+/');
$pad = strlen($b64) % 4;
@@ -59,12 +59,12 @@ class content {
}
$raw = base64_decode($b64, true);
if ($raw === false || strlen($raw) < 44) {
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbmarketplace');
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbfree');
}
$mac = substr($raw, 0, 32);
$payload = substr($raw, 32);
if (strlen($payload) < 32) {
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbmarketplace');
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbfree');
}
$ids = unpack('Nuid/Ncmid/Ncid/Nexp', substr($payload, 0, 16));
@@ -75,15 +75,15 @@ class content {
$expires = (int)$ids['exp'];
$expected = hash_hmac(
'sha256',
'meetletacbmarketplace-content-v1|' . $userid . ':' . $cmid . ':' . $cid . ':' . $expires . '|' . $nonce,
'meetletacbfree-content-v1|' . $userid . ':' . $cmid . ':' . $cid . ':' . $expires . '|' . $nonce,
self::download_secret(),
true
);
if (!hash_equals($expected, $mac)) {
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbmarketplace');
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbfree');
}
if ($expires < time() || $userid <= 0 || $cmid <= 0 || $cid <= 0) {
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbmarketplace');
throw new \moodle_exception('errorbadcontenttoken', 'meetletacbfree');
}
return ['userid' => $userid, 'cmid' => $cmid, 'cid' => $cid];
}
@@ -183,7 +183,7 @@ class content {
$payload = pack('N4', $userid, $cmid, $scoid, $expires) . $nonce;
$mac = hash_hmac(
'sha256',
'meetletacbmarketplace-content-v1|' . $userid . ':' . $cmid . ':' . $scoid . ':' . $expires . '|' . $nonce,
'meetletacbfree-content-v1|' . $userid . ':' . $cmid . ':' . $scoid . ':' . $expires . '|' . $nonce,
self::download_secret(),
true
);
@@ -191,6 +191,6 @@ class content {
}
protected static function download_secret(): string {
return 'mod_meetletacbmarketplace/content/' . get_site_identifier();
return 'mod_meetletacbfree/content/' . get_site_identifier();
}
}