From dc43d31b21a296ac3aa1cc76eef3a0661dc8d757 Mon Sep 17 00:00:00 2001 From: hpl Date: Tue, 8 Oct 2024 10:02:34 +0200 Subject: [PATCH] maj apikaz --- dockers/apikaz/source/resources/ldap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockers/apikaz/source/resources/ldap.py b/dockers/apikaz/source/resources/ldap.py index 9c9199b..c9de869 100644 --- a/dockers/apikaz/source/resources/ldap.py +++ b/dockers/apikaz/source/resources/ldap.py @@ -19,7 +19,7 @@ class Ldap_user(Resource): @classmethod def is_valid_field(cls, field): - allowed_fields = ['mailDeSecours', 'mailEnabled', 'nextcloudEnabled', 'mobilizonEnabled', 'agoraEnabled', 'userPassword', 'identifiantKaz', 'mailAlias', 'quota'] + allowed_fields = ['numeroMembre','mailDeSecours', 'mailEnabled', 'nextcloudEnabled', 'mobilizonEnabled', 'agoraEnabled', 'userPassword', 'identifiantKaz', 'mailAlias', 'quota'] return field in allowed_fields @jwt_required() @@ -154,7 +154,7 @@ class Ldap_user(Resource): properties: field: type: string - enum: ['mailDeSecours', 'mailEnabled', 'nextcloudEnabled', 'mobilizonEnabled', 'agoraEnabled', 'userPassword', 'identifiantKaz', 'mailAlias', 'quota', 'numeroMembre'] + enum: ['numeroMembre', 'mailDeSecours', 'mailEnabled', 'nextcloudEnabled', 'mobilizonEnabled', 'agoraEnabled', 'userPassword', 'identifiantKaz', 'mailAlias', 'quota' ] description: Le champ à ajouter, supprimer ou modifier (par exemple, mailDeSecours, mailAlias, etc.) value: type: string @@ -180,7 +180,7 @@ class Ldap_user(Resource): return "Action, champ ou valeur manquant", 400 if not self.is_valid_field(field): - return "Champ non autorisé", 400 + return "Champ non autorisé !", 400 ldap_connection = self._connect_ldap() result = ldap_connection.search_s("ou=users,{}".format(self.ldap_root), ldap.SCOPE_SUBTREE, "(cn={})".format(email))