Univention Bugzilla – Attachment 5335 Details for
Bug 32035
computerroom/update does not send "isTeacher" when another user logs in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
Bug32035.patch (text/plain), 3.14 KB, created by
Florian Best
on 2013-07-23 11:08:27 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2013-07-23 11:08:27 CEST
Size:
3.14 KB
patch
obsolete
>Index: umc/python/computerroom/italc2.py >=================================================================== >--- umc/python/computerroom/italc2.py (Revision 42658) >+++ umc/python/computerroom/italc2.py (Arbeitskopie) >@@ -347,6 +347,25 @@ > notifier.timer_remove( self._timer ) > self._timer = None > >+ @property >+ def dict(self): >+ item = { 'id' : self.name, >+ 'name' : self.name, >+ 'user' : self.user.current, >+ 'teacher' : self.isTeacher, >+ 'connection' : self.state.current, >+ 'description' : self.description, >+ 'ip' : self.ipAddress, >+ 'mac' : self.macAddress, >+ 'objectType': self.objectType } >+ item.update(self.flagsDict) >+ return item >+ >+ @property >+ def hasChanged(self): >+ states = (self.state, self.flags, self.user, self.teacher) >+ return any(state.hasChanged for state in states) >+ > # UDM properties > @property > def name( self ): >Index: umc/python/computerroom/__init__.py >=================================================================== >--- umc/python/computerroom/__init__.py (Revision 42658) >+++ umc/python/computerroom/__init__.py (Arbeitskopie) >@@ -363,19 +363,7 @@ > if request.options.get('reload', False): > self._italc.room = self._italc.room # believe me that makes sense :) > >- result = [] >- for computer in self._italc.values(): >- item = { 'id' : computer.name, >- 'name' : computer.name, >- 'user' : computer.user.current, >- 'teacher' : computer.isTeacher, >- 'connection' : computer.state.current, >- 'description' : computer.description, >- 'ip' : computer.ipAddress, >- 'mac' : computer.macAddress, >- 'objectType': computer.objectType } >- item.update(computer.flagsDict) >- result.append(item) >+ result = [computer.dict for computer in self._italc.values()] > > MODULE.info('computerroom.query: result: %s' % str(result)) > self.finished(request.id, result) >@@ -394,24 +382,7 @@ > if not self._italc.school or not self._italc.room: > raise UMC_CommandError('no room selected') > >- computers = [] >- for computer in self._italc.values(): >- item = dict(id = computer.name) >- modified = False >- if computer.state.hasChanged: >- item['connection'] = str(computer.state.current) >- modified = True >- if computer.flags.hasChanged: >- item.update(computer.flagsDict) >- modified = True >- if computer.user.hasChanged: >- item['user'] = str(computer.user.current) >- modified = True >- if computer.teacher.hasChanged: >- item['teacher'] = computer.teacher.current >- modified = True >- if modified: >- computers.append(item) >+ computers = [computer.dict for computer in self._italc.values() if computer.hasChanged] > result = { 'computers' : computers } > > userDN = _getRoomOwner(self._italc.roomDN) >@@ -511,9 +482,9 @@ > self.finished(request.id, 'VNC is disabled') > > try: >- template = open('/usr/share/ucs-school-umc-computerroom/ultravnc.vnc') >- content = template.read() >- except: >+ with open('/usr/share/ucs-school-umc-computerroom/ultravnc.vnc') as fd: >+ content = fd.read() >+ except (IOError, OSError): > raise UMC_CommandError('VNC template file does not exists') > > port = ucr.get('ucsschool/umc/computerroom/vnc/port', '11100')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32035
: 5335