From 2bafa6ac19ece33a30a6b37030785d4c76b6db8a Mon Sep 17 00:00:00 2001 From: Romain Beuque Date: Tue, 1 Apr 2014 20:20:30 +0200 Subject: [PATCH] =?UTF-8?q?demenagement=20vers=20la=20m=C3=AAme=20r=C3=A9s?= =?UTF-8?q?idence=20impossible=20+=20v=C3=A9rification=20que=20l'uid=20n'e?= =?UTF-8?q?st=20pas=20d=C3=A9j=C3=A0=20pris=20+=20reparation=20de=20la=20r?= =?UTF-8?q?echerche=20par=20email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Brie/brie/controllers/members.py | 12 +++++++++++- Brie/brie/controllers/search.py | 4 ++-- Brie/brie/templates/search/member_global.html | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Brie/brie/controllers/members.py b/Brie/brie/controllers/members.py index a5199b5..9b0daae 100644 --- a/Brie/brie/controllers/members.py +++ b/Brie/brie/controllers/members.py @@ -8,6 +8,7 @@ from brie.config import groups_enum from brie.lib.ldap_helper import * from brie.lib.aurore_helper import * from brie.model.ldap import * +from brie.lib.name_translation_helpers import Translations from datetime import datetime @@ -105,7 +106,16 @@ class MembersController(AuthenticatedBaseController): #if member.has('mobile'): # phone = member.mobile.first() #member_uid = self.member_edit_controller.add.post(residence_name, member.givenName.first(), member.sn.first(), member.mail.first(), phone, False) - + + member = Member.get_by_dn(self.user, member_dn) + member_uid = member.uid.first() + number = 1 + while member is not None: + member_dn = "uid=" + member_uid + number + ",ou=" + str(registration_year) + "," + ldap_config.username_base_dn + residence_dn + number = number + 1 + member = Member.get_by_dn(self.user, member_dn) + #end while + self.user.ldap_bind.clone_entry(member_dn, member) member = Member.get_by_uid(self.user, self.user.residence_dn, member.uid.first()) diff --git a/Brie/brie/controllers/search.py b/Brie/brie/controllers/search.py index 335419b..387d0fc 100644 --- a/Brie/brie/controllers/search.py +++ b/Brie/brie/controllers/search.py @@ -60,9 +60,9 @@ class SearchController(AuthenticatedBaseController): @expose("brie.templates.search.member") def email(self, residence, email, global_search = None): if global_search is not None and self.user.groups.admin: - self.email_global(residence, email) + return self.email_global(residence, email) else: - self.email_local(residence, email) + return self.email_local(residence, email) #end if #end def diff --git a/Brie/brie/templates/search/member_global.html b/Brie/brie/templates/search/member_global.html index f700e4d..e177850 100644 --- a/Brie/brie/templates/search/member_global.html +++ b/Brie/brie/templates/search/member_global.html @@ -23,7 +23,7 @@ ${room.cn.first()} -
+