demenagement vers la même résidence impossible + vérification que l'uid n'est pas déjà pris + reparation de la recherche par email
This commit is contained in:
parent
0722244f2d
commit
2bafa6ac19
@ -8,6 +8,7 @@ from brie.config import groups_enum
|
|||||||
from brie.lib.ldap_helper import *
|
from brie.lib.ldap_helper import *
|
||||||
from brie.lib.aurore_helper import *
|
from brie.lib.aurore_helper import *
|
||||||
from brie.model.ldap import *
|
from brie.model.ldap import *
|
||||||
|
from brie.lib.name_translation_helpers import Translations
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -106,6 +107,15 @@ class MembersController(AuthenticatedBaseController):
|
|||||||
# phone = member.mobile.first()
|
# 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_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)
|
self.user.ldap_bind.clone_entry(member_dn, member)
|
||||||
member = Member.get_by_uid(self.user, self.user.residence_dn, member.uid.first())
|
member = Member.get_by_uid(self.user, self.user.residence_dn, member.uid.first())
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ class SearchController(AuthenticatedBaseController):
|
|||||||
@expose("brie.templates.search.member")
|
@expose("brie.templates.search.member")
|
||||||
def email(self, residence, email, global_search = None):
|
def email(self, residence, email, global_search = None):
|
||||||
if global_search is not None and self.user.groups.admin:
|
if global_search is not None and self.user.groups.admin:
|
||||||
self.email_global(residence, email)
|
return self.email_global(residence, email)
|
||||||
else:
|
else:
|
||||||
self.email_local(residence, email)
|
return self.email_local(residence, email)
|
||||||
#end if
|
#end if
|
||||||
#end def
|
#end def
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<td py:otherwise=""><a href="/show/room/${mresidence}/${room.uid.first()}">${room.cn.first()}</a></td>
|
<td py:otherwise=""><a href="/show/room/${mresidence}/${room.uid.first()}">${room.cn.first()}</a></td>
|
||||||
</py:choose>
|
</py:choose>
|
||||||
<td>
|
<td>
|
||||||
<form action="/members/demenageResidence/" style="margin-bottom:0px" method="post" class="inline_block">
|
<form action="/members/demenageResidence/" style="margin-bottom:0px" method="post" class="inline_block" py:if="mresidence != residence">
|
||||||
<input type="hidden" name="member_dn" value="${member.dn}"/>
|
<input type="hidden" name="member_dn" value="${member.dn}"/>
|
||||||
<input type="submit" value="Move" class="button"/>
|
<input type="submit" value="Move" class="button"/>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user