Revisión 229
Añadido por Manu Mora Gordillo hace más de 13 años
controlies/trunk/applications/controlies/modules/Thinclients.py | ||
---|---|---|
if args['sord'] == "asc":
|
||
reverseSort = True
|
||
|
||
|
||
search = self.ldap.search("cn=THINCLIENTS,cn=DHCP Config","cn=*",["cn","dhcpHWAddress"])
|
||
filter="(|(dhcpOption=*subnet*)(dhcpOption=*log*))"
|
||
|
||
rows = []
|
||
|
||
|
||
try:
|
||
host_search = args["cn"]
|
||
except:
|
||
host_search = ""
|
||
|
||
try:
|
||
mac_search = args["mac"]
|
||
except:
|
||
mac_search = ""
|
||
|
||
# esto hay que cambiarlo: tenemos 4 groups en thinclientes
|
||
for i in search[6:len(search)]:
|
||
nodeinfo=i[0][0].replace ("cn=","").split(",")
|
||
row = {
|
||
"id":i[0][1]["cn"][0],
|
||
"cell":[i[0][1]["cn"][0], i[0][1]["dhcpHWAddress"][0].replace("ethernet ",""), nodeinfo[1]],
|
||
"cn":i[0][1]["cn"][0],
|
||
"dhcpHWAddress":i[0][1]["dhcpHWAddress"][0],
|
||
"groupName":i[0][1]["dhcpHWAddress"][0]
|
||
}
|
||
rows.append(row)
|
||
host = i[0][1]["cn"][0]
|
||
mac = i[0][1]["dhcpHWAddress"][0].replace("ethernet ","")
|
||
|
||
if ((host_search != "" and host.find(host_search)>=0) or (host_search=="")) and ((mac_search != "" and mac.find(mac_search)>=0) or (mac_search=="")):
|
||
nodeinfo=i[0][0].replace ("cn=","").split(",")
|
||
row = {
|
||
"id":host,
|
||
"cell":[host, mac, nodeinfo[1]],
|
||
"cn":host,
|
||
"dhcpHWAddress":mac,
|
||
"groupName":mac
|
||
}
|
||
rows.append(row)
|
||
|
||
if len(rows) > 0:
|
||
totalPages = ceil( len(rows) / int(limit) )
|
||
else:
|
Exportar a: Unified diff
Ya funciona el buscador de thinclients