From 1789e24b2a66d62986867e5abd978884eb44d8d9 Mon Sep 17 00:00:00 2001 From: "Jibon L. Costa" Date: Sat, 28 Sep 2024 12:23:33 +0200 Subject: [PATCH] bump sdk + option for auto_gen_user_id + copyright_conf --- .../external/mod_plugnmeet_create_room.php | 9 +- helpers/helper.php | 9 + helpers/libs/plugnmeet-sdk-php/composer.json | 2 +- helpers/libs/plugnmeet-sdk-php/composer.lock | 170 +++++++++--------- .../src/Parameters/RoomFeaturesParameters.php | 24 ++- .../src/Parameters/UserMetadataParameters.php | 49 +++++ .../libs/plugnmeet-sdk-php/src/PlugNmeet.php | 4 +- .../src/Responses/CreateRoomResponse.php | 66 +------ .../src/Utils/ActiveRoomInfo.php | 8 +- .../plugnmeet-sdk-php/vendor/autoload.php | 2 +- .../vendor/composer/autoload_real.php | 10 +- .../vendor/composer/autoload_static.php | 8 +- .../vendor/composer/installed.json | 32 ++-- .../vendor/composer/installed.php | 20 +-- .../symfony/polyfill-ctype/composer.json | 2 +- .../Resources/stubs/CURLStringFile.php | 2 +- .../symfony/polyfill-php81/composer.json | 2 +- helpers/plugNmeetConnect.php | 18 +- lang/en/plugnmeet.php | 5 + settings.php | 17 ++ version.php | 4 +- 21 files changed, 261 insertions(+), 202 deletions(-) diff --git a/classes/external/mod_plugnmeet_create_room.php b/classes/external/mod_plugnmeet_create_room.php index 472e369..f5efe08 100644 --- a/classes/external/mod_plugnmeet_create_room.php +++ b/classes/external/mod_plugnmeet_create_room.php @@ -75,9 +75,16 @@ public static function create_room($instanceid, $join, $isadmin) { } $instance = $DB->get_record('plugnmeet', array('id' => $instanceid), '*', MUST_EXIST); - $config = get_config('mod_plugnmeet'); $roommetadata = json_decode($instance->roommetadata, true); + $config = get_config('mod_plugnmeet'); + if (isset($config->copyright_display)) { + $roommetadata["copyright_conf"] = array( + "display" => $config->copyright_display == 1, + "text" => $config->copyright_text, + ); + } + if (!$isadmin && isset( $roommetadata["room_features"]["moderator_join_first"] ) && $roommetadata["room_features"]["moderator_join_first"] == 1 ) { diff --git a/helpers/helper.php b/helpers/helper.php index 6590915..760d0a0 100644 --- a/helpers/helper.php +++ b/helpers/helper.php @@ -202,6 +202,15 @@ public static function get_room_features($roommetadata, $mform) { "selected" => 1, "type" => "select" ), + "auto_gen_user_id" => array( + "label" => get_string("auto_gen_user_id", "mod_plugnmeet"), + "options" => array( + 0 => get_string("no", "mod_plugnmeet"), + 1 => get_string("yes", "mod_plugnmeet") + ), + "selected" => 0, + "type" => "select" + ), ); $data = []; diff --git a/helpers/libs/plugnmeet-sdk-php/composer.json b/helpers/libs/plugnmeet-sdk-php/composer.json index 1dd2141..3176aeb 100644 --- a/helpers/libs/plugnmeet-sdk-php/composer.json +++ b/helpers/libs/plugnmeet-sdk-php/composer.json @@ -3,7 +3,7 @@ "description": "plugNmeet PHP SDK", "type": "library", "license": "MIT", - "version": "1.5.1", + "version": "1.5.2", "autoload": { "psr-4": { "Mynaparrot\\Plugnmeet\\": "src/" diff --git a/helpers/libs/plugnmeet-sdk-php/composer.lock b/helpers/libs/plugnmeet-sdk-php/composer.lock index beaeeb6..390c22b 100644 --- a/helpers/libs/plugnmeet-sdk-php/composer.lock +++ b/helpers/libs/plugnmeet-sdk-php/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5f22457c876a78ed36e29de1118473f4", + "content-hash": "9e36abd86d7c955c6894829e14dc8229", "packages": [ { "name": "brick/math", @@ -318,20 +318,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -377,7 +377,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -393,24 +393,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -453,7 +453,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -469,7 +469,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" } ], "packages-dev": [ @@ -645,16 +645,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.1", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", "shasum": "" }, "require": { @@ -721,20 +721,20 @@ "type": "open_collective" } ], - "time": "2024-05-22T21:24:41+00:00" + "time": "2024-09-18T10:38:58+00:00" }, { "name": "symfony/console", - "version": "v5.4.40", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" + "reference": "5b5a0aa66e3296e303e22490f90f521551835a83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", + "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83", + "reference": "5b5a0aa66e3296e303e22490f90f521551835a83", "shasum": "" }, "require": { @@ -804,7 +804,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.40" + "source": "https://github.com/symfony/console/tree/v5.4.44" }, "funding": [ { @@ -820,7 +820,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-20T07:56:40+00:00" }, { "name": "symfony/deprecation-contracts", @@ -891,16 +891,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.40", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "reference": "ae25a9145a900764158d439653d5630191155ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", "shasum": "" }, "require": { @@ -934,7 +934,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/finder/tree/v5.4.43" }, "funding": [ { @@ -950,7 +950,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-08-13T14:03:51+00:00" }, { "name": "symfony/options-resolver", @@ -1023,20 +1023,20 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -1081,7 +1081,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -1097,24 +1097,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -1162,7 +1162,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1178,24 +1178,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -1242,7 +1242,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1258,24 +1258,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -1318,7 +1318,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -1334,24 +1334,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -1398,7 +1398,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -1414,20 +1414,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.40", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "url": "https://api.github.com/repos/symfony/process/zipball/1b9fa82b5c62cd49da8c9e3952dd8531ada65096", + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096", "shasum": "" }, "require": { @@ -1460,7 +1460,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.40" + "source": "https://github.com/symfony/process/tree/v5.4.44" }, "funding": [ { @@ -1476,7 +1476,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-17T12:46:43+00:00" }, { "name": "symfony/service-contracts", @@ -1563,16 +1563,16 @@ }, { "name": "symfony/string", - "version": "v6.4.8", + "version": "v6.4.12", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d" + "reference": "f8a1ccebd0997e16112dfecfd74220b78e5b284b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a147c0f826c4a1f3afb763ab8e009e37c877a44d", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d", + "url": "https://api.github.com/repos/symfony/string/zipball/f8a1ccebd0997e16112dfecfd74220b78e5b284b", + "reference": "f8a1ccebd0997e16112dfecfd74220b78e5b284b", "shasum": "" }, "require": { @@ -1629,7 +1629,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.8" + "source": "https://github.com/symfony/string/tree/v6.4.12" }, "funding": [ { @@ -1645,20 +1645,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-09-20T08:15:52+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.40", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83" + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/81cad0ceab3d61fe14fe941ff18a230ac9c80f83", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7025b964f123bbf1896d7563db6ec7f1f63e918a", + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a", "shasum": "" }, "require": { @@ -1704,7 +1704,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.40" + "source": "https://github.com/symfony/yaml/tree/v5.4.44" }, "funding": [ { @@ -1720,7 +1720,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-16T14:36:56+00:00" } ], "aliases": [], diff --git a/helpers/libs/plugnmeet-sdk-php/src/Parameters/RoomFeaturesParameters.php b/helpers/libs/plugnmeet-sdk-php/src/Parameters/RoomFeaturesParameters.php index 8c583b9..cc0633a 100644 --- a/helpers/libs/plugnmeet-sdk-php/src/Parameters/RoomFeaturesParameters.php +++ b/helpers/libs/plugnmeet-sdk-php/src/Parameters/RoomFeaturesParameters.php @@ -77,6 +77,10 @@ class RoomFeaturesParameters * @var bool */ protected $allowRaiseHand = true; + /** + * @var bool + */ + protected $autoGenUserId = false; /** * @var RecordingFeaturesParameters */ @@ -331,6 +335,23 @@ public function setAllowRaiseHand(bool $allowRaiseHand): void $this->allowRaiseHand = filter_var($allowRaiseHand, FILTER_VALIDATE_BOOLEAN); } + /** + * @return bool + */ + public function isAutoGenUserId(): bool + { + return $this->autoGenUserId; + } + + /** + * @param bool $autoGenUserId + * @return void + */ + public function setAutoGenUserId(bool $autoGenUserId): void + { + $this->autoGenUserId = filter_var($autoGenUserId, FILTER_VALIDATE_BOOLEAN); + } + /** * @return RecordingFeaturesParameters */ @@ -528,7 +549,8 @@ public function buildBody(): array "room_duration" => $this->getRoomDuration(), "enable_analytics" => $this->isEnableAnalytics(), "allow_virtual_bg" => $this->isAllowVirtualBg(), - "allow_raise_hand" => $this->isAllowRaiseHand() + "allow_raise_hand" => $this->isAllowRaiseHand(), + "auto_gen_user_id" => $this->isAutoGenUserId(), ); if ($this->recordingFeatures !== null) { diff --git a/helpers/libs/plugnmeet-sdk-php/src/Parameters/UserMetadataParameters.php b/helpers/libs/plugnmeet-sdk-php/src/Parameters/UserMetadataParameters.php index 297bbe2..04df434 100644 --- a/helpers/libs/plugnmeet-sdk-php/src/Parameters/UserMetadataParameters.php +++ b/helpers/libs/plugnmeet-sdk-php/src/Parameters/UserMetadataParameters.php @@ -45,6 +45,14 @@ class UserMetadataParameters * @var LockSettingsParameters */ protected $lockSettings; + /** + * @var string + */ + protected $extraData; + /** + * @var string + */ + protected $exUserId; /** * @@ -124,6 +132,39 @@ public function setLockSettings(LockSettingsParameters $lockSettings) $this->lockSettings = $lockSettings; } + /** + * @return string + */ + public function getExtraData(): string + { + return $this->extraData; + } + + /** + * @param string $extraData + */ + public function setExtraData(string $extraData): void + { + $this->extraData = $extraData; + } + + /** + * @return string + */ + public function getExUserId(): string + { + return $this->exUserId; + } + + /** + * @param string $exUserId + * @return void + */ + public function setExUserId(string $exUserId): void + { + $this->exUserId = $exUserId; + } + /** * @return array */ @@ -145,6 +186,14 @@ public function buildBody(): array $body["lock_settings"] = $this->getLockSettings()->buildBody(); } + if (!empty($this->extraData)) { + $body["extra_data"] = $this->getExtraData(); + } + + if (!empty($this->exUserId)) { + $body["ex_user_id"] = $this->getExUserId(); + } + return $body; } } diff --git a/helpers/libs/plugnmeet-sdk-php/src/PlugNmeet.php b/helpers/libs/plugnmeet-sdk-php/src/PlugNmeet.php index 6401ae7..9e26f77 100644 --- a/helpers/libs/plugnmeet-sdk-php/src/PlugNmeet.php +++ b/helpers/libs/plugnmeet-sdk-php/src/PlugNmeet.php @@ -90,9 +90,9 @@ class PlugNmeet * @param $apiKey plugNmeet API_Key * @param $apiSecret plugNmeet API_Secret */ - public function __construct($serverUrl, $apiKey, $apiSecret) + public function __construct(string $serverUrl, string $apiKey, string $apiSecret) { - $this->serverUrl = $serverUrl; + $this->serverUrl = rtrim($serverUrl, "/"); $this->apiKey = $apiKey; $this->apiSecret = $apiSecret; } diff --git a/helpers/libs/plugnmeet-sdk-php/src/Responses/CreateRoomResponse.php b/helpers/libs/plugnmeet-sdk-php/src/Responses/CreateRoomResponse.php index 927babc..7056357 100644 --- a/helpers/libs/plugnmeet-sdk-php/src/Responses/CreateRoomResponse.php +++ b/helpers/libs/plugnmeet-sdk-php/src/Responses/CreateRoomResponse.php @@ -24,72 +24,22 @@ namespace Mynaparrot\Plugnmeet\Responses; +use Mynaparrot\Plugnmeet\Utils\ActiveRoomInfo; + /** * */ class CreateRoomResponse extends BaseResponse { /** - * @return string|null - */ - public function getSid(): ?string - { - return $this->rawResponse->sid; - } - - /** - * @return string|null - */ - public function getName(): ?string - { - return $this->rawResponse->name; - } - - /** - * @return int|null + * @return ActiveRoomInfo|null */ - public function getMaxParticipants(): ?int + public function getRoomInfo(): ?ActiveRoomInfo { - return $this->rawResponse->max_participants; - } + if (isset($this->rawResponse->room_info)) { + return new ActiveRoomInfo($this->rawResponse->room_info); + } - /** - * @return int|null - */ - public function getEmptyTimeout(): ?int - { - return $this->rawResponse->empty_timeout; - } - - /** - * @return int|null - */ - public function getCreationTime(): ?int - { - return $this->rawResponse->creation_time; - } - - /** - * @return string|null - */ - public function getTurnPassword(): ?string - { - return $this->rawResponse->turn_password; - } - - /** - * @return array|null - */ - public function getEnabledCodecs(): ?array - { - return $this->rawResponse->enabled_codecs; - } - - /** - * @return string|null - */ - public function getMetadata(): ?string - { - return $this->rawResponse->metadata; + return null; } } diff --git a/helpers/libs/plugnmeet-sdk-php/src/Utils/ActiveRoomInfo.php b/helpers/libs/plugnmeet-sdk-php/src/Utils/ActiveRoomInfo.php index 0527289..20e0657 100644 --- a/helpers/libs/plugnmeet-sdk-php/src/Utils/ActiveRoomInfo.php +++ b/helpers/libs/plugnmeet-sdk-php/src/Utils/ActiveRoomInfo.php @@ -92,7 +92,7 @@ public function getJoinedParticipants(): int public function isRunning(): bool { if (isset($this->roomInfo->is_running)) { - return $this->roomInfo->is_running === 1 ? true : false; + return $this->roomInfo->is_running === 1; } return false; } @@ -103,7 +103,7 @@ public function isRunning(): bool public function isActiveRecording(): bool { if (isset($this->roomInfo->is_recording)) { - return $this->roomInfo->is_recording === 1 ? true : false; + return $this->roomInfo->is_recording === 1; } return false; } @@ -114,7 +114,7 @@ public function isActiveRecording(): bool public function isActiveRTMP(): bool { if (isset($this->roomInfo->is_active_rtmp)) { - return $this->roomInfo->is_active_rtmp === 1 ? true : false; + return $this->roomInfo->is_active_rtmp === 1; } return false; } @@ -136,7 +136,7 @@ public function getWebhookUrl(): ?string public function isBreakoutRoom(): bool { if (isset($this->roomInfo->is_breakout_room)) { - return $this->roomInfo->is_breakout_room === 1 ? true : false; + return $this->roomInfo->is_breakout_room === 1; } return false; } diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/autoload.php b/helpers/libs/plugnmeet-sdk-php/vendor/autoload.php index d3691ea..e78e0c2 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/autoload.php +++ b/helpers/libs/plugnmeet-sdk-php/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit5f22457c876a78ed36e29de1118473f4::getLoader(); +return ComposerAutoloaderInit9e36abd86d7c955c6894829e14dc8229::getLoader(); diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_real.php b/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_real.php index ab94710..873968f 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_real.php +++ b/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5f22457c876a78ed36e29de1118473f4 +class ComposerAutoloaderInit9e36abd86d7c955c6894829e14dc8229 { private static $loader; @@ -22,16 +22,16 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit5f22457c876a78ed36e29de1118473f4', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit9e36abd86d7c955c6894829e14dc8229', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit5f22457c876a78ed36e29de1118473f4', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit9e36abd86d7c955c6894829e14dc8229', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit5f22457c876a78ed36e29de1118473f4::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit9e36abd86d7c955c6894829e14dc8229::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit5f22457c876a78ed36e29de1118473f4::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit9e36abd86d7c955c6894829e14dc8229::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_static.php b/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_static.php index acf6986..e958cea 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_static.php +++ b/helpers/libs/plugnmeet-sdk-php/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit5f22457c876a78ed36e29de1118473f4 +class ComposerStaticInit9e36abd86d7c955c6894829e14dc8229 { public static $files = array ( '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', @@ -286,9 +286,9 @@ class ComposerStaticInit5f22457c876a78ed36e29de1118473f4 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit5f22457c876a78ed36e29de1118473f4::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit5f22457c876a78ed36e29de1118473f4::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit5f22457c876a78ed36e29de1118473f4::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit9e36abd86d7c955c6894829e14dc8229::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit9e36abd86d7c955c6894829e14dc8229::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit9e36abd86d7c955c6894829e14dc8229::$classMap; }, null, ClassLoader::class); } diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.json b/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.json index 7ea0f6c..d2e390c 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.json +++ b/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.json @@ -324,21 +324,21 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -346,7 +346,7 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { "thanks": { @@ -386,7 +386,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -406,23 +406,23 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2024-01-29T20:11:03+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { "thanks": { @@ -465,7 +465,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.php b/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.php index f6d7941..10f72e3 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.php +++ b/helpers/libs/plugnmeet-sdk-php/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'mynaparrot/plugnmeet-sdk', - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', + 'pretty_version' => '1.5.2', + 'version' => '1.5.2.0', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', @@ -29,8 +29,8 @@ 'dev_requirement' => false, ), 'mynaparrot/plugnmeet-sdk' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', + 'pretty_version' => '1.5.2', + 'version' => '1.5.2.0', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', @@ -62,18 +62,18 @@ ), ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => 'ef4d7e442ca910c4764bce785146269b30cb5fc4', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => 'c565ad1e63f30e7477fc40738343c62b40bc672d', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-ctype/composer.json b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-ctype/composer.json index b222fda..131ca7a 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-ctype/composer.json +++ b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php index eb5952e..5ff93fc 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php +++ b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php @@ -32,7 +32,7 @@ public function __set(string $name, $value): void } if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { - throw new \TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); + throw new TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); } $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); diff --git a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/composer.json b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/composer.json index 381af79..28b6408 100644 --- a/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/composer.json +++ b/helpers/libs/plugnmeet-sdk-php/vendor/symfony/polyfill-php81/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, diff --git a/helpers/plugNmeetConnect.php b/helpers/plugNmeetConnect.php index 0d21f78..6e087b0 100644 --- a/helpers/plugNmeetConnect.php +++ b/helpers/plugNmeetConnect.php @@ -99,7 +99,7 @@ public function getPlugnmeet(): PlugNmeet /** * @return string */ - public function getUUID() + public function getUUID(): string { return $this->plugnmeet->getUUID(); } @@ -179,6 +179,9 @@ public function createRoom(string $roomId, string $roomTitle, string $welcomeMes if (isset($roomFeatures['allow_raise_hand'])) { $features->setAllowRaiseHand($roomFeatures['allow_raise_hand']); } + if (isset($roomFeatures['auto_gen_user_id'])) { + $features->setAutoGenUserId($roomFeatures['auto_gen_user_id']); + } if (isset($roomMetadata['recording_features'])) { $roomRecordingFeatures = $roomMetadata['recording_features']; @@ -249,10 +252,8 @@ public function createRoom(string $roomId, string $roomTitle, string $welcomeMes if (isset($roomWaitingRoomFeatures['is_active'])) { $waitingRoomFeatures->setIsActive($roomWaitingRoomFeatures['is_active']); } - if (isset($roomWaitingRoomFeatures['waiting_room_msg'])) { - if (!empty($roomWaitingRoomFeatures['waiting_room_msg'])) { - $waitingRoomFeatures->setWaitingRoomMsg($roomWaitingRoomFeatures['waiting_room_msg']); - } + if (!empty($roomWaitingRoomFeatures['waiting_room_msg'])) { + $waitingRoomFeatures->setWaitingRoomMsg($roomWaitingRoomFeatures['waiting_room_msg']); } $features->setWaitingRoomFeatures($waitingRoomFeatures); } @@ -264,9 +265,7 @@ public function createRoom(string $roomId, string $roomTitle, string $welcomeMes $breakoutRoomFeatures->setIsAllow($roomBreakoutRoomFeatures['is_allow']); } if (isset($roomBreakoutRoomFeatures['allowed_number_rooms'])) { - if (!empty($roomBreakoutRoomFeatures['allowed_number_rooms'])) { - $breakoutRoomFeatures->setAllowedNumberRooms($roomBreakoutRoomFeatures['allowed_number_rooms']); - } + $breakoutRoomFeatures->setAllowedNumberRooms((int)$roomBreakoutRoomFeatures['allowed_number_rooms']); } $features->setBreakoutRoomFeatures($breakoutRoomFeatures); } @@ -405,6 +404,7 @@ public function createRoom(string $roomId, string $roomTitle, string $welcomeMes * @param bool $isAdmin * @param bool $isHidden * @param UserMetadataParameters|null $userMetadata + * @param LockSettingsParameters|null $lockSettings * @return GenerateJoinTokenResponse */ public function getJoinToken(string $roomId, string $name, string $userId, bool $isAdmin, bool $isHidden = false, UserMetadataParameters $userMetadata = null, LockSettingsParameters $lockSettings = null): GenerateJoinTokenResponse @@ -430,7 +430,7 @@ public function getJoinToken(string $roomId, string $name, string $userId, bool * @param string $roomId * @return EndRoomResponse */ - public function endRoom(string $roomId) + public function endRoom(string $roomId): EndRoomResponse { $endRoomParameters = new EndRoomParameters(); $endRoomParameters->setRoomId($roomId); diff --git a/lang/en/plugnmeet.php b/lang/en/plugnmeet.php index 7b3fa2e..302fc5e 100644 --- a/lang/en/plugnmeet.php +++ b/lang/en/plugnmeet.php @@ -90,6 +90,10 @@ $string['default_screen_share_resolution_des'] = 'Default screen share resolution'; $string['default_audio_preset'] = 'Audio preset'; $string['default_audio_preset_des'] = 'Audio preset for microphone'; +$string['copyright_display'] = 'Enable copyright display'; +$string['copyright_display_des'] = 'If enabled then it will display bellow text'; +$string['copyright_text'] = 'Copyright text'; +$string['copyright_text_des'] = 'This text can be set if configuration of server allow to override'; $string['roomtitle'] = 'Room title'; $string['welcome_message'] = 'Welcome message'; @@ -111,6 +115,7 @@ $string['enable_analytics'] = 'Enable analytics'; $string['allow_virtual_bg'] = 'Allow virtual background'; $string['allow_raise_hand'] = 'Allow raise hand'; +$string['auto_gen_user_id'] = 'Auto generate user ID'; $string['other_features'] = 'Other features'; diff --git a/settings.php b/settings.php index c30d7b1..7cc6374 100644 --- a/settings.php +++ b/settings.php @@ -255,6 +255,23 @@ get_string('column_camera_width', 'mod_plugnmeet'), get_string('column_camera_width_des', 'mod_plugnmeet'), 'full', $columncamerawidth)); + + $copyright = array( + 1 => get_string('yes', 'mod_plugnmeet'), + 0 => get_string('no', 'mod_plugnmeet') + ); + $settings->add(new admin_setting_configselect( + 'mod_plugnmeet/copyright_display', + get_string('copyright_display', 'mod_plugnmeet'), + get_string('copyright_display_des', 'mod_plugnmeet'), + 1, $copyright)); + + $settings->add(new admin_setting_configtext( + 'mod_plugnmeet/copyright_text', + get_string('copyright_text', 'plugnmeet'), + get_string('copyright_text_des', 'plugnmeet'), + "Powered by plugNmeet", + PARAM_RAW)); } ?>