multidimension-al / phpbbauth

A Mediawiki extension for phpBB authentication using Auth_remoteuser.
MIT License
5 stars 5 forks source link

Auto login only if the user is in given groups #10

Open khalen56 opened 5 years ago

khalen56 commented 5 years ago

Hello !

I haven't tried this extension yet because there is one essential missing feature for my usage. I'm currently using another plugin named Auth_phpBB and you can specify forum groups allowed to login to the mediawiki. I would like to switch to your plugin because it's much more convenient to have auto login on the wiki.

I'll fork the project and try to add this feature. Then I could do a pull request if you are interested.

khalen56 commented 5 years ago

I've worked a bit, and I think the best way to do it is to create a phpbb extension that adds a permission u_wiki_login then using $auth->acl_get('u_wiki_login') to check if the user is allowed to login. @ajquick maybe it is too different from your original idea and I should just maintain a fork of your extension ? What do you think ?

ajquick commented 5 years ago

I do think the group style implementation that was part of Auth_phpBB could be added rather easily. That way you can create a phpBB group and then have this plugin check if they are in that group. It would be a 1 extension solution, rather than having a MediaWiki extension and phpBB extension.

An example of how I would implement it in this extension is how Phpbb Single Sign-On did it: https://www.mediawiki.org/wiki/Extension:Phpbb_Single_Sign-On

khalen56 commented 5 years ago

Doing SQL queries with Auth_phpBB was okay, because it was a single query on login, but here it would be a query everytime so, I don't know if it's fine. I think phpbb is caching permissions, it should give better performances but yeah, it's two extensions.

ajquick commented 5 years ago

You are correct the phpBB auth is cached. The thing I would look at is does MW need to run that query every page load, or only when trying to login.