Allow services to specify to use the charnames or auth username, also add IPB and SMF framework

This commit is contained in:
2011-03-03 10:45:55 +00:00
parent 45d4ee926a
commit 1670eee9eb
11 changed files with 179 additions and 3 deletions

View File

@@ -59,8 +59,11 @@ def service_add(request):
else:
acc.password = None
# Decode unicode and remove invalid characters
username = re.sub('[^a-zA-Z0-9_-]+', '', unicodedata.normalize('NFKD', acc.character.name).encode('ASCII', 'ignore'))
if acc.service.settings['use_auth_username']:
username = request.user.username
else:
# Decode unicode and remove invalid characters
username = re.sub('[^a-zA-Z0-9_-]+', '', unicodedata.normalize('NFKD', acc.character.name).encode('ASCII', 'ignore'))
if acc.service.api_class.check_user(username):
error = "Username already exists on the target service, please contact an admin."