Changeset 966


Ignore:
Timestamp:
Mar 29, 2016, 3:06:14 PM (3 years ago)
Author:
mabarracus
Message:

Patched to hide teacher clients when one teacher isn't promoted

Location:
epoptes/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • epoptes/trunk/fuentes/debian/changelog

    r298 r966  
     1epoptes (0.5.9) xenial; urgency=medium
     2
     3  *  Patched to hide teacher clients when one teacher isn't promoted
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Tue, 29 Mar 2016 15:05:09 +0200
     6
    17epoptes (0.5.8) xenial; urgency=medium
    28
  • epoptes/trunk/fuentes/epoptes/ui/gui.py

    r295 r966  
    665665        self.set_move_group_sensitivity()
    666666
     667    def searchInGroups(self,yo,cliente):
     668        if (yo == cliente):
     669            return 1
     670        import subprocess as sp
     671        p1 = sp.Popen(["id",yo],stdout=sp.PIPE)
     672        p2 = sp.Popen(["id",cliente],stdout=sp.PIPE)
     673        out1,err1 = p1.communicate()
     674        out2,err2 = p2.communicate()
     675        if (out2.find('teachers') == -1):
     676            #if he is student must be showed
     677            return 1   
     678        else:
     679            #he's a teacher
     680            if (out1.find('admins') == -1):
     681                #if im not promoted teacher other teachers must be hidden
     682                return 0
     683            else:
     684                #if im a promoted teacher other teachers must be displayed
     685                return 1
     686       
    667687
    668688    def addToIconView(self, client):
     
    676696        if client.users:
    677697            for hsession, user in client.users.iteritems():
    678                 self.cstore.append([self.calculateLabel(client, user[label]), self.imagetypes[client.type], client, hsession])
    679                 self.askScreenshot(hsession, True)
     698                if self.searchInGroups(self.n4d_user,user['uname']):
     699                    self.cstore.append([self.calculateLabel(client, user[label]), self.imagetypes[client.type], client, hsession])
     700                    self.askScreenshot(hsession, True)
    680701        else:
    681702            self.cstore.append([self.calculateLabel(client), self.imagetypes[client.type], client, ''])
Note: See TracChangeset for help on using the changeset viewer.