]> source.dussan.org Git - gitblit.git/commitdiff
Added attributes tab to Edit User for both site and Manager
authorJames Moger <james.moger@gitblit.com>
Wed, 5 Dec 2012 22:24:18 +0000 (17:24 -0500)
committerJames Moger <james.moger@gitblit.com>
Wed, 5 Dec 2012 22:24:18 +0000 (17:24 -0500)
src/com/gitblit/client/EditUserDialog.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/pages/EditUserPage.html
src/com/gitblit/wicket/pages/EditUserPage.java

index e954fed675423046dc5452a5105e18ac487f3580..0400f5c9eaab01157f89a17cf8ac2af82c2a0e87 100644 (file)
@@ -90,7 +90,17 @@ public class EditUserDialog extends JDialog {
        private JCheckBox canCreateCheckbox;\r
 \r
        private JCheckBox notFederatedCheckbox;\r
+       \r
+       private JTextField organizationalUnitField;\r
+       \r
+       private JTextField organizationField;\r
 \r
+       private JTextField localityField;\r
+       \r
+       private JTextField stateProvinceField;\r
+       \r
+       private JTextField countryCodeField;\r
+       \r
        private RegistrantPermissionsPanel repositoryPalette;\r
 \r
        private JPalette<TeamModel> teamsPalette;\r
@@ -142,6 +152,12 @@ public class EditUserDialog extends JDialog {
                                Translation.get("gb.excludeFromFederationDescription"),\r
                                anUser.excludeFromFederation);\r
                \r
+               organizationalUnitField = new JTextField(anUser.organizationalUnit == null ? "" : anUser.organizationalUnit, 25);\r
+               organizationField = new JTextField(anUser.organization == null ? "" : anUser.organization, 25);\r
+               localityField = new JTextField(anUser.locality == null ? "" : anUser.locality, 25);\r
+               stateProvinceField = new JTextField(anUser.stateProvince == null ? "" : anUser.stateProvince, 25);\r
+               countryCodeField = new JTextField(anUser.countryCode == null ? "" : anUser.countryCode, 15);\r
+               \r
                // credentials are optionally controlled by 3rd-party authentication\r
                usernameField.setEnabled(settings.supportsCredentialChanges);\r
                passwordField.setEnabled(settings.supportsCredentialChanges);\r
@@ -149,6 +165,12 @@ public class EditUserDialog extends JDialog {
 \r
                displayNameField.setEnabled(settings.supportsDisplayNameChanges);\r
                emailAddressField.setEnabled(settings.supportsEmailAddressChanges);\r
+               \r
+               organizationalUnitField.setEnabled(settings.supportsDisplayNameChanges);\r
+               organizationField.setEnabled(settings.supportsDisplayNameChanges);\r
+               localityField.setEnabled(settings.supportsDisplayNameChanges);\r
+               stateProvinceField.setEnabled(settings.supportsDisplayNameChanges);\r
+               countryCodeField.setEnabled(settings.supportsDisplayNameChanges);\r
 \r
                JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.username"), usernameField));\r
@@ -162,6 +184,13 @@ public class EditUserDialog extends JDialog {
                fieldsPanel.add(newFieldPanel(Translation.get("gb.excludeFromFederation"),\r
                                notFederatedCheckbox));\r
 \r
+               JPanel attributesPanel = new JPanel(new GridLayout(0, 1, 5, 2));\r
+               attributesPanel.add(newFieldPanel(Translation.get("gb.organizationalUnit") + " (OU)", organizationalUnitField));\r
+               attributesPanel.add(newFieldPanel(Translation.get("gb.organization") + " (O)", organizationField));\r
+               attributesPanel.add(newFieldPanel(Translation.get("gb.locality") + " (L)", localityField));\r
+               attributesPanel.add(newFieldPanel(Translation.get("gb.stateProvince") + " (ST)", stateProvinceField));\r
+               attributesPanel.add(newFieldPanel(Translation.get("gb.countryCode") + " (C)", countryCodeField));\r
+               \r
                final Insets _insets = new Insets(5, 5, 5, 5);\r
                repositoryPalette = new RegistrantPermissionsPanel(RegistrantType.REPOSITORY);\r
                teamsPalette = new JPalette<TeamModel>();\r
@@ -170,6 +199,9 @@ public class EditUserDialog extends JDialog {
                JPanel fieldsPanelTop = new JPanel(new BorderLayout());\r
                fieldsPanelTop.add(fieldsPanel, BorderLayout.NORTH);\r
 \r
+               JPanel attributesPanelTop = new JPanel(new BorderLayout());\r
+               attributesPanelTop.add(attributesPanel, BorderLayout.NORTH);\r
+\r
                JPanel repositoriesPanel = new JPanel(new BorderLayout()) {\r
 \r
                        private static final long serialVersionUID = 1L;\r
@@ -192,6 +224,7 @@ public class EditUserDialog extends JDialog {
 \r
                JTabbedPane panel = new JTabbedPane(JTabbedPane.TOP);\r
                panel.addTab(Translation.get("gb.general"), fieldsPanelTop);\r
+               panel.addTab(Translation.get("gb.attributes"), attributesPanelTop);\r
                if (protocolVersion > 1) {\r
                        panel.addTab(Translation.get("gb.teamMemberships"), teamsPanel);\r
                }\r
@@ -324,6 +357,12 @@ public class EditUserDialog extends JDialog {
                user.canCreate = canCreateCheckbox.isSelected();\r
                user.excludeFromFederation = notFederatedCheckbox.isSelected();\r
 \r
+               user.organizationalUnit = organizationalUnitField.getText().trim();\r
+               user.organization = organizationField.getText().trim();\r
+               user.locality = localityField.getText().trim();\r
+               user.stateProvince = stateProvinceField.getText().trim();\r
+               user.countryCode = countryCodeField.getText().trim();\r
+               \r
                for (RegistrantAccessPermission rp : repositoryPalette.getPermissions()) {\r
                        user.setRepositoryPermission(rp.registrant, rp.permission);\r
                }\r
index 9ee9f39725b71c2adde8cd28cc1f1df7325d64f3..7ce752624d2037c519d24012c40dc46d27ffdc4f 100644 (file)
@@ -433,4 +433,5 @@ gb.warning = warning
 gb.jceWarning = Your Java Runtime Environment does not have the \"JCE Unlimited Strength Jurisdiction Policy\" files.\nThis will limit the length of passwords you may use to encrypt your keystores to 7 characters.\nThese policy files are an optional download from Oracle.\n\nWould you like to continue and generate the certificate infrastructure anyway?\n\nAnswering No will direct your browser to Oracle's download page so that you may download the policy files.\r
 gb.maxActivityCommits = max activity commits\r
 gb.maxActivityCommitsDescription = maximum number of commits to contribute to the Activity page\r
-gb.noMaximum = no maximum
\ No newline at end of file
+gb.noMaximum = no maximum\r
+gb.attributes = attributes
\ No newline at end of file
index e697a354acfc3a934c9017a7a16d43f7d4dc2020..e79011c809c1ab9a4037e1a12a251c520970b170 100644 (file)
@@ -13,6 +13,7 @@
        <!-- tab titles -->\r
        <ul class="nav nav-tabs">\r
                <li class="active"><a href="#general" data-toggle="tab"><wicket:message key="gb.general"></wicket:message></a></li>\r
+               <li><a href="#attributes" data-toggle="tab"><wicket:message key="gb.attributes"></wicket:message></a></li>\r
                <li><a href="#permissions" data-toggle="tab"><wicket:message key="gb.accessPermissions"></wicket:message></a></li>\r
        </ul>\r
 \r
                </table>\r
                </div>\r
                \r
+               <!-- attributes tab -->\r
+               <div class="tab-pane" id="attributes">\r
+               <table class="plain">\r
+                       <tbody class="settings">\r
+                               <tr><th><wicket:message key="gb.organizationalUnit"></wicket:message> (OU)</th><td class="edit"><input type="text" wicket:id="organizationalUnit" size="30" tabindex="1" /></td></tr>\r
+                               <tr><th><wicket:message key="gb.organization"></wicket:message> (O)</th><td class="edit"><input type="text" wicket:id="organization" size="30" tabindex="2" /></td></tr>\r
+                               <tr><th><wicket:message key="gb.locality"></wicket:message> (L)</th><td class="edit"><input type="text" wicket:id="locality" size="30" tabindex="3" /></td></tr>\r
+                               <tr><th><wicket:message key="gb.stateProvince"></wicket:message> (ST)</th><td class="edit"><input type="text" wicket:id="stateProvince" size="30" tabindex="4" /></td></tr>\r
+                               <tr><th><wicket:message key="gb.countryCode"></wicket:message> (C)</th><td class="edit"><input type="text" wicket:id="countryCode" size="15     " tabindex="5" /></td></tr>\r
+                       </tbody>\r
+               </table>\r
+               </div>\r
+               \r
                <!-- access permissions tab -->\r
                <div class="tab-pane" id="permissions">\r
                <table class="plain">\r
index d22800effc678ba82b471b84df26d4040a728adf..7a01fb68346aea2e1d94289fee74265247647307 100644 (file)
@@ -239,6 +239,11 @@ public class EditUserPage extends RootSubPage {
                form.add(new RegistrantPermissionsPanel("repositories", RegistrantType.REPOSITORY, repos, permissions, getAccessPermissions()));\r
                form.add(teams.setEnabled(editTeams));\r
 \r
+               form.add(new TextField<String>("organizationalUnit").setEnabled(editDisplayName));\r
+               form.add(new TextField<String>("organization").setEnabled(editDisplayName));\r
+               form.add(new TextField<String>("locality").setEnabled(editDisplayName));\r
+               form.add(new TextField<String>("stateProvince").setEnabled(editDisplayName));\r
+               form.add(new TextField<String>("countryCode").setEnabled(editDisplayName));\r
                form.add(new Button("save"));\r
                Button cancel = new Button("cancel") {\r
                        private static final long serialVersionUID = 1L;\r