mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -98,8 +98,17 @@ class LoginHandler(BaseHandler):
|
||||
pchardict['alliance'] = None
|
||||
else:
|
||||
pchardict = None
|
||||
|
||||
glist = []
|
||||
for g in u.groups.all():
|
||||
if u in g.groupinformation.admins.all():
|
||||
admin = True
|
||||
else:
|
||||
admin = False
|
||||
glist.append({'id': g.id, 'name': g.name, 'admin': admin})
|
||||
|
||||
return {'auth': 'ok', 'id': u.id, 'username': u.username,
|
||||
'email': u.email, 'groups': u.groups.all().values('id', 'name'),
|
||||
'email': u.email, 'groups': glist,
|
||||
'staff': u.is_staff, 'superuser': u.is_superuser, 'primarycharacter': pchardict}
|
||||
else:
|
||||
return {'auth': 'failed', 'error': 'password'}
|
||||
|
||||
@@ -134,6 +134,9 @@ def import_apikey_func(api_userid, api_key, user=None, force_cache=False, log=lo
|
||||
|
||||
if not account.check_access(getattr(settings, 'EVE_API_MINIMUM_KEYMASK', 59638024)):
|
||||
account.api_status = API_STATUS_INVALID_PERMISSIONS
|
||||
else:
|
||||
# If its a corp key, and we've not errored so far, assume is OK.
|
||||
account.api_status = API_STATUS_OK
|
||||
|
||||
# Remove deleted or traded characters
|
||||
newcharlist = [int(char['characterID']) for char in doc['result']['key']['characters']]
|
||||
|
||||
@@ -16,10 +16,10 @@ class POSTrackerService(BaseDBService):
|
||||
'use_auth_username': False,
|
||||
'database_name': 'dreddit_pos' }
|
||||
|
||||
SQL_ADD_USER = r"INSERT INTO pos3_user (eve_id, name, pass, email, access, corp, alliance_id) VALUES (%s, %s, %s, %s, 1, %s, %s)"
|
||||
SQL_DIS_USER = r"UPDATE pos3_user SET pass = '', away = 1 WHERE name = %s"
|
||||
SQL_ADD_USER = r"INSERT INTO pos3_user (eve_id, name, pass, email, access, corp, alliance_id) VALUES (%s, %s, %s, %s, 3, %s, %s)"
|
||||
SQL_DIS_USER = r"UPDATE pos3_user SET access = 0, pass = '', away = 1 WHERE name = %s"
|
||||
SQL_DEL_USER = r"DELETE FROM pos3_user WHERE name = %s"
|
||||
SQL_ENABLE_USER = r"UPDATE pos3_user SET pass = %s, away = 0 WHERE name = %s"
|
||||
SQL_ENABLE_USER = r"UPDATE pos3_user SET access = 3, pass = %s, away = 0 WHERE name = %s"
|
||||
SQL_CHECK_USER = r"SELECT name from pos3_user WHERE name = %s"
|
||||
|
||||
def _gen_salt(self):
|
||||
|
||||
Reference in New Issue
Block a user