Debut gestion plugins

This commit is contained in:
Roven Gabriel 2013-03-30 22:38:41 +01:00
parent e25a90aef1
commit 8348fdcf5a
5 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,7 @@ room_base_dn = "ou=chambres,"
group_base_dn = "ou=groupes,"
parametres_base_dn = "ou=parametres,"
ip_reservation_base_dn = "uid=pool_ip," + parametres_base_dn
plugins_base_dn = "uid=plugins," + parametres_base_dn
aurore_dn = "dc=aurore,dc=u-psud,dc=fr"
parametres_aurore_dn = parametres_base_dn + aurore_dn

View File

@ -6,6 +6,7 @@ from tg.decorators import expose, validate
from brie.config import ldap_config
from brie.lib.ldap_helper import *
from brie.lib.aurore_helper import *
from brie.lib.plugins import *
from brie.model.ldap import *
from brie.controllers import auth
@ -22,6 +23,7 @@ class ShowController(AuthenticatedBaseController):
""" Affiche les détails du membre, de la chambre et de l'interface """
@expose("brie.templates.show.member")
@plugins("brie.controllers.show.member")
def member(self, residence, uid):
residence_dn = Residences.get_dn_by_name(self.user, residence)

View File

@ -252,3 +252,12 @@ class IpReservation:
#end def
#end class
class Plugins:
@staticmethod
def get_by_name(user_session, residence_dn, plugin_name):
return user_session.ldap_bind.search_first(ldap_config.plugins_base_dn + residence_dn, "(cn=" + plugin_name + ")")
#end def
#end class

View File

@ -16,5 +16,7 @@
<span class="section_name" py:when="None">Pas de chambre associée</span>
<div py:otherwise="">${room_view(room_ldap)}</div>
</div>
<span>test : ${wifi_show.name}</span>
<xi:include href="plugins.html" />
</body>
</html>

View File

@ -17,7 +17,7 @@ error_email_from = paste@localhost
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 9010
port = 9002
[app:main]
use = egg:Brie