diff --git a/plugin/lti_provider/db/lti13_cookie.php b/plugin/lti_provider/db/lti13_cookie.php index 6b5afc70091..6798e70980f 100644 --- a/plugin/lti_provider/db/lti13_cookie.php +++ b/plugin/lti_provider/db/lti13_cookie.php @@ -31,7 +31,7 @@ public function setCookie($name, $value, $exp = 3600, $options = []): self // SameSite none and secure will be required for tools to work inside iframes $sameSiteOptions = [ 'samesite' => 'None', - 'secure' => false, + 'secure' => true, 'httponly' => true, ]; diff --git a/plugin/lti_provider/duplicate.php b/plugin/lti_provider/duplicate.php new file mode 100644 index 00000000000..6bec63045a8 --- /dev/null +++ b/plugin/lti_provider/duplicate.php @@ -0,0 +1,47 @@ +find('ChamiloPluginBundle:LtiProvider\Platform', $platformId); + +if (!$platform) { + api_not_allowed(true); +} + +$newPlatform = new Platform(); +$newPlatform->setIssuer($platform->getIssuer()); +$newPlatform->setClientId($platform->getClientId()); +$newPlatform->setAuthLoginUrl($platform->getAuthLoginUrl()); +$newPlatform->setAuthTokenUrl($platform->getAuthTokenUrl()); +$newPlatform->setKeySetUrl($platform->getKeySetUrl()); +$newPlatform->setDeploymentId($platform->getDeploymentId()); +$newPlatform->setKid($platform->getKid()); +$newPlatform->setToolProvider($platform->getToolProvider()); + +$em->persist($newPlatform); +$em->flush(); + +Display::addFlash( + Display::return_message($plugin->get_lang('PlatformDuplicated'), 'success') +); + +header('Location: '.api_get_path(WEB_PLUGIN_PATH).'lti_provider/edit.php?id='.$newPlatform->getId()); +exit; diff --git a/plugin/lti_provider/lang/english.php b/plugin/lti_provider/lang/english.php index 9856a3307c1..310d73e557c 100644 --- a/plugin/lti_provider/lang/english.php +++ b/plugin/lti_provider/lang/english.php @@ -13,6 +13,8 @@ $strings['PlatformName'] = 'LMS (issuer)'; $strings['PlatformEdited'] = 'Platform details edited'; $strings['PlatformDeleted'] = 'Platform deleted'; +$strings['PlatformDuplicated'] = 'Platform duplicated'; +$strings['Duplicate'] = 'Duplicate'; $strings['ClientId'] = 'Client ID'; $strings['LaunchUrl'] = 'Launch URL'; $strings['LoginUrl'] = 'Login URL'; diff --git a/plugin/lti_provider/lang/french.php b/plugin/lti_provider/lang/french.php index 65cf98532bd..6ad439c1e10 100644 --- a/plugin/lti_provider/lang/french.php +++ b/plugin/lti_provider/lang/french.php @@ -11,6 +11,8 @@ $strings['PlatformName'] = 'LMS (émetteur)'; $strings['PlatformEdited'] = 'Détails de la plateforme modifiés'; $strings['PlatformDeleted'] = 'Plateforme supprimée'; +$strings['PlatformDuplicated'] = 'Plateforme dupliquée'; +$strings['Duplicate'] = 'Dupliquer'; $strings['ClientId'] = 'Client ID'; $strings['LaunchUrl'] = 'Lancer l\'URL'; $strings['LoginUrl'] = 'URL de connexion'; diff --git a/plugin/lti_provider/lang/spanish.php b/plugin/lti_provider/lang/spanish.php index 4ea2886bfce..9430f99f6e6 100644 --- a/plugin/lti_provider/lang/spanish.php +++ b/plugin/lti_provider/lang/spanish.php @@ -13,6 +13,8 @@ $strings['PlatformName'] = 'LMS (emisor)'; $strings['PlatformEdited'] = 'Detalles de la plataforma editados'; $strings['PlatformDeleted'] = 'Plataforma eliminada'; +$strings['PlatformDuplicated'] = 'Plataforma duplicada'; +$strings['Duplicate'] = 'Duplicar'; $strings['ClientId'] = 'ID de cliente'; $strings['LaunchUrl'] = 'URL de lanzamiento'; $strings['LoginUrl'] = 'URL de inicio de sesión'; diff --git a/plugin/lti_provider/src/Form/FrmAdd.php b/plugin/lti_provider/src/Form/FrmAdd.php index 8bc095c4072..b61b9110941 100644 --- a/plugin/lti_provider/src/Form/FrmAdd.php +++ b/plugin/lti_provider/src/Form/FrmAdd.php @@ -53,9 +53,6 @@ public function build(): void [ 'quiz' => $plugin->get_lang('Quizzes'), 'lp' => $plugin->get_lang('Learnpaths'), - ], - [ - 'onclick' => 'selectToolProvider(this.value)', ] ); diff --git a/plugin/lti_provider/src/Form/FrmEdit.php b/plugin/lti_provider/src/Form/FrmEdit.php index 57a583ea1b2..f458098adb6 100644 --- a/plugin/lti_provider/src/Form/FrmEdit.php +++ b/plugin/lti_provider/src/Form/FrmEdit.php @@ -53,9 +53,6 @@ public function build() [ 'quiz' => $plugin->get_lang('Quizzes'), 'lp' => $plugin->get_lang('Learnpaths'), - ], - [ - 'onclick' => 'selectToolProvider(this.value)', ] ); diff --git a/plugin/lti_provider/view/add.tpl b/plugin/lti_provider/view/add.tpl index 30c37490ba6..6695606efde 100644 --- a/plugin/lti_provider/view/add.tpl +++ b/plugin/lti_provider/view/add.tpl @@ -4,16 +4,26 @@ diff --git a/plugin/lti_provider/view/provider_admin.tpl b/plugin/lti_provider/view/provider_admin.tpl index acaffc00d77..8ed0f5a9a04 100644 --- a/plugin/lti_provider/view/provider_admin.tpl +++ b/plugin/lti_provider/view/provider_admin.tpl @@ -39,6 +39,9 @@ {{ 'edit.png'|img(22, 'Edit'|get_lang) }} + + {{ 'copy.png'|img(22, 'Duplicate'|get_plugin_lang('LtiProviderPlugin')) }} + {{ 'delete.png'|img(22, 'Delete'|get_lang) }}