Revisión 107
Añadido por Manu Mora Gordillo hace alrededor de 14 años
controlies/trunk/Server.py | ||
---|---|---|
|
||
|
||
def _add_locationServers(self, name, address, port):
|
||
print name
|
||
computerToAdd = name.split(" ")
|
||
f = open(fileNameServers, 'a')
|
||
f.write(computerToAdd[0]+" ")
|
||
... | ... | |
|
||
|
||
def _add_locationTeachers(self, name, address, port):
|
||
print name
|
||
teacherToAdd = name.split(" ")
|
||
f = open(fileNameTeachers, 'a')
|
||
f.write(teacherToAdd[0]+" ")
|
controlies/trunk/Plugins/Users.py | ||
---|---|---|
|
||
return dataUser
|
||
|
||
|
||
def getUserPhoto(self):
|
||
self.getUserGroups()
|
||
result = self.ldap.search("ou=People","uid="+self.user,["jpegPhoto"])
|
||
|
||
try:
|
||
photo = base64.b64encode(result[0][0][1]["jpegPhoto"][0])
|
||
except:
|
||
photo = ""
|
||
|
||
dataUser = {
|
||
"photo":photo
|
||
}
|
||
|
||
return dataUser
|
controlies/trunk/www/classroomServers/index.html | ||
---|---|---|
#selectable .ui-selected { background: #F39814; color: white; }
|
||
#selectable { list-style-type: none; margin: 0; padding: 0; }
|
||
#selectable li { margin: 3px 3px 3px 0; padding: 1px; float: left; width: 80px; height: 95px; font-size: 1px; text-align: center; cursor:pointer; }
|
||
|
||
#selectableStudents .ui-selecting { background: #FECA40; }
|
||
#selectableStudents .ui-selected { background: #F39814; color: white; }
|
||
#selectableStudents { list-style-type: none; margin: 0; padding: 0; }
|
||
#selectableStudents li { margin: 3px 3px 3px 0; padding: 1px; float: left; width: 80px; height: 95px; font-size: 1px; text-align: center; cursor:pointer; }
|
||
</style>
|
||
|
||
<script src="js/utils.js" type="text/javascript"></script>
|
||
... | ... | |
.click(function(){ getClassroomDetails(); });
|
||
|
||
$( "#selectable" ).selectable();
|
||
|
||
getLTSPServers();
|
||
});
|
||
|
||
... | ... | |
var result = $.parseJSON(data);
|
||
|
||
$.each(result.response, function(i, l){
|
||
$('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;"></div></li>');
|
||
$('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;"></div></li>');
|
||
});
|
||
|
||
getLTSPStatus();
|
||
... | ... | |
$('#selectable li .thumb-image').attr('src','img/turnOff.png');
|
||
$('#selectable li #userName').html('');
|
||
|
||
$.each(result.computers, function(i, l){
|
||
$.each(result.computers, function(i, l){
|
||
$('#selectable #selectable-'+l+' .thumb-image').attr('src','img/turnOn.png');
|
||
});
|
||
|
||
... | ... | |
|
||
$("#messageLoading").show();
|
||
|
||
$("#dialog-details").html("").css("display","none");;
|
||
//$("#dialog-details").html("").css("display","none");;
|
||
|
||
$.post('hosts','action=getClassroomDetails&classroom='+selected[0], function(data) {
|
||
var result = $.parseJSON(data);
|
||
|
||
if(result.students.length>0){
|
||
$.each(result.students, function(i, l){
|
||
$('#selectableStudents').append('<li class="ui-state-default" id="selectableStudents-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;"></div></li>');
|
||
});
|
||
}
|
||
|
||
x = ($(window).width()-500)/2;
|
||
y = ($(window).height()-500)/2;
|
||
$("#dialog-details").load("classroomServers/details.html", function() {
|
||
|
||
$("#messageLoading").hide();
|
||
$.post('hosts','action=getClassroomDetails&classroom='+selected[0], function(data) {
|
||
var result = $.parseJSON(data);
|
||
|
||
$("#dialog-details").dialog({
|
||
resizable: false,
|
||
position: top,
|
||
modal: true,
|
||
width: 500,
|
||
title: "Detalles del aula"
|
||
}).dialog('option', 'position', [x, y]);
|
||
if(result.students.length>0){
|
||
$.each(result.students, function(i, l){
|
||
$('#selectableStudents').append('<li class="ui-state-default" id="selectableStudents-'+l.username+'"><div id="pcName" style="font-size:11px;">'+l.host+'</div><img class="thumb-image" src="data:image/png;base64+'l.photo'+"/><div id="userName" style="font-size:11px;">'+l.username+'</div></li>');
|
||
});
|
||
}else{
|
||
//$("#dialog-details").html("No hay alumnos detectados").css("text-align","center").css("font-weight","bold");
|
||
}
|
||
|
||
x = ($(window).width()-500)/2;
|
||
y = ($(window).height()-500)/2;
|
||
|
||
$("#messageLoading").hide();
|
||
|
||
$("#dialog-details").dialog({
|
||
resizable: false,
|
||
position: top,
|
||
modal: true,
|
||
width: 500,
|
||
title: "Detalles del aula"
|
||
}).dialog('option', 'position', [x, y]);
|
||
});
|
||
});
|
||
}
|
||
}
|
||
... | ... | |
</tr>
|
||
</table>
|
||
|
||
<div id="dialog-details"><ol id="selectableStudents" style="width:470px;"></ol></div>
|
||
<div id="dialog-details"></div>
|
controlies/trunk/MainLoop.py | ||
---|---|---|
elif request.args['action'][0] == "getClassroomDetails":
|
||
|
||
import xmlrpclib
|
||
from Plugins.Users import Users
|
||
|
||
s = xmlrpclib.Server("http://" + request.args['classroom'][0] + ":8900");
|
||
|
||
return json.dumps({ "students" : s.Hosts() })
|
||
|
||
users = s.Users()
|
||
|
||
elif request.args['action'][0]=="delete":
|
||
h = Hosts(l,request.args['cn'][0],"","",request.args['group'][0],request.args['type'][0])
|
||
response = h.process(request.args['action'][0])
|
||
return json.dumps({"response" : response})
|
||
else: #add
|
||
response = []
|
||
for u in users:
|
||
user = u.split("@")
|
||
|
||
objUser = Users(l,"","","","",user[0],"","","","")
|
||
photo = objUser.getUserPhoto()
|
||
response.append({ 'username': user[0], 'host': user[1], 'photo': photo })
|
||
|
||
return json.dumps({ "classroom" : request.args['classroom'][0], "students" : response })
|
||
|
||
|
||
else:
|
||
if request.args ['type'][0] == 'thinclient':
|
||
ip = ""
|
||
else:
|
||
ip = request.args ['ip'][0]
|
||
|
||
h = Hosts(l,request.args['name'][0],ip,request.args['mac'][0],request.args['group'][0],request.args['type'][0])
|
||
|
||
response = h.process(request.args['action'][0])
|
||
return json.dumps({"response" : response})
|
||
|
Exportar a: Unified diff
Mostrando los alumnos de una clase