ajout edition wifi
This commit is contained in:
parent
815bc9ff45
commit
5ecf9f0ac5
@ -73,9 +73,14 @@ class WifiRestController(AuthenticatedRestController):
|
||||
|
||||
if member is None:
|
||||
self.show.error_no_entry()
|
||||
|
||||
return { "member_ldap" : member }
|
||||
#end def
|
||||
|
||||
|
||||
@expose("brie.templates.edit.wifi")
|
||||
def post(self, uid, password):
|
||||
|
||||
member = Member.get_by_uid(self.user, uid)
|
||||
|
||||
if member is None:
|
||||
@ -87,9 +92,7 @@ class WifiRestController(AuthenticatedRestController):
|
||||
wifi_dn = "cn=wifi," + member.dn
|
||||
self.user.ldap_bind.add_entry(wifi_dn, Wifi.entry_attr(password))
|
||||
else:
|
||||
attr = {
|
||||
"userPassword" : password
|
||||
}
|
||||
attr = Wifi.password_attr(password)
|
||||
self.user.ldap_bind.replace_attr(wifi.dn, attr)
|
||||
#end if
|
||||
|
||||
|
@ -64,13 +64,20 @@ class Wifi(object):
|
||||
return {
|
||||
"objectClass" : ["top", "organizationalRole", "simpleSecurityObject"],
|
||||
"cn" : "wifi",
|
||||
"userPassword" : password
|
||||
"userPassword" : str(password)
|
||||
}
|
||||
#end def
|
||||
|
||||
@staticmethod
|
||||
def password_attr(password):
|
||||
return {
|
||||
"userPassword" : str(password)
|
||||
}
|
||||
#end def
|
||||
|
||||
@staticmethod
|
||||
def get_by_dn(user_session, dn):
|
||||
return user_session.ldap_bind.search_first("cn=wifi," + dn)
|
||||
return user_session.ldap_bind.search_dn("cn=wifi," + dn)
|
||||
#end def
|
||||
|
||||
#end class
|
||||
|
@ -8,7 +8,8 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
a:hover, input[type="button"]
|
||||
{
|
||||
color: white;
|
||||
background-color: black;
|
||||
}
|
||||
@ -36,3 +37,16 @@ a:hover {
|
||||
font-weight: bold;
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
.link_button {
|
||||
text-decoration: underline;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
input[type="submit"]
|
||||
{
|
||||
border: none;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,16 +1,23 @@
|
||||
<html>
|
||||
<head>
|
||||
<link type="text/css" rel="Stylesheet" href="/css/common.css" />
|
||||
<link type="text/css" rel="Stylesheet" href="/css/show.css" />
|
||||
</head>
|
||||
<body>
|
||||
<form action="/auth/login" method="post">
|
||||
<p class="error">${error}</p>
|
||||
<div>
|
||||
<span>Nom d'utilisateur</span>
|
||||
<input name="username" type="text" value="${login}" />
|
||||
</div>
|
||||
<div>
|
||||
<span>Nom d'utilisateur</span>
|
||||
<input name="password" type="password" />
|
||||
</div>
|
||||
<input type="submit" value="connexion"/>
|
||||
</form>
|
||||
<div class="section">
|
||||
<span class="section_name show_section_name">CONNEXION</span>
|
||||
<form action="/auth/login" method="post">
|
||||
<p class="error">${error}</p>
|
||||
<div>
|
||||
<span class="item_name">Utilisateur</span>
|
||||
<input name="username" type="text" value="${login}" />
|
||||
</div>
|
||||
<div>
|
||||
<span class="item_name">Mot de passe</span>
|
||||
<input name="password" type="password" />
|
||||
</div>
|
||||
<input type="submit" value="SOUMETTRE"/>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
28
Brie/brie/templates/edit/wifi.html
Normal file
28
Brie/brie/templates/edit/wifi.html
Normal file
@ -0,0 +1,28 @@
|
||||
<html
|
||||
xmlns:py="http://genshi.edgewall.org/"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="member_room_interface_edit_views.html" />
|
||||
<head>
|
||||
<link type="text/css" rel="Stylesheet" href="/css/common.css" />
|
||||
<link type="text/css" rel="Stylesheet" href="/css/show.css" />
|
||||
<link type="text/css" rel="Stylesheet" href="/css/edit.css" />
|
||||
</head>
|
||||
<body>
|
||||
${edit_banner()}
|
||||
${back_show("member", member_ldap.uid.first())}
|
||||
<div class="section">
|
||||
<span class="section_name show_section_name">WIFI :: ${member_ldap.cn.first()}</span>
|
||||
<form action="/edit/wifi/${member_ldap.uid.first()}" method="POST">
|
||||
<div>
|
||||
<div>
|
||||
<input type="hidden" name="uid" value="${member_ldap.uid.first()}" />
|
||||
<span class="item_name">Mot de passe</span>
|
||||
<input type="password" name="password" />
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" value="ENREGISTRER" class="button"/>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -47,6 +47,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<span class="item_name">Wifi</span>
|
||||
<span><a href="/edit/wifi/${member_ldap.uid.first()}" class="link_button">mot de passe</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user