Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
IlhemEssaadi committed Oct 13, 2023
1 parent 5707f88 commit 60b12a7
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 136 deletions.
1 change: 1 addition & 0 deletions translations.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
baseDir=add-ons/multifactor-authentication/

global.properties=webapps/src/main/resources/locale/navigation/portal/global_en.properties
administration.properties=webapps/src/main/resources/locale/navigation/portal/administration_en.properties
mfaAdministrationNavigation.properties=webapps/src/main/resources/locale/navigation/group/platform/administrators_en.properties

multifactorAuthentication.properties=webapps/src/main/resources/locale/portlet/multifactorAuthentication/multifactorAuthentication_en.properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# Copyright (C) 2009 eXo Platform SAS.
# Copyright (C) 2023 eXo Platform SAS.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,102 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd http://www.exoplatform.org/xml/ns/kernel_1_3.xsd" xmlns="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd">
<external-component-plugins>
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>This listener creates Mfa Pages</description>
<init-params>
<object-param>
<name>portal.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="ownerType">
<string>portal</string>
</field>
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>global</string>
</value>
</collection>
</field>
<field name="location">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.metadata.importmode:insert}</string>
</field>
</object>
</object-param>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>/platform/administrators</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>group</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.metadata.importmode:insert}</string>
</field>
<field name="templateLocation">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>this listener init the portal configuration</description>
<init-params>
<value-param>
<name>override</name>
<description>The flag parameter to decide if portal metadata is overriden on restarting server</description>
<value> ${exo.mfa.portalConfig.administration.metadata.override:true} </value>
</value-param>
<object-param>
<name>portal.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>administration</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>portal</string>
</field>
<field name="templateLocation">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.administration.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.administration.importmode:insert}</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
<external-component-plugins>
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>This listener creates Mfa Pages</description>
<init-params>
<object-param>
<name>portal.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="ownerType">
<string>portal</string>
</field>
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>global</string>
</value>
</collection>
</field>
<field name="location">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.metadata.importmode:insert}</string>
</field>
</object>
</object-param>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>/platform/administrators</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>group</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.metadata.importmode:insert}</string>
</field>
<field name="templateLocation">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>this listener init the portal configuration</description>
<init-params>
<object-param>
<name>portal.configuration</name>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>administration</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>portal</string>
</field>
<field name="templateLocation">
<string>war:/conf/multifactor-authentication/portal</string>
</field>
<field name="override">
<boolean>${exo.mfa.portalConfig.administration.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.mfa.portalConfig.administration.importmode:merge}</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This software 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
* Copyright (C) 2023 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-->
<node-navigation
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -30,19 +27,15 @@
<name>home</name>
<label>#{portal.administration.home}</label>
<icon>fas fa-cog</icon>
<visibility>DISPLAYED</visibility>
<node>
<name>security</name>
<label>#{portal.administration.security}</label>
<icon>fas fa-shield-alt</icon>
<visibility>DISPLAYED</visibility>
<node>
<name>multifactor-authentication</name>
<label>#{portal.administration.multifactor-authentication}</label>
<icon>fas fa-user-shield</icon>
<visibility>DISPLAYED</visibility>
<page-reference>portal::administration::multifactor-authentication</page-reference>

</node>
</node>
</node>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software 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 Lesser General Public License
for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org. -->

<!--
* Copyright (C) 2023 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-->
<page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/gatein_objects_1_8 http://www.exoplatform.org/xml/ns/gatein_objects_1_8"
xmlns="http://www.exoplatform.org/xml/ns/gatein_objects_1_8">
Expand All @@ -11,15 +25,17 @@
<access-permissions>*:/platform/administrators</access-permissions>
<edit-permission>manager:/platform/administrators</edit-permission>
<show-max-window>false</show-max-window>
<portlet-application>
<portlet>
<application-ref>multifactor-authentication</application-ref>
<portlet-ref>multifactorAuthentication</portlet-ref>
</portlet>
<title>Multifactor authentication</title>
<access-permissions>*:/platform/administrators</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
<container id="singlePageApplicationContainer" template="system:/groovy/portal/webui/container/UIContainer.gtmpl" cssClass="singlePageApplication">
<access-permissions>*:/platform/users</access-permissions>
<portlet-application>
<portlet>
<application-ref>multifactor-authentication</application-ref>
<portlet-ref>multifactorAuthentication</portlet-ref>
</portlet>
<title>Multifactor authentication</title>
<access-permissions>*:/platform/administrators</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
</page>

</page-set>

0 comments on commit 60b12a7

Please sign in to comment.