diff --git a/Configuration/Routes.yaml b/Configuration/Routes.yaml index 1803b84..ed73f34 100644 --- a/Configuration/Routes.yaml +++ b/Configuration/Routes.yaml @@ -1,35 +1,35 @@ # backend editor ajax routes - name: 'H5P Backend Editor AJAX' - uriPattern: 'neosh5p/editor' + uriPattern: 'h5p/editor' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' '@action': 'index' - name: 'H5P Backend Editor AJAX - content type cache' - uriPattern: 'neosh5p/editor/content-type-cache' + uriPattern: 'h5p/editor/content-type-cache' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' '@action': 'contentTypeCache' - name: 'H5P Backend Editor AJAX - library install' - uriPattern: 'neosh5p/editor/library-install' + uriPattern: 'h5p/editor/library-install' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' '@action': 'installLibrary' - name: 'H5P Backend Editor AJAX - library upload' - uriPattern: 'neosh5p/editor/library-upload' + uriPattern: 'h5p/editor/library-upload' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' '@action': 'uploadLibrary' - name: 'H5P Backend Editor AJAX - single library details' - uriPattern: 'neosh5p/editor/libraries' + uriPattern: 'h5p/editor/libraries' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' @@ -37,7 +37,7 @@ httpMethods: ['GET'] - name: 'H5P Backend Editor AJAX - multiple libraries' - uriPattern: 'neosh5p/editor/libraries' + uriPattern: 'h5p/editor/libraries' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' @@ -45,7 +45,7 @@ httpMethods: ['POST'] - name: 'H5P Backend Editor AJAX - editor file upload' - uriPattern: 'neosh5p/editor/files' + uriPattern: 'h5p/editor/files' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\EditorAjax' @@ -55,7 +55,7 @@ # backend content upgrade ajax routes - name: 'H5P Backend content upgrade AJAX - execute content upgrade' - uriPattern: 'neosh5p/contentupgrade/migrate/{oldLibraryId}' + uriPattern: 'h5p/contentupgrade/migrate/{oldLibraryId}' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\ContentUpgradeAjax' @@ -63,7 +63,7 @@ httpMethods: ['POST'] - name: 'H5P Backend content upgrade AJAX - get library info' - uriPattern: 'neosh5p/contentupgrade/libraryinfo(/{libraryName}/{majorVersion}/{minorVersion})' + uriPattern: 'h5p/contentupgrade/libraryinfo(/{libraryName}/{majorVersion}/{minorVersion})' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\ContentUpgradeAjax' @@ -75,14 +75,14 @@ # frontend ajax routes - name: 'H5P Frontend AJAX - save results' - uriPattern: 'neosh5p/contentresults/save' + uriPattern: 'h5p/contentresults/save' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Frontend\ContentResults' '@action': 'save' - name: 'H5P Frontend AJAX - save content user data' - uriPattern: 'neosh5p/contentuserdata/save/{queryString}' + uriPattern: 'h5p/contentuserdata/save/{queryString}' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Frontend\ContentUserData' @@ -92,7 +92,7 @@ # embed route for content - name: 'H5P Frontend - embed content as iframe' - uriPattern: 'neosh5p/content/embed/{contentId}' + uriPattern: 'h5p/content/embed/{contentId}' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Frontend\ContentEmbed' @@ -101,7 +101,7 @@ # neos fullscreen inspector routes - name: 'H5P Neos inspector - fullscreen editor content controller routes' - uriPattern: 'neosh5p/contentfullscreeneditor/{@action}(/{content})' + uriPattern: 'h5p/contentfullscreeneditor/{@action}(/{content})' defaults: '@package': 'Sandstorm.NeosH5P' '@controller': 'Backend\Content' diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index f71b017..9dd1379 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -111,19 +111,6 @@ Neos: Sandstorm.NeosH5P: true Flow: - # We add a request pattern for our controllers to the Neos Backend provider, - # so that XHR requests that go directly to these controllers (and not through - # a ModuleController subrequest) can be authenticated as well - security: - authentication: - providers: - 'Neos.Neos:Backend': - requestPatterns: - 'Sandstorm.NeosH5P:BackendControllers': - pattern: 'ControllerObjectName' - patternOptions: - controllerObjectNamePattern: 'Sandstorm\NeosH5P\Controller\Backend\.*' - # We need the tag "@variable" as an ignored annotation, because otherwise parsing of the # H5PFrameworkInterface causes a reflection error reflection: diff --git a/README.md b/README.md index 62d521d..494c73c 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,12 @@ H5P supports persisting content state (e.g. the currently selected answers to mu results (e.g. answers given by a user to a multiple choice question). In order for this to work in Neos, we need to add a few settings. -1. In your site package's `Policy.yaml`, provide the permission to use the controller actions to the role which you - want to be able to use them. If you're using a frontend login package like [Sandstorm.UserManagement](https://github.com/sandstorm/UserManagement), - your config could look like below. Replace the role `Sandstorm.UserManagement:User` with the one your frontend users - actually have. If you want to save content results and user data even for non-logged-in users, set this to - `Neos.Flow:Everybody`. Mind the GDPR implications of this, as you're then persisting data of every user that - interacts with H5P content on your site. +In your site package's `Policy.yaml`, provide the permission to use the controller actions to the role which you +want to be able to use them. If you're using a frontend login package like [Sandstorm.UserManagement](https://github.com/sandstorm/UserManagement), +your config could look like below. Replace the role `Sandstorm.UserManagement:User` with the one your frontend users +actually have. If you want to save content results and user data even for non-logged-in users, set this to +`Neos.Flow:Everybody`. Mind the GDPR implications of this, as you're then persisting data of every user that +interacts with H5P content on your site. ```YAML roles: @@ -67,25 +67,6 @@ roles: permission: GRANT ``` -2. In your site package's `Settings.yaml`, you need to add a request pattern so our controllers can recognize the correct -authenticated account. Again, the exact setting is dependent on which frontend login package you use. If you're using -[Sandstorm.UserManagement](https://github.com/sandstorm/UserManagement), the setting looks like this. If you're using -a different package or created your own frontend login, replace the provider `Sandstorm.UserManagement:Login` with the -one you are using. -```YAML -Neos: - Flow: - security: - authentication: - providers: - 'Sandstorm.UserManagement:Login': - requestPatterns: - 'Sandstorm.NeosH5P:FrontendControllers': - pattern: 'ControllerObjectName' - patternOptions: - controllerObjectNamePattern: 'Sandstorm\NeosH5P\Controller\Frontend\.*' -``` - ## 3. Integrate xAPI You can control which username and email address is sent in xAPI statements by implementing your own implementation of the `FrontendUserServiceInterface`. Check the default `Sandstorm\NeosH5P\Domain\Service\FrontendUserService` for an