quelques fixs

This commit is contained in:
Roven Gabriel 2013-03-23 15:37:34 +01:00
parent f1c9b6e522
commit 5403c62209
6 changed files with 30 additions and 8 deletions

View File

@ -30,13 +30,13 @@ class EditController(AuthenticatedBaseController):
""" Affiche les détails du membre, de la chambre et de l'interface """
@expose("brie.templates.edit.member")
def member(self, uid):
return self.show.member(uid)
def member(self, residence, uid):
return self.show.member(residence, uid)
#end def
@expose("brie.templates.edit.room")
def room(self, room_number):
return self.show.room(room_number)
def room(self, residence, room_id):
return self.show.room(residence, room_id)
#end def
#end class

View File

@ -91,7 +91,8 @@ class RoomsController(AuthenticatedBaseController):
index_result = self.index(residence)
room = Room.get_by_uid(self.user, self.user.residence_dn, number)
residence_dn = Residences.get_dn_by_name(self.user, residence)
room = Room.get_by_uid(self.user, residence_dn, number)
member = None

View File

@ -32,7 +32,7 @@ class ShowController(AuthenticatedBaseController):
room = Room.get_by_member_dn(self.user, residence_dn, member.dn)
machines = Machine.get_machines_of_member(self.user, member.dn)
machines = Machine.get_machine_tuples_of_member(self.user, member.dn)
groups = Groupes.get_by_user_dn(self.user, residence_dn, member.dn)

View File

@ -32,7 +32,7 @@ class Ldap(object):
try:
results = self.__connection.search_s(dn, scope, filter)
except ldap.NO_SUCH_OBJECT:
return None
return []
#end try
ldap_results = []

View File

@ -214,3 +214,24 @@ class Groupes(object):
#end def
#end class
class IpReservation:
@staticmethod
def entry_attr(ip):
return {
"objectClass" : ["top", "auroreIpReservation"],
"cn" : str(ip)
}
#end def
@staticmethod
def taken_attr(ip, description):
return {
"objectClass" : ["top", "auroreIpReservation"],
"cn" : str(ip),
"x-taken" : description
}
#end def
#end class

View File

@ -8,7 +8,7 @@
</div>
</py:def>
<py:def function="back_show(page, id)">
<a href="/show/${page}/${id}" class="button">RETOUR</a>
<a href="/show/${page}/${residence}/${id}" class="button">RETOUR</a>
</py:def>
<py:def function="member_view(member_ldap)">
<div class="section">