From 1cdcd8f1a67288bbaeb22b57680ecc7492396adf Mon Sep 17 00:00:00 2001
From: "[Julien Richer]" <[julien.richer@ext.ec.europa.eu]>
Date: Tue, 21 Mar 2023 09:56:55 +0100
Subject: [PATCH] changes done reflecting new groups

---
 bin/ldap_NS.pl | 67 ++++++++++++++++++++++++++++----------------------
 1 file changed, 37 insertions(+), 30 deletions(-)

diff --git a/bin/ldap_NS.pl b/bin/ldap_NS.pl
index 1e1e4f3..7fe541b 100755
--- a/bin/ldap_NS.pl
+++ b/bin/ldap_NS.pl
@@ -146,7 +146,7 @@ INIT {
     $validate->{'FIRSTNAME'}   = '/^\w+(\s+\w+)*$/';
     $validate->{'DESCRIPTION'} = '/^\w+(\s+\w+)*$/';
     $validate->{'GROUPCLASS'}  = '/^(posixGroup|groupOfNames|groupOfUniqueNames)$/';
-    $validate->{'PROFILE'}     = '/^(Compliance|Managment|Network|Official|ProjectImplementation|ProjectManager|Security|ServiceDesk|SupportingService|TestDesignArchitect)$/';
+    $validate->{'PROFILE'}     = '/^(Architect|Compliance|Development|Managment|Network|Noca|Officials|Ois|ProjectManager|Security|System|Videoconference)$/';
     $validate->{'STATE'}       = '/^(Luxembourg|Belgium)$/';
 
     $validate->{'PPOLICY'}   = $anchored_word;
@@ -1550,34 +1550,47 @@ EOJS
     $form->field( name    => 'uid',
                   comment => 'fetch Mail & Gecos', );
 
-    $options->{'Compliance'}            = 'Compliance';
-    $options->{'Managment'}             = 'Managment';
-    $options->{'Network'}               = 'Network';
-    $options->{'Official'}              = 'Official';
-    $options->{'ProjectImplementation'} = 'ProjectImplementation';
-    $options->{'ProjectManager'}        = 'ProjectManager';
-    $options->{'Security'}              = 'Security';
-    $options->{'ServiceDesk'}           = 'ServiceDesk';
-    $options->{'SupportingService'}     = 'SupportingService';
-    $options->{'TestDesignArchitect'}   = 'TestDesignArchitect';
+    $options->{'Architect'}       = 'Architect';
+    $options->{'Compliance'}      = 'Compliance';
+    $options->{'Development'}     = 'Development';
+    $options->{'Managment'}       = 'Managment';
+    $options->{'Network'}         = 'Network';
+    $options->{'Officials'}       = 'Officials';
+    $options->{'Ois'}             = 'Ois';
+    $options->{'ProjectManager'}  = 'ProjectManager';
+    $options->{'Security'}        = 'Security';
+    $options->{'Noca'}            = 'Noca';
+    $options->{'System'}          = 'System';
+    $options->{'Videoconference'} = 'Videoconference';
 
     my $options_profile = ();
+    $options_profile->{'Architect'}{'description'} = 'profile:Architect';
+    $options_profile->{'Architect'}{'arc'}         = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+    $options_profile->{'Architect'}{'bindhg'}      = 'posixGroup';
+    $options_profile->{'Architect'}{'logs'}        = 'posixGroup';
+
     $options_profile->{'Compliance'}{'description'} = 'profile:compliance';
     $options_profile->{'Compliance'}{'com'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
 
+    $options_profile->{'Development'}{'description'} = 'profile:development';
+    $options_profile->{'Development'}{'dev'}         = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+    $options_profile->{'Development'}{'logs'}        = 'posixGroup';
+
     $options_profile->{'Managment'}{'description'} = 'profile:managment';
     $options_profile->{'Managment'}{'mgt'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
 
     $options_profile->{'Network'}{'description'} = 'profile:network';
     $options_profile->{'Network'}{'net'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
 
-    $options_profile->{'Official'}{'description'} = 'profile:official';
-    $options_profile->{'Official'}{'officials'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+    $options_profile->{'Noca'}{'description'} = 'profile:noca';
+    $options_profile->{'Noca'}{'noca'}        = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+    $options_profile->{'Noca'}{'logs'}        = 'posixGroup';
 
-    $options_profile->{'ProjectImplementation'}{'description'} = 'profile:projectimplementation';
-    $options_profile->{'ProjectImplementation'}{'pi'}          = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
-    $options_profile->{'ProjectImplementation'}{'bindhg'}      = 'posixGroup';
-    $options_profile->{'ProjectImplementation'}{'logs'}        = 'posixGroup';
+    $options_profile->{'Officials'}{'description'} = 'profile:officials';
+    $options_profile->{'Officials'}{'officials'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+
+    $options_profile->{'Ois'}{'description'} = 'profile:ois';
+    $options_profile->{'Ois'}{'ois'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
 
     $options_profile->{'ProjectManager'}{'description'} = 'profile:projectmanager';
     $options_profile->{'ProjectManager'}{'pm'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
@@ -1587,18 +1600,12 @@ EOJS
     $options_profile->{'Security'}{'bindhg'}      = 'posixGroup';
     $options_profile->{'Security'}{'logs'}        = 'posixGroup';
 
-    $options_profile->{'ServiceDesk'}{'description'} = 'profile:servicedesk';
-    $options_profile->{'ServiceDesk'}{'sd'}          = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
-    $options_profile->{'ServiceDesk'}{'logs'}        = 'posixGroup';
-
-    $options_profile->{'SupportingService'}{'description'} = 'profile:supportingservice';
-    $options_profile->{'SupportingService'}{'sup'}         = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
-    $options_profile->{'SupportingService'}{'logs'}        = 'posixGroup';
+    $options_profile->{'System'}{'description'} = 'profile:system';
+    $options_profile->{'System'}{'sys'}         = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
+    $options_profile->{'System'}{'logs'}        = 'posixGroup';
 
-    $options_profile->{'TestDesignArchitect'}{'description'} = 'profile:testdesignarchitect';
-    $options_profile->{'TestDesignArchitect'}{'tda'}         = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
-    $options_profile->{'TestDesignArchitect'}{'bindhg'}      = 'posixGroup';
-    $options_profile->{'TestDesignArchitect'}{'logs'}        = 'posixGroup';
+    $options_profile->{'Videoconference'}{'description'} = 'profile:videoconference';
+    $options_profile->{'Videoconference'}{'vc'} = [ 'groupOfNames', 'posixGroup', 'groupOfUniqueNames' ];
 
     $form->field(
                   name       => 'profile',
@@ -1700,7 +1707,7 @@ EOJS
             my $profile  = $form->field( name => 'profile' );
             my $group    = 'snmc';
             my $group_id = 3500;
-            if ( $options->{$profile} eq 'Official' ) {
+            if ( $options->{$profile} eq 'Officials' ) {
                 $group    = 'officials';
                 $group_id = 3800;
             }
@@ -1802,7 +1809,7 @@ If you need more information from my side, please do not hesitate to contact the
             my $objectClass = '';
 
             my $posix_group_to_exclude = 'snmc';
-            if ( $options->{$profile} eq 'Official' ) {
+            if ( $options->{$profile} eq 'Officials' ) {
                 $posix_group_to_exclude = 'officials';
             }
 
-- 
GitLab