mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 20:40:17 +02:00
Added IPBoard support
This commit is contained in:
parent
c131798e24
commit
1ed41ae043
@ -180,10 +180,12 @@ DEFAULT_BLUE_GROUP = 'BlueMember'
|
|||||||
# ENABLE_ALLIANCE_FORUM - Enable forum support in the auth for alliance members
|
# ENABLE_ALLIANCE_FORUM - Enable forum support in the auth for alliance members
|
||||||
# ENABLE_ALLIANCE_JABBER - Enable jabber support in the auth for alliance members
|
# ENABLE_ALLIANCE_JABBER - Enable jabber support in the auth for alliance members
|
||||||
# ENABLE_ALLIANCE_MUMBLE - Enable mumble support in the auth for alliance members
|
# ENABLE_ALLIANCE_MUMBLE - Enable mumble support in the auth for alliance members
|
||||||
|
# ENABLE_ALLIANCE_IPBOARD - Enable IPBoard forum support in the auth for alliance members
|
||||||
#########################
|
#########################
|
||||||
ENABLE_ALLIANCE_FORUM = True
|
ENABLE_ALLIANCE_FORUM = True
|
||||||
ENABLE_ALLIANCE_JABBER = True
|
ENABLE_ALLIANCE_JABBER = True
|
||||||
ENABLE_ALLIANCE_MUMBLE = True
|
ENABLE_ALLIANCE_MUMBLE = True
|
||||||
|
ENABLE_ALLIANCE_IPBOARD = False
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Blue service Setup
|
# Blue service Setup
|
||||||
@ -191,10 +193,12 @@ ENABLE_ALLIANCE_MUMBLE = True
|
|||||||
# ENABLE_BLUE_FORUM - Enable forum support in the auth for blues
|
# ENABLE_BLUE_FORUM - Enable forum support in the auth for blues
|
||||||
# ENABLE_BLUE_JABBER - Enable jabber support in the auth for blues
|
# ENABLE_BLUE_JABBER - Enable jabber support in the auth for blues
|
||||||
# ENABLE_BLUE_MUMBLE - Enable mumble support in the auth for blues
|
# ENABLE_BLUE_MUMBLE - Enable mumble support in the auth for blues
|
||||||
|
# ENABLE_BLUE_IPBOARD - Enable IPBoard forum support in the auth for blues
|
||||||
#####################
|
#####################
|
||||||
ENABLE_BLUE_FORUM = False
|
ENABLE_BLUE_FORUM = False
|
||||||
ENABLE_BLUE_JABBER = False
|
ENABLE_BLUE_JABBER = False
|
||||||
ENABLE_BLUE_MUMBLE = True
|
ENABLE_BLUE_MUMBLE = True
|
||||||
|
ENABLE_BLUE_IPBOARD = False
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Alliance Configuration
|
# Alliance Configuration
|
||||||
@ -215,8 +219,14 @@ ALLIANCE_BLUE_STANDING = 5.0
|
|||||||
# Forum Configuration
|
# Forum Configuration
|
||||||
#####################
|
#####################
|
||||||
# FORUM_URL - Forum url location
|
# FORUM_URL - Forum url location
|
||||||
|
# IPBOARD_ENDPOINT - Api endpoint if using ipboard
|
||||||
|
# IPBOARD_APIKEY - Api key to interact with ipboard
|
||||||
|
# IPBOARD_APIMODULE - Module for alliance auth *leave alone*
|
||||||
#####################
|
#####################
|
||||||
FORUM_URL = "http://someaddress.com"
|
FORUM_URL = "http://someaddress.com"
|
||||||
|
IPBOARD_ENDPOINT = 'someaddress.com/interface/board/index.php'
|
||||||
|
IPBOARD_APIKEY = 'somekeyhere'
|
||||||
|
IPBOARD_APIMODULE = 'aa'
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# Jabber Configuration
|
# Jabber Configuration
|
||||||
|
@ -86,12 +86,6 @@ urlpatterns = patterns('',
|
|||||||
url(r'^reset_forum_password/$', 'services.views.reset_forum_password',
|
url(r'^reset_forum_password/$', 'services.views.reset_forum_password',
|
||||||
name='auth_reset_forum_password'),
|
name='auth_reset_forum_password'),
|
||||||
|
|
||||||
url(r'^activate_blue_forum/$', 'services.views.activate_blue_forum',
|
|
||||||
name='auth_activate_blue_forum'),
|
|
||||||
url(r'^deactivate_blue_forum/$', 'services.views.deactivate_blue_forum',
|
|
||||||
name='auth_deactivate_blue_forum'),
|
|
||||||
url(r'^reset_blue_forum_password/$', 'services.views.reset_blue_forum_password',
|
|
||||||
name='auth_reset_blue_forum_password'),
|
|
||||||
|
|
||||||
# Jabber Service Control
|
# Jabber Service Control
|
||||||
url(r'^activate_jabber/$', 'services.views.activate_jabber', name='auth_activate_jabber'),
|
url(r'^activate_jabber/$', 'services.views.activate_jabber', name='auth_activate_jabber'),
|
||||||
@ -99,25 +93,16 @@ urlpatterns = patterns('',
|
|||||||
url(r'^reset_jabber_password/$', 'services.views.reset_jabber_password',
|
url(r'^reset_jabber_password/$', 'services.views.reset_jabber_password',
|
||||||
name='auth_reset_jabber_password'),
|
name='auth_reset_jabber_password'),
|
||||||
|
|
||||||
url(r'^activate_blue_jabber/$', 'services.views.activate_blue_jabber',
|
|
||||||
name='auth_activate_blue_jabber'),
|
|
||||||
url(r'^deactivate_blue_jabber/$', 'services.views.deactivate_blue_jabber',
|
|
||||||
name='auth_deactivate_blue_jabber'),
|
|
||||||
url(r'^reset_blue_jabber_password/$', 'services.views.reset_blue_jabber_password',
|
|
||||||
name='auth_reset_blue_jabber_password'),
|
|
||||||
|
|
||||||
# Mumble service control
|
# Mumble service control
|
||||||
url(r'^activate_mumble/$', 'services.views.activate_mumble', name='auth_activate_mumble'),
|
url(r'^activate_mumble/$', 'services.views.activate_mumble', name='auth_activate_mumble'),
|
||||||
url(r'^deactivate_mumble/$', 'services.views.deactivate_mumble', name='auth_deactivate_mumble'),
|
url(r'^deactivate_mumble/$', 'services.views.deactivate_mumble', name='auth_deactivate_mumble'),
|
||||||
url(r'^reset_mumble_password/$', 'services.views.reset_mumble_password',
|
url(r'^reset_mumble_password/$', 'services.views.reset_mumble_password',
|
||||||
name='auth_reset_mumble_password'),
|
name='auth_reset_mumble_password'),
|
||||||
|
|
||||||
url(r'^activate_blue_mumble/$', 'services.views.activate_blue_mumble',
|
# Ipboard service control
|
||||||
name='auth_activate_blue_mumble'),
|
url(r'^activate_ipboard/$', 'services.views.activate_ipboard_forum', name='auth_activate_ipboard'),
|
||||||
url(r'^deactivate_blue_mumble/$', 'services.views.deactivate_blue_mumble',
|
url(r'^deactivate_ipboard/$', 'services.views.deactivate_ipboard_forum', name='auth_deactivate_ipboard'),
|
||||||
name='auth_deactivate_blue_mumble'),
|
url(r'^reset_ipboard_password/$', 'services.views.reset_ipboard_password', name='auth_reset_ipboard_password'),
|
||||||
url(r'^reset_blue_mumble_password/$', 'services.views.reset_blue_mumble_password',
|
|
||||||
name='auth_reset_blue_mumble_password'),
|
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
url(r'^tool/fleet_formatter_tool/$', 'services.views.fleet_formatter_view',
|
url(r'^tool/fleet_formatter_tool/$', 'services.views.fleet_formatter_view',
|
||||||
|
8
authentication/managers.py
Normal file → Executable file
8
authentication/managers.py
Normal file → Executable file
@ -57,6 +57,14 @@ class AuthServicesInfoManager:
|
|||||||
authserviceinfo.mumble_password = password
|
authserviceinfo.mumble_password = password
|
||||||
authserviceinfo.save(update_fields=['mumble_username', 'mumble_password'])
|
authserviceinfo.save(update_fields=['mumble_username', 'mumble_password'])
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_user_ipboard_info(username, password, user):
|
||||||
|
if User.objects.filter(username=user.username).exists():
|
||||||
|
authserviceinfo = AuthServicesInfoManager.__get_or_create(user)
|
||||||
|
authserviceinfo.ipboard_username = username
|
||||||
|
authserviceinfo.ipboard_password = password
|
||||||
|
authserviceinfo.save(update_fields=['ipboard_username', 'ipboard_password'])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_is_blue(is_blue, user):
|
def update_is_blue(is_blue, user):
|
||||||
if User.objects.filter(username=user.username).exists():
|
if User.objects.filter(username=user.username).exists():
|
||||||
|
2
authentication/models.py
Normal file → Executable file
2
authentication/models.py
Normal file → Executable file
@ -3,6 +3,8 @@ from django.contrib.auth.models import User
|
|||||||
|
|
||||||
|
|
||||||
class AuthServicesInfo(models.Model):
|
class AuthServicesInfo(models.Model):
|
||||||
|
ipboard_username = models.CharField(max_length=254, default="")
|
||||||
|
ipboard_password = models.CharField(max_length=254, default="")
|
||||||
forum_username = models.CharField(max_length=254, default="")
|
forum_username = models.CharField(max_length=254, default="")
|
||||||
forum_password = models.CharField(max_length=254, default="")
|
forum_password = models.CharField(max_length=254, default="")
|
||||||
jabber_username = models.CharField(max_length=254, default="")
|
jabber_username = models.CharField(max_length=254, default="")
|
||||||
|
26
celerytask/tasks.py
Normal file → Executable file
26
celerytask/tasks.py
Normal file → Executable file
@ -4,9 +4,10 @@ from django.contrib.auth.models import User
|
|||||||
|
|
||||||
from models import SyncGroupCache
|
from models import SyncGroupCache
|
||||||
from celery.task.schedules import crontab
|
from celery.task.schedules import crontab
|
||||||
from services.managers.jabber_manager import JabberManager
|
from services.managers.openfire_manager import OpenfireManager
|
||||||
from services.managers.mumble_manager import MumbleManager
|
from services.managers.mumble_manager import MumbleManager
|
||||||
from services.managers.forum_manager import ForumManager
|
from services.managers.phpbb3_manager import Phpbb3Manager
|
||||||
|
from services.managers.ipboard_manager import IPBoardManager
|
||||||
from authentication.models import AuthServicesInfo
|
from authentication.models import AuthServicesInfo
|
||||||
from eveonline.managers import EveManager
|
from eveonline.managers import EveManager
|
||||||
from services.managers.eve_api_manager import EveApiManager
|
from services.managers.eve_api_manager import EveApiManager
|
||||||
@ -23,7 +24,7 @@ def update_jabber_groups(user):
|
|||||||
if len(groups) == 0:
|
if len(groups) == 0:
|
||||||
groups.append('empty')
|
groups.append('empty')
|
||||||
|
|
||||||
JabberManager.update_user_groups(authserviceinfo.jabber_username, authserviceinfo.jabber_password, groups)
|
OpenfireManager.update_user_groups(authserviceinfo.jabber_username, authserviceinfo.jabber_password, groups)
|
||||||
|
|
||||||
|
|
||||||
def update_mumble_groups(user):
|
def update_mumble_groups(user):
|
||||||
@ -49,7 +50,20 @@ def update_forum_groups(user):
|
|||||||
if len(groups) == 0:
|
if len(groups) == 0:
|
||||||
groups.append('empty')
|
groups.append('empty')
|
||||||
|
|
||||||
ForumManager.update_groups(authserviceinfo.forum_username, groups)
|
Phpbb3Manager.update_groups(authserviceinfo.forum_username, groups)
|
||||||
|
|
||||||
|
|
||||||
|
def update_ipboard_groups(user):
|
||||||
|
syncgroups = SyncGroupCache.objects.filter(user=user)
|
||||||
|
authserviceinfo = AuthServicesInfo.objects.get(user=user)
|
||||||
|
groups = []
|
||||||
|
for syncgroup in syncgroups:
|
||||||
|
groups.append(str(syncgroup.groupname))
|
||||||
|
|
||||||
|
if len(groups) == 0:
|
||||||
|
groups.append('empty')
|
||||||
|
|
||||||
|
IPBoardManager.update_groups(authserviceinfo.ipboard_username, groups)
|
||||||
|
|
||||||
|
|
||||||
def add_to_databases(user, groups, syncgroups):
|
def add_to_databases(user, groups, syncgroups):
|
||||||
@ -79,6 +93,8 @@ def add_to_databases(user, groups, syncgroups):
|
|||||||
update_mumble_groups(user)
|
update_mumble_groups(user)
|
||||||
if authserviceinfo.forum_username != "":
|
if authserviceinfo.forum_username != "":
|
||||||
update_forum_groups(user)
|
update_forum_groups(user)
|
||||||
|
if authserviceinfo.ipboard_username != "":
|
||||||
|
update_ipboard_groups(user)
|
||||||
|
|
||||||
|
|
||||||
def remove_from_databases(user, groups, syncgroups):
|
def remove_from_databases(user, groups, syncgroups):
|
||||||
@ -104,6 +120,8 @@ def remove_from_databases(user, groups, syncgroups):
|
|||||||
update_mumble_groups(user)
|
update_mumble_groups(user)
|
||||||
if authserviceinfo.forum_username != "":
|
if authserviceinfo.forum_username != "":
|
||||||
update_forum_groups(user)
|
update_forum_groups(user)
|
||||||
|
if authserviceinfo.ipboard_username != "":
|
||||||
|
update_ipboard_groups(user)
|
||||||
|
|
||||||
|
|
||||||
# Run every minute
|
# Run every minute
|
||||||
|
125
services/managers/ipboard_manager.py
Executable file
125
services/managers/ipboard_manager.py
Executable file
@ -0,0 +1,125 @@
|
|||||||
|
import os
|
||||||
|
import xmlrpclib
|
||||||
|
from hashlib import md5
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
class IPBoardManager:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def __santatize_username(username):
|
||||||
|
sanatized = username.replace(" ", "_")
|
||||||
|
sanatized = sanatized.replace("'", "")
|
||||||
|
return sanatized.lower()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def __generate_random_pass():
|
||||||
|
return os.urandom(8).encode('hex')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def exec_xmlrpc(func, **kwargs):
|
||||||
|
""" Send a XMLRPC request """
|
||||||
|
|
||||||
|
server = xmlrpclib.Server(settings.IPBOARD_ENDPOINT, verbose=False)
|
||||||
|
params = {}
|
||||||
|
for i in kwargs:
|
||||||
|
params[i] = kwargs[i]
|
||||||
|
params['api_key'] = settings.IPBOARD_APIKEY
|
||||||
|
params['api_module'] = settings.IPBOARD_APIMODULE
|
||||||
|
print params
|
||||||
|
return getattr(server, func)(params)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_user(username, email):
|
||||||
|
""" Add user to service """
|
||||||
|
sanatized = str(IPBoardManager.__santatize_username(username))
|
||||||
|
plain_password = IPBoardManager.__generate_random_pass()
|
||||||
|
password = md5(plain_password).hexdigest()
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('createUser', username=sanatized, email=str(email), display_name=sanatized, md5_passwordHash=password)
|
||||||
|
return sanatized, plain_password
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def delete_user(username):
|
||||||
|
""" Delete user """
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('deleteUser', username=username)
|
||||||
|
return username
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def disable_user(username):
|
||||||
|
""" Disable user """
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('disableUser', username=username)
|
||||||
|
return username
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_user(username, email, password):
|
||||||
|
""" Add user to service """
|
||||||
|
password = md5(password).hexdigest()
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('updateUser', username=username, email=email, md5_passwordHash=password)
|
||||||
|
return username
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_all_groups():
|
||||||
|
groups = []
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('getAllGroups')
|
||||||
|
for group in ret:
|
||||||
|
groups.append(group["g_title"])
|
||||||
|
return groups
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_user_groups(username):
|
||||||
|
groups = []
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('getUserGroups', username=username)
|
||||||
|
for group in ret:
|
||||||
|
groups.append(group["g_title"])
|
||||||
|
return groups
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_group(group):
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('addGroup', group=group)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_user_to_group(username, group):
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('addUserToGroup', username=username, group=group)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def remove_user_from_group(username, group):
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('removeUserFromGroup', username=username, group=group)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def help_me():
|
||||||
|
"Random help me"
|
||||||
|
ret = IPBoardManager.exec_xmlrpc('helpMe')
|
||||||
|
return ret
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_groups(username, groups):
|
||||||
|
|
||||||
|
forum_groups = IPBoardManager.get_all_groups()
|
||||||
|
user_groups = set(IPBoardManager.get_user_groups(username))
|
||||||
|
act_groups = set([g.replace(' ', '-') for g in groups])
|
||||||
|
addgroups = act_groups - user_groups
|
||||||
|
remgroups = user_groups - act_groups
|
||||||
|
|
||||||
|
print addgroups
|
||||||
|
print remgroups
|
||||||
|
for g in addgroups:
|
||||||
|
if not g in forum_groups:
|
||||||
|
IPBoardManager.add_group(g)
|
||||||
|
print username
|
||||||
|
print g
|
||||||
|
IPBoardManager.add_user_to_group(username, g)
|
||||||
|
|
||||||
|
for g in remgroups:
|
||||||
|
IPBoardManager.remove_user_from_group(username, g)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_user_password(username, email):
|
||||||
|
plain_password = IPBoardManager.__generate_random_pass()
|
||||||
|
IPBoardManager.update_user(username, email, plain_password)
|
||||||
|
return plain_password
|
8
services/managers/jabber_manager.py → services/managers/openfire_manager.py
Normal file → Executable file
8
services/managers/jabber_manager.py → services/managers/openfire_manager.py
Normal file → Executable file
@ -11,7 +11,7 @@ from openfire import UserService
|
|||||||
from authentication.managers import AuthServicesInfoManager
|
from authentication.managers import AuthServicesInfoManager
|
||||||
|
|
||||||
|
|
||||||
class JabberManager:
|
class OpenfireManager:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ class JabberManager:
|
|||||||
def add_user(username):
|
def add_user(username):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sanatized_username = JabberManager.__santatize_username(username)
|
sanatized_username = OpenfireManager.__santatize_username(username)
|
||||||
password = JabberManager.__generate_random_pass()
|
password = OpenfireManager.__generate_random_pass()
|
||||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||||
api.add_user(sanatized_username, password)
|
api.add_user(sanatized_username, password)
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class JabberManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def update_user_pass(username):
|
def update_user_pass(username):
|
||||||
try:
|
try:
|
||||||
password = JabberManager.__generate_random_pass()
|
password = OpenfireManager.__generate_random_pass()
|
||||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||||
api.update_user(username, password)
|
api.update_user(username, password)
|
||||||
return password
|
return password
|
74
services/managers/forum_manager.py → services/managers/phpbb3_manager.py
Normal file → Executable file
74
services/managers/forum_manager.py → services/managers/phpbb3_manager.py
Normal file → Executable file
@ -6,7 +6,7 @@ from passlib.apps import phpbb3_context
|
|||||||
from django.db import connections
|
from django.db import connections
|
||||||
|
|
||||||
|
|
||||||
class ForumManager:
|
class Phpbb3Manager:
|
||||||
SQL_ADD_USER = r"INSERT INTO phpbb_users (username, username_clean, " \
|
SQL_ADD_USER = r"INSERT INTO phpbb_users (username, username_clean, " \
|
||||||
r"user_password, user_email, group_id, user_regdate, user_permissions, " \
|
r"user_password, user_email, group_id, user_regdate, user_permissions, " \
|
||||||
r"user_sig, user_occ, user_interests) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
|
r"user_sig, user_occ, user_interests) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
|
||||||
@ -52,7 +52,7 @@ class ForumManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_group_id(groupname):
|
def __get_group_id(groupname):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_GET_GROUP_ID, [groupname])
|
cursor.execute(Phpbb3Manager.SQL_GET_GROUP_ID, [groupname])
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
|
|
||||||
return row[0]
|
return row[0]
|
||||||
@ -60,14 +60,14 @@ class ForumManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_user_id(username):
|
def __get_user_id(username):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_USER_ID_FROM_USERNAME, [username])
|
cursor.execute(Phpbb3Manager.SQL_USER_ID_FROM_USERNAME, [username])
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
return row[0]
|
return row[0]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_all_groups():
|
def __get_all_groups():
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_GET_ALL_GROUPS)
|
cursor.execute(Phpbb3Manager.SQL_GET_ALL_GROUPS)
|
||||||
rows = cursor.fetchall()
|
rows = cursor.fetchall()
|
||||||
out = {}
|
out = {}
|
||||||
for row in rows:
|
for row in rows:
|
||||||
@ -78,7 +78,7 @@ class ForumManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_user_groups(userid):
|
def __get_user_groups(userid):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_GET_USER_GROUPS, [userid])
|
cursor.execute(Phpbb3Manager.SQL_GET_USER_GROUPS, [userid])
|
||||||
return [row[0] for row in cursor.fetchall()]
|
return [row[0] for row in cursor.fetchall()]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -90,37 +90,37 @@ class ForumManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __create_group(groupname):
|
def __create_group(groupname):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_ADD_GROUP, [groupname, groupname])
|
cursor.execute(Phpbb3Manager.SQL_ADD_GROUP, [groupname, groupname])
|
||||||
return ForumManager.__get_group_id(groupname)
|
return Phpbb3Manager.__get_group_id(groupname)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __add_user_to_group(userid, groupid):
|
def __add_user_to_group(userid, groupid):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_ADD_USER_GROUP, [groupid, userid, 0])
|
cursor.execute(Phpbb3Manager.SQL_ADD_USER_GROUP, [groupid, userid, 0])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __remove_user_from_group(userid, groupid):
|
def __remove_user_from_group(userid, groupid):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(ForumManager.SQL_REMOVE_USER_GROUP, [userid, groupid])
|
cursor.execute(Phpbb3Manager.SQL_REMOVE_USER_GROUP, [userid, groupid])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_user(username, email, groups):
|
def add_user(username, email, groups):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
|
|
||||||
username_clean = ForumManager.__santatize_username(username)
|
username_clean = Phpbb3Manager.__santatize_username(username)
|
||||||
password = ForumManager.__generate_random_pass()
|
password = Phpbb3Manager.__generate_random_pass()
|
||||||
pwhash = ForumManager.__gen_hash(password)
|
pwhash = Phpbb3Manager.__gen_hash(password)
|
||||||
|
|
||||||
# check if the username was simply revoked
|
# check if the username was simply revoked
|
||||||
if ForumManager.check_user(username_clean):
|
if Phpbb3Manager.check_user(username_clean):
|
||||||
ForumManager.__update_user_info(username_clean, email, pwhash)
|
Phpbb3Manager.__update_user_info(username_clean, email, pwhash)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
cursor.execute(ForumManager.SQL_ADD_USER, [username_clean, username_clean, pwhash,
|
cursor.execute(Phpbb3Manager.SQL_ADD_USER, [username_clean, username_clean, pwhash,
|
||||||
email, 2, ForumManager.__get_current_utc_date(),
|
email, 2, Phpbb3Manager.__get_current_utc_date(),
|
||||||
"", "", "", ""])
|
"", "", "", ""])
|
||||||
ForumManager.update_groups(username_clean, groups)
|
Phpbb3Manager.update_groups(username_clean, groups)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -130,11 +130,11 @@ class ForumManager:
|
|||||||
def disable_user(username):
|
def disable_user(username):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
|
|
||||||
password = ForumManager.__gen_hash(ForumManager.__generate_random_pass())
|
password = Phpbb3Manager.__gen_hash(Phpbb3Manager.__generate_random_pass())
|
||||||
revoke_email = "revoked@the99eve.com"
|
revoke_email = "revoked@the99eve.com"
|
||||||
try:
|
try:
|
||||||
pwhash = ForumManager.__gen_hash(password)
|
pwhash = Phpbb3Manager.__gen_hash(password)
|
||||||
cursor.execute(ForumManager.SQL_DIS_USER, [revoke_email, pwhash, username])
|
cursor.execute(Phpbb3Manager.SQL_DIS_USER, [revoke_email, pwhash, username])
|
||||||
return True
|
return True
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
print e
|
print e
|
||||||
@ -144,16 +144,16 @@ class ForumManager:
|
|||||||
def delete_user(username):
|
def delete_user(username):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
|
|
||||||
if ForumManager.check_user(username):
|
if Phpbb3Manager.check_user(username):
|
||||||
cursor.execute(ForumManager.SQL_DEL_USER, [username])
|
cursor.execute(Phpbb3Manager.SQL_DEL_USER, [username])
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_groups(username, groups):
|
def update_groups(username, groups):
|
||||||
userid = ForumManager.__get_user_id(username)
|
userid = Phpbb3Manager.__get_user_id(username)
|
||||||
forum_groups = ForumManager.__get_all_groups()
|
forum_groups = Phpbb3Manager.__get_all_groups()
|
||||||
user_groups = set(ForumManager.__get_user_groups(userid))
|
user_groups = set(Phpbb3Manager.__get_user_groups(userid))
|
||||||
act_groups = set([g.replace(' ', '-') for g in groups])
|
act_groups = set([g.replace(' ', '-') for g in groups])
|
||||||
addgroups = act_groups - user_groups
|
addgroups = act_groups - user_groups
|
||||||
remgroups = user_groups - act_groups
|
remgroups = user_groups - act_groups
|
||||||
@ -162,28 +162,28 @@ class ForumManager:
|
|||||||
print remgroups
|
print remgroups
|
||||||
for g in addgroups:
|
for g in addgroups:
|
||||||
if not g in forum_groups:
|
if not g in forum_groups:
|
||||||
forum_groups[g] = ForumManager.__create_group(g)
|
forum_groups[g] = Phpbb3Manager.__create_group(g)
|
||||||
ForumManager.__add_user_to_group(userid, forum_groups[g])
|
Phpbb3Manager.__add_user_to_group(userid, forum_groups[g])
|
||||||
|
|
||||||
for g in remgroups:
|
for g in remgroups:
|
||||||
ForumManager.__remove_user_from_group(userid, forum_groups[g])
|
Phpbb3Manager.__remove_user_from_group(userid, forum_groups[g])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remove_group(username, group):
|
def remove_group(username, group):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
userid = ForumManager.__get_user_id(username)
|
userid = Phpbb3Manager.__get_user_id(username)
|
||||||
groupid = ForumManager.__get_group_id(group)
|
groupid = Phpbb3Manager.__get_group_id(group)
|
||||||
|
|
||||||
if userid:
|
if userid:
|
||||||
if groupid:
|
if groupid:
|
||||||
cursor.execute(ForumManager.SQL_REMOVE_USER_GROUP, [userid, groupid])
|
cursor.execute(Phpbb3Manager.SQL_REMOVE_USER_GROUP, [userid, groupid])
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_user(username):
|
def check_user(username):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
""" Check if the username exists """
|
""" Check if the username exists """
|
||||||
cursor.execute(ForumManager.SQL_USER_ID_FROM_USERNAME, [ForumManager.__santatize_username(username)])
|
cursor.execute(Phpbb3Manager.SQL_USER_ID_FROM_USERNAME, [Phpbb3Manager.__santatize_username(username)])
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
if row:
|
if row:
|
||||||
return True
|
return True
|
||||||
@ -192,10 +192,10 @@ class ForumManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def update_user_password(username):
|
def update_user_password(username):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
password = ForumManager.__generate_random_pass()
|
password = Phpbb3Manager.__generate_random_pass()
|
||||||
if ForumManager.check_user(username):
|
if Phpbb3Manager.check_user(username):
|
||||||
pwhash = ForumManager.__gen_hash(password)
|
pwhash = Phpbb3Manager.__gen_hash(password)
|
||||||
cursor.execute(ForumManager.SQL_UPDATE_USER_PASSWORD, [pwhash, username])
|
cursor.execute(Phpbb3Manager.SQL_UPDATE_USER_PASSWORD, [pwhash, username])
|
||||||
return password
|
return password
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
@ -204,6 +204,6 @@ class ForumManager:
|
|||||||
def __update_user_info(username, email, password):
|
def __update_user_info(username, email, password):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
try:
|
try:
|
||||||
cursor.execute(ForumManager.SQL_DIS_USER, [email, password, username])
|
cursor.execute(Phpbb3Manager.SQL_DIS_USER, [email, password, username])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
190
services/views.py
Normal file → Executable file
190
services/views.py
Normal file → Executable file
@ -4,17 +4,21 @@ from django.shortcuts import render_to_response
|
|||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth.decorators import permission_required
|
from django.contrib.auth.decorators import permission_required
|
||||||
|
|
||||||
from managers.jabber_manager import JabberManager
|
from managers.openfire_manager import OpenfireManager
|
||||||
from managers.forum_manager import ForumManager
|
from managers.phpbb3_manager import Phpbb3Manager
|
||||||
from managers.mumble_manager import MumbleManager
|
from managers.mumble_manager import MumbleManager
|
||||||
|
from managers.ipboard_manager import IPBoardManager
|
||||||
from authentication.managers import AuthServicesInfoManager
|
from authentication.managers import AuthServicesInfoManager
|
||||||
from eveonline.managers import EveManager
|
from eveonline.managers import EveManager
|
||||||
from celerytask.tasks import update_jabber_groups
|
from celerytask.tasks import update_jabber_groups
|
||||||
from celerytask.tasks import update_mumble_groups
|
from celerytask.tasks import update_mumble_groups
|
||||||
from celerytask.tasks import update_forum_groups
|
from celerytask.tasks import update_forum_groups
|
||||||
|
from celerytask.tasks import update_ipboard_groups
|
||||||
from forms import JabberBroadcastForm
|
from forms import JabberBroadcastForm
|
||||||
from forms import FleetFormatterForm
|
from forms import FleetFormatterForm
|
||||||
|
from django.contrib.auth.decorators import user_passes_test
|
||||||
|
|
||||||
|
from util import check_if_user_has_permission
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def fleet_formatter_view(request):
|
def fleet_formatter_view(request):
|
||||||
@ -49,7 +53,7 @@ def jabber_broadcast_view(request):
|
|||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = JabberBroadcastForm(request.POST)
|
form = JabberBroadcastForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
JabberManager.send_broadcast_message(form.cleaned_data['group'], form.cleaned_data['message'])
|
OpenfireManager.send_broadcast_message(form.cleaned_data['group'], form.cleaned_data['message'])
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
form = JabberBroadcastForm()
|
form = JabberBroadcastForm()
|
||||||
@ -66,13 +70,17 @@ def services_view(request):
|
|||||||
context_instance=RequestContext(request))
|
context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
|
def service_blue_alliance_test(user):
|
||||||
|
return check_if_user_has_permission(user, 'alliance_member') or check_if_user_has_permission(user, 'blue_member')
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.alliance_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def activate_forum(request):
|
def activate_forum(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
# Valid now we get the main characters
|
# Valid now we get the main characters
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||||
result = ForumManager.add_user(character.character_name, request.user.email, ['REGISTERED'])
|
result = Phpbb3Manager.add_user(character.character_name, request.user.email, ['REGISTERED'])
|
||||||
# if empty we failed
|
# if empty we failed
|
||||||
if result[0] != "":
|
if result[0] != "":
|
||||||
AuthServicesInfoManager.update_user_forum_info(result[0], result[1], request.user)
|
AuthServicesInfoManager.update_user_forum_info(result[0], result[1], request.user)
|
||||||
@ -82,74 +90,73 @@ def activate_forum(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def activate_blue_forum(request):
|
def deactivate_forum(request):
|
||||||
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
|
result = Phpbb3Manager.disable_user(authinfo.forum_username)
|
||||||
|
# false we failed
|
||||||
|
if result:
|
||||||
|
AuthServicesInfoManager.update_user_forum_info("", "", request.user)
|
||||||
|
return HttpResponseRedirect("/services/")
|
||||||
|
return HttpResponseRedirect("/dashboard")
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
@user_passes_test(service_blue_alliance_test)
|
||||||
|
def reset_forum_password(request):
|
||||||
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
|
result = Phpbb3Manager.update_user_password(authinfo.forum_username)
|
||||||
|
# false we failed
|
||||||
|
if result != "":
|
||||||
|
AuthServicesInfoManager.update_user_forum_info(authinfo.forum_username, result, request.user)
|
||||||
|
return HttpResponseRedirect("/services/")
|
||||||
|
return HttpResponseRedirect("/dashboard")
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
@user_passes_test(service_blue_alliance_test)
|
||||||
|
def activate_ipboard_forum(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
# Valid now we get the main characters
|
# Valid now we get the main characters
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||||
result = ForumManager.add_user(character.character_name, request.user.email, ['REGISTERED'])
|
result = IPBoardManager.add_user(character.character_name, request.user.email)
|
||||||
# if empty we failed
|
|
||||||
if result[0] != "":
|
if result[0] != "":
|
||||||
AuthServicesInfoManager.update_user_forum_info(result[0], result[1], request.user)
|
AuthServicesInfoManager.update_user_ipboard_info(result[0], result[1], request.user)
|
||||||
update_forum_groups(request.user)
|
update_ipboard_groups(request.user)
|
||||||
return HttpResponseRedirect("/services/")
|
return HttpResponseRedirect("/services/")
|
||||||
return HttpResponseRedirect("/dashboard")
|
return HttpResponseRedirect("/dashboard")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.alliance_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def deactivate_forum(request):
|
def deactivate_ipboard_forum(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = ForumManager.disable_user(authinfo.forum_username)
|
result = IPBoardManager.disable_user(authinfo.ipboard_username)
|
||||||
# false we failed
|
# false we failed
|
||||||
if result:
|
if result:
|
||||||
AuthServicesInfoManager.update_user_forum_info("", "", request.user)
|
AuthServicesInfoManager.update_user_ipboard_info("", "", request.user)
|
||||||
return HttpResponseRedirect("/services/")
|
return HttpResponseRedirect("/services/")
|
||||||
return HttpResponseRedirect("/dashboard")
|
return HttpResponseRedirect("/dashboard")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def deactivate_blue_forum(request):
|
def reset_ipboard_password(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = ForumManager.disable_user(authinfo.forum_username)
|
result = IPBoardManager.update_user_password(authinfo.ipboard_username, request.user.email)
|
||||||
# false we failed
|
|
||||||
if result:
|
|
||||||
AuthServicesInfoManager.update_user_forum_info("", "", request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def reset_forum_password(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = ForumManager.update_user_password(authinfo.forum_username)
|
|
||||||
# false we failed
|
|
||||||
if result != "":
|
if result != "":
|
||||||
AuthServicesInfoManager.update_user_forum_info(authinfo.forum_username, result, request.user)
|
AuthServicesInfoManager.update_user_ipboard_info(authinfo.ipboard_username, result, request.user)
|
||||||
return HttpResponseRedirect("/services/")
|
return HttpResponseRedirect("/services/")
|
||||||
return HttpResponseRedirect("/dashboard")
|
return HttpResponseRedirect("/dashboard")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.blue_member')
|
|
||||||
def reset_blue_forum_password(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = ForumManager.update_user_password(authinfo.forum_username)
|
|
||||||
# false we failed
|
|
||||||
if result != "":
|
|
||||||
AuthServicesInfoManager.update_user_forum_info(authinfo.forum_username, result, request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.alliance_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def activate_jabber(request):
|
def activate_jabber(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||||
info = JabberManager.add_user(character.character_name)
|
info = OpenfireManager.add_user(character.character_name)
|
||||||
# If our username is blank means we already had a user
|
# If our username is blank means we already had a user
|
||||||
if info[0] is not "":
|
if info[0] is not "":
|
||||||
AuthServicesInfoManager.update_user_jabber_info(info[0], info[1], request.user)
|
AuthServicesInfoManager.update_user_jabber_info(info[0], info[1], request.user)
|
||||||
@ -159,24 +166,10 @@ def activate_jabber(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def activate_blue_jabber(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
|
||||||
info = JabberManager.add_user(character.character_name)
|
|
||||||
# If our username is blank means we already had a user
|
|
||||||
if info[0] is not "":
|
|
||||||
AuthServicesInfoManager.update_user_jabber_info(info[0], info[1], request.user)
|
|
||||||
update_jabber_groups(request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def deactivate_jabber(request):
|
def deactivate_jabber(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = JabberManager.delete_user(authinfo.jabber_username)
|
result = OpenfireManager.delete_user(authinfo.jabber_username)
|
||||||
# If our username is blank means we failed
|
# If our username is blank means we failed
|
||||||
if result:
|
if result:
|
||||||
AuthServicesInfoManager.update_user_jabber_info("", "", request.user)
|
AuthServicesInfoManager.update_user_jabber_info("", "", request.user)
|
||||||
@ -185,22 +178,10 @@ def deactivate_jabber(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def deactivate_blue_jabber(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = JabberManager.delete_user(authinfo.jabber_username)
|
|
||||||
# If our username is blank means we failed
|
|
||||||
if result:
|
|
||||||
AuthServicesInfoManager.update_user_jabber_info("", "", request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def reset_jabber_password(request):
|
def reset_jabber_password(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = JabberManager.update_user_pass(authinfo.jabber_username)
|
result = OpenfireManager.update_user_pass(authinfo.jabber_username)
|
||||||
# If our username is blank means we failed
|
# If our username is blank means we failed
|
||||||
if result != "":
|
if result != "":
|
||||||
AuthServicesInfoManager.update_user_jabber_info(authinfo.jabber_username, result, request.user)
|
AuthServicesInfoManager.update_user_jabber_info(authinfo.jabber_username, result, request.user)
|
||||||
@ -209,22 +190,13 @@ def reset_jabber_password(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def reset_blue_jabber_password(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = JabberManager.update_user_pass(authinfo.jabber_username)
|
|
||||||
# If our username is blank means we failed
|
|
||||||
if result != "":
|
|
||||||
AuthServicesInfoManager.update_user_jabber_info(authinfo.jabber_username, result, request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def activate_mumble(request):
|
def activate_mumble(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||||
|
if check_if_user_has_permission(request.user, "blue_member"):
|
||||||
|
result = MumbleManager.create_blue_user(character.corporation_ticker, character.character_name)
|
||||||
|
else:
|
||||||
result = MumbleManager.create_user(character.corporation_ticker, character.character_name)
|
result = MumbleManager.create_user(character.corporation_ticker, character.character_name)
|
||||||
# if its empty we failed
|
# if its empty we failed
|
||||||
if result[0] is not "":
|
if result[0] is not "":
|
||||||
@ -235,21 +207,7 @@ def activate_mumble(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def activate_blue_mumble(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
|
||||||
result = MumbleManager.create_blue_user(character.corporation_ticker, character.character_name)
|
|
||||||
# if its empty we failed
|
|
||||||
if result[0] is not "":
|
|
||||||
AuthServicesInfoManager.update_user_mumble_info(result[0], result[1], request.user)
|
|
||||||
update_mumble_groups(request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/dashboard")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def deactivate_mumble(request):
|
def deactivate_mumble(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = MumbleManager.delete_user(authinfo.mumble_username)
|
result = MumbleManager.delete_user(authinfo.mumble_username)
|
||||||
@ -261,19 +219,7 @@ def deactivate_mumble(request):
|
|||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('auth.blue_member')
|
@user_passes_test(service_blue_alliance_test)
|
||||||
def deactivate_blue_mumble(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = MumbleManager.delete_user(authinfo.mumble_username)
|
|
||||||
# if false we failed
|
|
||||||
if result:
|
|
||||||
AuthServicesInfoManager.update_user_mumble_info("", "", request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/")
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.alliance_member')
|
|
||||||
def reset_mumble_password(request):
|
def reset_mumble_password(request):
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||||
result = MumbleManager.update_user_password(authinfo.mumble_username)
|
result = MumbleManager.update_user_password(authinfo.mumble_username)
|
||||||
@ -282,15 +228,3 @@ def reset_mumble_password(request):
|
|||||||
AuthServicesInfoManager.update_user_mumble_info(authinfo.mumble_username, result, request.user)
|
AuthServicesInfoManager.update_user_mumble_info(authinfo.mumble_username, result, request.user)
|
||||||
return HttpResponseRedirect("/services/")
|
return HttpResponseRedirect("/services/")
|
||||||
return HttpResponseRedirect("/")
|
return HttpResponseRedirect("/")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@permission_required('auth.blue_member')
|
|
||||||
def reset_blue_mumble_password(request):
|
|
||||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
|
||||||
result = MumbleManager.update_user_password(authinfo.mumble_username)
|
|
||||||
# if blank we failed
|
|
||||||
if result != "":
|
|
||||||
AuthServicesInfoManager.update_user_mumble_info(authinfo.mumble_username, result, request.user)
|
|
||||||
return HttpResponseRedirect("/services/")
|
|
||||||
return HttpResponseRedirect("/")
|
|
||||||
|
64
templates/registered/services.html
Normal file → Executable file
64
templates/registered/services.html
Normal file → Executable file
@ -25,16 +25,39 @@
|
|||||||
<td class="text-center"><a href="{{ FORUM_URL }}">{{ FORUM_URL }}</a></td>
|
<td class="text-center"><a href="{{ FORUM_URL }}">{{ FORUM_URL }}</a></td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal authinfo.forum_username "" %}
|
{% ifequal authinfo.forum_username "" %}
|
||||||
<a href="{% url 'auth_activate_blue_forum' %}">
|
<a href="{% url 'auth_activate_forum' %}">
|
||||||
<button type="button" class="btn btn-success"><span
|
<button type="button" class="btn btn-success"><span
|
||||||
class="glyphicon glyphicon-ok"></span></button>
|
class="glyphicon glyphicon-ok"></span></button>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'auth_reset_blue_forum_password' %}">
|
<a href="{% url 'auth_reset_forum_password' %}">
|
||||||
<button type="button" class="btn btn-primary"><span
|
<button type="button" class="btn btn-primary"><span
|
||||||
class="glyphicon glyphicon-refresh"></span></button>
|
class="glyphicon glyphicon-refresh"></span></button>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'auth_deactivate_blue_forum' %}">
|
<a href="{% url 'auth_deactivate_forum' %}">
|
||||||
|
<button type="button" class="btn btn-danger"><span
|
||||||
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
|
</a>
|
||||||
|
{% endifequal %}
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
{% if ENABLE_BLUE_IPBOARD %}
|
||||||
|
<td class="text-center">IPBoard Forums</td>
|
||||||
|
<td class="text-center">{{ authinfo.ipboard_username }}</td>
|
||||||
|
<td class="text-center">{{ authinfo.ipboard_password }}</td>
|
||||||
|
<td class="text-center"><a href="{{ FORUM_URL }}">{{ FORUM_URL }}</a></td>
|
||||||
|
<td class="text-center">
|
||||||
|
{% ifequal authinfo.ipboard_username "" %}
|
||||||
|
<a href="{% url 'auth_activate_ipboard' %}">
|
||||||
|
<button type="button" class="btn btn-success"><span
|
||||||
|
class="glyphicon glyphicon-ok"></span></button>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url 'auth_reset_ipboard_password' %}">
|
||||||
|
<button type="button" class="btn btn-primary"><span
|
||||||
|
class="glyphicon glyphicon-refresh"></span></button>
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'auth_deactivate_ipboard' %}">
|
||||||
<button type="button" class="btn btn-danger"><span
|
<button type="button" class="btn btn-danger"><span
|
||||||
class="glyphicon glyphicon-remove"></span></button>
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
</a>
|
</a>
|
||||||
@ -49,16 +72,16 @@
|
|||||||
<td class="text-center">{{ JABBER_URL }}</td>
|
<td class="text-center">{{ JABBER_URL }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal authinfo.jabber_username "" %}
|
{% ifequal authinfo.jabber_username "" %}
|
||||||
<a href="{% url 'auth_activate_blue_jabber' %}">
|
<a href="{% url 'auth_activate_jabber' %}">
|
||||||
<button type="button" class="btn btn-success"><span
|
<button type="button" class="btn btn-success"><span
|
||||||
class="glyphicon glyphicon-ok"></span></button>
|
class="glyphicon glyphicon-ok"></span></button>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'auth_reset_blue_jabber_password' %}">
|
<a href="{% url 'auth_reset_blue_password' %}">
|
||||||
<button type="button" class="btn btn-primary"><span
|
<button type="button" class="btn btn-primary"><span
|
||||||
class="glyphicon glyphicon-refresh"></span></button>
|
class="glyphicon glyphicon-refresh"></span></button>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'auth_deactivate_blue_jabber' %}">
|
<a href="{% url 'auth_deactivate_jabber' %}">
|
||||||
<button type="button" class="btn btn-danger"><span
|
<button type="button" class="btn btn-danger"><span
|
||||||
class="glyphicon glyphicon-remove"></span></button>
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
</a>
|
</a>
|
||||||
@ -74,16 +97,16 @@
|
|||||||
<td class="text-center">{{ MUMBLE_URL }}</td>
|
<td class="text-center">{{ MUMBLE_URL }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal authinfo.mumble_username "" %}
|
{% ifequal authinfo.mumble_username "" %}
|
||||||
<a href="{% url 'auth_activate_blue_mumble' %}">
|
<a href="{% url 'auth_activate_mumble' %}">
|
||||||
<button type="button" class="btn btn-success"><span
|
<button type="button" class="btn btn-success"><span
|
||||||
class="glyphicon glyphicon-ok"></span></button>
|
class="glyphicon glyphicon-ok"></span></button>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'auth_reset_blue_mumble_password' %}">
|
<a href="{% url 'auth_reset_mumble_password' %}">
|
||||||
<button type="button" class="btn btn-primary"><span
|
<button type="button" class="btn btn-primary"><span
|
||||||
class="glyphicon glyphicon-refresh"></span></button>
|
class="glyphicon glyphicon-refresh"></span></button>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'auth_deactivate_blue_mumble' %}">
|
<a href="{% url 'auth_deactivate_mumble' %}">
|
||||||
<button type="button" class="btn btn-danger"><span
|
<button type="button" class="btn btn-danger"><span
|
||||||
class="glyphicon glyphicon-remove"></span></button>
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
</a>
|
</a>
|
||||||
@ -126,6 +149,29 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if ENABLE_ALLIANCE_IPBOARD %}
|
||||||
|
<td class="text-center">IPBoard Forums</td>
|
||||||
|
<td class="text-center">{{ authinfo.ipboard_username }}</td>
|
||||||
|
<td class="text-center">{{ authinfo.ipboard_password }}</td>
|
||||||
|
<td class="text-center"><a href="{{ FORUM_URL }}">{{ FORUM_URL }}</a></td>
|
||||||
|
<td class="text-center">
|
||||||
|
{% ifequal authinfo.ipboard_username "" %}
|
||||||
|
<a href="{% url 'auth_activate_ipboard' %}">
|
||||||
|
<button type="button" class="btn btn-success"><span
|
||||||
|
class="glyphicon glyphicon-ok"></span></button>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url 'auth_reset_ipboard_password' %}">
|
||||||
|
<button type="button" class="btn btn-primary"><span
|
||||||
|
class="glyphicon glyphicon-refresh"></span></button>
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'auth_deactivate_ipboard' %}">
|
||||||
|
<button type="button" class="btn btn-danger"><span
|
||||||
|
class="glyphicon glyphicon-remove"></span></button>
|
||||||
|
</a>
|
||||||
|
{% endifequal %}
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
{% if ENABLE_ALLIANCE_JABBER %}
|
{% if ENABLE_ALLIANCE_JABBER %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center">Jabber</td>
|
<td class="text-center">Jabber</td>
|
||||||
|
2
thirdparty/IPBoard3/Readme.txt
vendored
Executable file
2
thirdparty/IPBoard3/Readme.txt
vendored
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
To utilize this module copy the folder "aa" to your interface/board/modules/ directory.
|
||||||
|
Then create and api key and give all "AllianceAuth" permissions to it.
|
526
thirdparty/IPBoard3/aa/api.php
vendored
Executable file
526
thirdparty/IPBoard3/aa/api.php
vendored
Executable file
@ -0,0 +1,526 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote API User Administration configuration
|
||||||
|
*
|
||||||
|
* @author Author: Raynaldo Rivera
|
||||||
|
*/
|
||||||
|
|
||||||
|
class API_Server
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Defines the service for WSDL
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public $__dispatch_map = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IPS Global Class
|
||||||
|
*
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
protected $registry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IPS API SERVER Class
|
||||||
|
*
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
public $classApiServer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @return @e void
|
||||||
|
*/
|
||||||
|
public function __construct( $registry )
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// Set IPS CLASS
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$this->registry = $registry;
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Load allowed methods and build dispatch
|
||||||
|
// list
|
||||||
|
//-----------------------------------------
|
||||||
|
$ALLOWED_METHODS = array();
|
||||||
|
require_once( DOC_IPS_ROOT_PATH . 'interface/board/modules/aa/methods.php' );/*noLibHook*/
|
||||||
|
|
||||||
|
if ( is_array( $ALLOWED_METHODS ) and count( $ALLOWED_METHODS ) )
|
||||||
|
{
|
||||||
|
foreach( $ALLOWED_METHODS as $_method => $_data )
|
||||||
|
{
|
||||||
|
$this->__dispatch_map[ $_method ] = $_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creates a new user
|
||||||
|
public function createUser( $api_key, $api_module, $username, $email, $display_name, $md5_passwordHash)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'createUser' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Create a user
|
||||||
|
//-----------------------------------------
|
||||||
|
$test = IPSMember::create( array( 'core' => array( 'email' => $email, 'md5_hash_password' => $md5_passwordHash, 'name' => $username, 'members_display_name' => $display_name) ) );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// The way IPSMember::create function works is it can't fail.. It always returns true unless all data isn't provided.
|
||||||
|
// However it will still create a partial record. So in essence never fails
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'success') );
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Deletes a user from the entire system
|
||||||
|
public function deleteUser( $api_key, $api_module, $username)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'deleteUser' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Remove a user by username
|
||||||
|
//-----------------------------------------
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
|
||||||
|
if ($member != null) {
|
||||||
|
$result = IPSMember::remove($member['member_id']);
|
||||||
|
|
||||||
|
if($result) {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'success') );
|
||||||
|
} else {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We disable by just changing the email and password to something random.
|
||||||
|
// Allows us to avoid losing post etc.
|
||||||
|
public function disableUser( $api_key, $api_module, $username)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'disableUser' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Remove a user by username
|
||||||
|
//-----------------------------------------
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
|
||||||
|
if ($member != null) {
|
||||||
|
|
||||||
|
$uniqueID = strval(uniqid());
|
||||||
|
$uniqueEmail = strval(uniqid());
|
||||||
|
$uniqueMD5 = md5($uniqueID);
|
||||||
|
$email = $uniqueEmail.'@'.$uniqueEmail.'.com';
|
||||||
|
|
||||||
|
$email_result = IPSMember::save( array( 'core' => array( 'field' => 'member_id', 'value' => $member['member_id'])),array('core' => array('email'=>$email)));
|
||||||
|
$password_result = $password_result = IPSMember::updatePassword($member['member_id'], $uniqueMD5);
|
||||||
|
|
||||||
|
if($email_result && $password_result) {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'success') );
|
||||||
|
} else {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Used to update the user email, and password.
|
||||||
|
// Is also used to re-enable a disabled account
|
||||||
|
public function updateUser( $api_key, $api_module, $username, $email, $md5_passwordHash)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'updateUser' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Load our user
|
||||||
|
//-----------------------------------------
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
|
||||||
|
if ($member != null) {
|
||||||
|
|
||||||
|
$email_result = IPSMember::save( array( 'core' => array( 'field' => 'member_id', 'value' => $member['member_id'])),array('core' => array('email'=>$email)));
|
||||||
|
$password_result = $password_result = IPSMember::updatePassword($member['member_id'], $md5_passwordHash);
|
||||||
|
|
||||||
|
if($email_result && $password_result) {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'success') );
|
||||||
|
} else {
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply( array('result' => 'failure') );
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllGroups( $api_key, $api_module)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'getAllGroups' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Load our user
|
||||||
|
//-----------------------------------------
|
||||||
|
ipsRegistry::DB()->build(array('select' => 'g_title', 'from' => 'groups'));
|
||||||
|
$result = ipsRegistry::DB()->execute();
|
||||||
|
$groups = array();
|
||||||
|
|
||||||
|
while( $r = ipsRegistry::DB()->fetch($result)) {
|
||||||
|
array_push($groups,$r);
|
||||||
|
}
|
||||||
|
$this->classApiServer->apiSendReply($groups);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserGroups( $api_key, $api_module, $username)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'getUserGroups' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
|
||||||
|
if( $member['mgroup_others']) {
|
||||||
|
$groupids = explode(',' , $member['mgroup_others']);
|
||||||
|
|
||||||
|
$groups = array();
|
||||||
|
foreach ($groupids as &$groupid) {
|
||||||
|
ipsRegistry::DB()->build(array('select' => 'g_title', 'from'=>'groups','where'=>'g_id='.$groupid));
|
||||||
|
$result = ipsRegistry::DB()->execute();
|
||||||
|
array_push($groups, ipsRegistry::DB()->fetch($result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->classApiServer->apiSendReply($groups);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function addGroup( $api_key, $api_module, $group)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'addGroup' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
$result = ipsRegistry::DB()->insert("groups", array('g_title'=>$group));
|
||||||
|
ipsRegistry::DB()->fetch($result);
|
||||||
|
|
||||||
|
// Rebuild the group cache
|
||||||
|
ipsRegistry::cache()->rebuildCache( 'group_cache', 'global' );
|
||||||
|
|
||||||
|
// Regardless if it passes or fails it will only fail if it exist
|
||||||
|
$this->classApiServer->apiSendReply(array('result'=>'success'));
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addUserToGroup( $api_key, $api_module, $username, $group)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'addUserToGroup' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
$groups = explode(",", $member['mgroup_others']);
|
||||||
|
|
||||||
|
// Group group id
|
||||||
|
ipsRegistry::DB()->build(array('select' => 'g_id', 'from' => 'groups', 'where'=>"g_title='{$group}'"));
|
||||||
|
$result = ipsRegistry::DB()->execute();
|
||||||
|
array_push($groups, ipsRegistry::DB()->fetch($result)['g_id']);
|
||||||
|
|
||||||
|
$groupstoadd = implode(",", $groups);
|
||||||
|
IPSMember::save( array( 'core' => array( 'field' => 'member_id', 'value' => $member['member_id'])),array('core' => array('mgroup_others'=>$groupstoadd)));
|
||||||
|
|
||||||
|
// Rebuild the group cache
|
||||||
|
ipsRegistry::cache()->rebuildCache( 'group_cache', 'global' );
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply($groups);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeUserFromGroup( $api_key, $api_module, $username, $group)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'removeUserFromGroup' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
$member = IPSMember::load($username,'all','username');
|
||||||
|
$groups = explode(",", $member['mgroup_others']);
|
||||||
|
|
||||||
|
// Group group id
|
||||||
|
ipsRegistry::DB()->build(array('select' => 'g_id', 'from' => 'groups', 'where'=>"g_title='{$group}'"));
|
||||||
|
$result = ipsRegistry::DB()->execute();
|
||||||
|
$diffGroup = array_diff($groups, array(ipsRegistry::DB()->fetch($result)['g_id']));
|
||||||
|
|
||||||
|
$groupstoadd = implode(",", $diffGroup);
|
||||||
|
IPSMember::save( array( 'core' => array( 'field' => 'member_id', 'value' => $member['member_id'])),array('core' => array('mgroup_others'=>$groupstoadd)));
|
||||||
|
|
||||||
|
// Rebuild the group cache
|
||||||
|
ipsRegistry::cache()->rebuildCache( 'group_cache', 'global' );
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply($diffGroup);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function helpMe( $api_key, $api_module)
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// INIT
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
$api_key = IPSText::md5Clean( $api_key );
|
||||||
|
$api_module = IPSText::parseCleanValue( $api_module );
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Authenticate
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->__authenticate( $api_key, $api_module, 'helpMe' ) !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
|
// Add log
|
||||||
|
//-----------------------------------------
|
||||||
|
$this->addLogging( $api_key );
|
||||||
|
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendReply($groups);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds logging obviously :)
|
||||||
|
*
|
||||||
|
* @param string $api_key Authentication Key
|
||||||
|
*/
|
||||||
|
public function addLogging( $api_key )
|
||||||
|
{
|
||||||
|
if ( ipsRegistry::$settings['xmlrpc_log_type'] != 'failed' )
|
||||||
|
{
|
||||||
|
$this->registry->DB()->insert( 'api_log', array( 'api_log_key' => $api_key,
|
||||||
|
'api_log_ip' => $_SERVER['REMOTE_ADDR'],
|
||||||
|
'api_log_date' => time(),
|
||||||
|
'api_log_query' => $this->classApiServer->raw_request,
|
||||||
|
'api_log_allowed' => 1 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if the request is allowed
|
||||||
|
*
|
||||||
|
* @param string $api_key Authenticate Key
|
||||||
|
* @param string $api_module Module
|
||||||
|
* @param string $api_function Function
|
||||||
|
* @return string Error message, if any
|
||||||
|
*/
|
||||||
|
protected function __authenticate( $api_key, $api_module, $api_function )
|
||||||
|
{
|
||||||
|
//-----------------------------------------
|
||||||
|
// Check
|
||||||
|
//-----------------------------------------
|
||||||
|
|
||||||
|
if ( $this->api_user['api_user_id'] )
|
||||||
|
{
|
||||||
|
$this->api_user['_permissions'] = unserialize( stripslashes( $this->api_user['api_user_perms'] ) );
|
||||||
|
|
||||||
|
if ( $this->api_user['_permissions'][ $api_module ][ $api_function ] == 1 )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->registry->DB()->insert( 'api_log', array( 'api_log_key' => $api_key,
|
||||||
|
'api_log_ip' => $_SERVER['REMOTE_ADDR'],
|
||||||
|
'api_log_date' => time(),
|
||||||
|
'api_log_query' => $this->classApiServer->raw_request,
|
||||||
|
'api_log_allowed' => 0 ) );
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendError( '200', "API Key {$api_key} does not have permission for {$api_module}/{$api_function}" );
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->registry->DB()->insert( 'api_log', array( 'api_log_key' => $api_key,
|
||||||
|
'api_log_ip' => $_SERVER['REMOTE_ADDR'],
|
||||||
|
'api_log_date' => time(),
|
||||||
|
'api_log_query' => $this->classApiServer->raw_request,
|
||||||
|
'api_log_allowed' => 0 ) );
|
||||||
|
|
||||||
|
$this->classApiServer->apiSendError( '100', "API Key {$api_key} does not have permission for {$api_module}/{$api_function}" );
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
thirdparty/IPBoard3/aa/config.php
vendored
Executable file
11
thirdparty/IPBoard3/aa/config.php
vendored
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote API User Administration configuration
|
||||||
|
*
|
||||||
|
* @author Author: Raynaldo Rivera
|
||||||
|
*/
|
||||||
|
|
||||||
|
$CONFIG['api_module_title'] = 'AllianceAuth';
|
||||||
|
$CONFIG['api_module_desc'] = 'AllianceAuth Module';
|
||||||
|
$CONFIG['api_module_key'] = 'aa';
|
10
thirdparty/IPBoard3/aa/index.html
vendored
Executable file
10
thirdparty/IPBoard3/aa/index.html
vendored
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
<html>
|
||||||
|
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>403: IP.Board -> Forbidden</h1>
|
||||||
|
<hr>
|
||||||
|
You have reached this page in error, please use your back button to return to the forum.
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
125
thirdparty/IPBoard3/aa/methods.php
vendored
Executable file
125
thirdparty/IPBoard3/aa/methods.php
vendored
Executable file
@ -0,0 +1,125 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote API User Administration configuration
|
||||||
|
*
|
||||||
|
* @author Author: Raynaldo Rivera
|
||||||
|
*/
|
||||||
|
|
||||||
|
$ALLOWED_METHODS = array();
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['createUser'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string',
|
||||||
|
'email' => 'string',
|
||||||
|
'display_name'=> 'string',
|
||||||
|
'md5_passwordHash' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['deleteUser'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['disableUser'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['updateUser'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string',
|
||||||
|
'email' => 'string',
|
||||||
|
'md5_passwordHash' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['getAllGroups'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['getUserGroups'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['addGroup'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'group' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['addUserToGroup'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string',
|
||||||
|
'group' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['removeUserFromGroup'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
'username' => 'string',
|
||||||
|
'group' => 'string'
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$ALLOWED_METHODS['helpMe'] = array(
|
||||||
|
'in' => array(
|
||||||
|
'api_key' => 'string',
|
||||||
|
'api_module' => 'string',
|
||||||
|
|
||||||
|
),
|
||||||
|
'out' => array(
|
||||||
|
'response' => 'xmlrpc'
|
||||||
|
)
|
||||||
|
);
|
12
util/common_task.py
Normal file → Executable file
12
util/common_task.py
Normal file → Executable file
@ -2,9 +2,10 @@ from django.contrib.auth.models import Group
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
from authentication.managers import AuthServicesInfoManager
|
from authentication.managers import AuthServicesInfoManager
|
||||||
from services.managers.jabber_manager import JabberManager
|
from services.managers.openfire_manager import OpenfireManager
|
||||||
from services.managers.forum_manager import ForumManager
|
from services.managers.phpbb3_manager import Phpbb3Manager
|
||||||
from services.managers.mumble_manager import MumbleManager
|
from services.managers.mumble_manager import MumbleManager
|
||||||
|
from services.managers.ipboard_manager import IPBoardManager
|
||||||
|
|
||||||
|
|
||||||
def add_user_to_group(user, groupname):
|
def add_user_to_group(user, groupname):
|
||||||
@ -28,10 +29,13 @@ def deactivate_services(user):
|
|||||||
MumbleManager.delete_user(authinfo.mumble_username)
|
MumbleManager.delete_user(authinfo.mumble_username)
|
||||||
AuthServicesInfoManager.update_user_mumble_info("", "", user)
|
AuthServicesInfoManager.update_user_mumble_info("", "", user)
|
||||||
if authinfo.jabber_username != "":
|
if authinfo.jabber_username != "":
|
||||||
JabberManager.delete_user(authinfo.jabber_username)
|
OpenfireManager.delete_user(authinfo.jabber_username)
|
||||||
AuthServicesInfoManager.update_user_jabber_info("", "", user)
|
AuthServicesInfoManager.update_user_jabber_info("", "", user)
|
||||||
if authinfo.forum_username != "":
|
if authinfo.forum_username != "":
|
||||||
ForumManager.disable_user(authinfo.forum_username)
|
Phpbb3Manager.disable_user(authinfo.forum_username)
|
||||||
|
AuthServicesInfoManager.update_user_forum_info("", "", user)
|
||||||
|
if authinfo.ipboard_username != "":
|
||||||
|
IPBoardManager.disable_user(authinfo.ipboard_username)
|
||||||
AuthServicesInfoManager.update_user_forum_info("", "", user)
|
AuthServicesInfoManager.update_user_forum_info("", "", user)
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,9 @@ def domain_url(request):
|
|||||||
'ENABLE_ALLIANCE_FORUM': settings.ENABLE_ALLIANCE_FORUM,
|
'ENABLE_ALLIANCE_FORUM': settings.ENABLE_ALLIANCE_FORUM,
|
||||||
'ENABLE_ALLIANCE_JABBER': settings.ENABLE_ALLIANCE_JABBER,
|
'ENABLE_ALLIANCE_JABBER': settings.ENABLE_ALLIANCE_JABBER,
|
||||||
'ENABLE_ALLIANCE_MUMBLE': settings.ENABLE_ALLIANCE_MUMBLE,
|
'ENABLE_ALLIANCE_MUMBLE': settings.ENABLE_ALLIANCE_MUMBLE,
|
||||||
|
'ENABLE_ALLIANCE_IPBOARD': settings.ENABLE_ALLIANCE_IPBOARD,
|
||||||
'ENABLE_BLUE_JABBER': settings.ENABLE_BLUE_JABBER,
|
'ENABLE_BLUE_JABBER': settings.ENABLE_BLUE_JABBER,
|
||||||
'ENABLE_BLUE_FORUM': settings.ENABLE_BLUE_FORUM,
|
'ENABLE_BLUE_FORUM': settings.ENABLE_BLUE_FORUM,
|
||||||
'ENABLE_BLUE_MUMBLE': settings.ENABLE_BLUE_MUMBLE,
|
'ENABLE_BLUE_MUMBLE': settings.ENABLE_BLUE_MUMBLE,
|
||||||
|
'ENABLE_BLUE_IPBOARD': settings.ENABLE_BLUE_IPBOARD,
|
||||||
'CURRENT_UTC_TIME': timezone.now()}
|
'CURRENT_UTC_TIME': timezone.now()}
|
Loading…
x
Reference in New Issue
Block a user