예제 #1
0
 def sign_out(self, u):
     """
     Call this with a username to sign out
     a book.
     """
     if members.registered(u, terms.current()):
         s = Signout(username=u, book=self, outdate=datetime.today(), indate=None)
예제 #2
0
 def check(self):
     self.state['terms'] = terms.interval(terms.current(), self.count.value())
     
     if len(self.state['terms']) == 0:
         self.focus_widget(self.count)
         set_status("Registering for zero terms?")
         return True
     clear_status()
예제 #3
0
 def main(self, args):
     mlist = {}
     if len(args) == 1:
         mlist = members.list_term(args[0])
     else:
         mlist = members.list_term(terms.current())
     dns = mlist.keys()
     dns.sort()
     for dn in dns:
         member = mlist[dn]
         print "%s %s %s" % (member["uid"][0].ljust(12), member["cn"][0].ljust(30), member.get("program", [""])[0])
예제 #4
0
 def main(self, args):
   if len(args) != 1:
       print self.help
       return
   delta = int(args[0])
   mlist = members.list_all()
   for member in mlist.values():
       term = "f0000"
       term = reduce(max_term, member.get("term", []), term)
       term = reduce(max_term, member.get("nonMemberTerm", []), term)
       if terms.delta(term, terms.current()) >= delta:
           print "%s %s" % (member['uid'][0].ljust(12), term)
예제 #5
0
 def check(self):
     self.state['user'] = self.user.get_edit_text()
     if not members.registered(self.state['user'], terms.current()):
         set_status("User not registered for this term!")
         return True
     return False
예제 #6
0
def expired_accounts():
    members = ldapi.search(ld, cfg['ldap_users_base'],
        '(&(objectClass=member)(!(|(term=%s)(nonMemberTerm=%s))))' %
        (terms.current(), terms.current()))
    return dict([(member[0], member[1]) for member in members])