Ticket #33: usermanager-acct-mgr.patch

File usermanager-acct-mgr.patch, 2.5 KB (added by shanec@…, 5 years ago)

no account manager fix

  • plugins/usermanagerplugin/tracusermanager/account/admin_um.py

     
    1111from trac.web.chrome import add_stylesheet 
    1212from trac.util.translation import _ 
    1313 
    14 from acct_mgr.api import AccountManager 
     14try: 
     15    from acct_mgr.api import AccountManager 
     16except: 
     17    class AccountManager(): 
     18        """Base account manager when user manager is used along""" 
     19        def __init__(self, *args): 
     20            pass 
     21        def supports(self, option): 
     22            return False 
     23        def has_user(self, username): 
     24            return False 
     25        def set_password(self, username, password): 
     26            raise TracError("Password management not supported") 
     27        def delete_user(self, username, password): 
     28            raise TracError("User management not supported") 
    1529 
    1630from tracusermanager.admin import IUserManagerPanelProvider 
    1731 
  • plugins/usermanagerplugin/tracusermanager/templates/admin_um.html

     
    1818            </div> 
    1919 
    2020        <div id="um_active_users"> 
    21             <table class="listing" cellpading="0" cellspacing="0" py:for="is_trac_managed, users_iter in groupby([{'is_trac_managed_hack':False}]+sorted(user_manager.users,lambda x,y:account_manager.has_user(x.username)-account_manager.has_user(y.username))+[{'is_trac_managed_hack':True}], lambda nn: nn.is_trac_managed_hack is True or account_manager.has_user(nn.username) )" py:with="users=list(filter(lambda x:not isinstance(x, dict),users_iter))">     
     21            <table class="listing" cellpading="0" cellspacing="0" py:for="is_trac_managed, users_iter in groupby([{'is_trac_managed_hack':False}]+sorted(user_manager.users,lambda x,y:account_manager.has_user(x.username)-account_manager.has_user(y.username))+[{'is_trac_managed_hack':False}], lambda nn: nn.is_trac_managed_hack is True or account_manager.has_user(nn.username) )" py:with="users=list(filter(lambda x:not isinstance(x, dict),users_iter))">     
    2222                <thead> 
    2323                    <tr> 
    2424                        <th colspan="${len(user_manager.cells)+3}" >${is_trac_managed and _('External users') or _('Users')}</th>