本文整理汇总了Python中MaKaC.authentication.AuthenticatorMgr.removeIdentity方法的典型用法代码示例。如果您正苦于以下问题:Python AuthenticatorMgr.removeIdentity方法的具体用法?Python AuthenticatorMgr.removeIdentity怎么用?Python AuthenticatorMgr.removeIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.authentication.AuthenticatorMgr
的用法示例。
在下文中一共展示了AuthenticatorMgr.removeIdentity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process
# 需要导入模块: from MaKaC.authentication import AuthenticatorMgr [as 别名]
# 或者: from MaKaC.authentication.AuthenticatorMgr import removeIdentity [as 别名]
def _process( self ):
am = AuthenticatorMgr()
for id in self._identityList:
identity = am.getIdentityById(id)
am.removeIdentity(identity)
self._avatar.removeIdentity(identity)
self._redirect( urlHandlers.UHUserDetails.getURL( self._avatar ) )
示例2: _process
# 需要导入模块: from MaKaC.authentication import AuthenticatorMgr [as 别名]
# 或者: from MaKaC.authentication.AuthenticatorMgr import removeIdentity [as 别名]
def _process( self ):
authManager = AuthenticatorMgr()
for i in self._identityList:
identity = authManager.getIdentityById(i)
if len(identity.getUser().getIdentityList()) > 1:
authManager.removeIdentity(identity)
self._avatar.removeIdentity(identity)
self._redirect( urlHandlers.UHUserDetails.getURL( self._avatar ) )
示例3: print
# 需要导入模块: from MaKaC.authentication import AuthenticatorMgr [as 别名]
# 或者: from MaKaC.authentication.AuthenticatorMgr import removeIdentity [as 别名]
from MaKaC.authentication import AuthenticatorMgr
from MaKaC.authentication.LocalAuthentication import LocalIdentity
print('This script will remove all local identities from users.')
print('This will remove passwords from the database and prevent them from')
print('logging in locally (so you need e.g. NICE or LDAP authentication)')
print
if raw_input('Do you want to continue? [yes|NO]: ').lower() != 'yes':
print 'Cancelled.'
sys.exit(0)
i = 0
dbi = DBMgr.getInstance()
dbi.startRequest()
ah = AvatarHolder()
am = AuthenticatorMgr()
for aid, avatar in ah._getIdx().iteritems():
for identity in avatar.getIdentityList():
if isinstance(identity, LocalIdentity):
print('Removing LocalIdentity(%s, %s) from %s' %
(identity.getLogin(), len(identity.password) * '*',
avatar.getFullName()))
am.removeIdentity(identity)
avatar.removeIdentity(identity)
if i % 100 == 99:
dbi.commit()
i += 1
DBMgr.getInstance().endRequest()