AuthphpBB is an MoinMoin plugin that allows phpBB forum members to login to a MoinMoin wiki. AuthphpBB is not ready for use, this is '''work in progress'''!!! AuthphpBB is based on JorgeLéon/RemoteAuth by [[JorgeLéon|Jorge Léon]]. == How to use == Inside your wiki directory, create a directory called "AuthphpBB". In that new directory, create an empty file called "{{{__init__.py}}}", and a file called "AuthphpBB.py". The contents for "AuthphpBB.py" should be: {{{ #!python def AuthphpBB(request, **kw): """ authenticate to phpBB db Based on ftp auth by Jorge Leon """ username = kw.get('name') password = kw.get('password') login = kw.get('login') user_obj = kw.get('user_obj') cfg = request.cfg verbose = cfg.auth_phpbb_verbose if verbose: request.log("phpBB: got name=%s login=%r" % (username, login)) # we just intercept login, other requests have to be # handled by another auth handler if not login: return user_obj, True import sys#, re, ftplib import traceback from MoinMoin import user import MySQLdb, md5 u = None try: connection = MySQLdb.connect(host=cfg.auth_phpbb_host, user=cfg.auth_phpbb_user, passwd=cfg.auth_phpbb_passwd, db=cfg.auth_phpbb_db) cursor = connection.cursor() cursor.execute("SELECT username, user_password" + " FROM " + cfg.auth_phpbb_usertable + " WHERE username = '" + username + "'") data = cursor.fetchall() if md5.new(password).hexdigest() == data[0][1]: u = user.User(request, auth_username=username, name=username, password=password, auth_method='phpbb', auth_attribs=('name', 'auth_username', 'password',)) except: info = sys.exc_info() request.log("phpBB: caught an exception, traceback follows...") request.log(''.join(traceback.format_exception(*info))) if u: u.create_or_update(True) return u, True }}} Add these lines to your wikiconfig.py and adjust them: {{{ from AuthphpBB import AuthphpBB from MoinMoin.auth import moin_cookie auth_phpbb_host = "SERVER_IP_(OR_URL?)" auth_phpbb_user = "username" auth_phpbb_passwd = "password" auth_phpbb_db = "database" auth_phpbb_usertable = "table" auth_phpbb_verbose = True # or False auth = [AuthphpBB.AuthphpBB, moin_cookie] user_autocreate=True }}}