I have written a custom authtentication plugin that works correctly. Some user in my external user DB are administrators, and i want that also in mediawiki they should be administrator. Is there any "clean" way about doing this?
Where can I found the functions to get the groups associated to a user or a function to add/remove a user to a group? I think it's not good to directly write into the user_group association table.
Thank you.
I believe that the 'clean' method was to use initUser to bring in groups that the person is initially in when they are first created, and also use updateUser to update those groups when the person logs in. That was the purpose of those two functions basically, to update local data of various preferences and permissions when a user is created and logs in.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
GF wrote:
I have written a custom authtentication plugin that works correctly. Some user in my external user DB are administrators, and i want that also in mediawiki they should be administrator. Is there any "clean" way about doing this?
Where can I found the functions to get the groups associated to a user or a function to add/remove a user to a group? I think it's not good to directly write into the user_group association table.
Thank you. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thank You. I'm modifying the updateUser to keep updated the groups associated to the user. I have two doubts
1) to get the current groups associated to a user, do I have any method? or should I manually execute a query on the db? 2) I'm trying to use wfQuery to add/remove groups to the user, but I got an error that says wfQuery is a undefined function.
Thanks.
On Fri, May 2, 2008 at 10:50 PM, DanTMan dan_the_man@telus.net wrote:
I believe that the 'clean' method was to use initUser to bring in groups that the person is initially in when they are first created, and also use updateUser to update those groups when the person logs in. That was the purpose of those two functions basically, to update local data of various preferences and permissions when a user is created and logs in.
MMM I found that I should do something like this
$wiki_dbr =& wfGetDB( DB_SLAVE ); $sql = "INSERT IGNORE INTO user_groups (ug_user, ug_group) VALUES ('" . $user->getID() . "' , 'sysop')"; $wiki_dbr->query($sql, "Auth_tamtamy::updateUser");
The problem is that (obviously) I don't get the table prefix. Apart adding it manually on the query, is there any better way of doing this task?
Thanks
On Fri, May 2, 2008 at 10:50 PM, DanTMan dan_the_man@telus.net wrote:
I believe that the 'clean' method was to use initUser to bring in groups that the person is initially in when they are first created, and also use updateUser to update those groups when the person logs in. That was the purpose of those two functions basically, to update local data of various preferences and permissions when a user is created and logs in.
The problem is that (obviously) I don't get the table prefix. Apart adding it manually on the query, is there any better way of doing this task?
I do group syncing in the LDAP Authentication plugin, you could probably use it as an example.
V/r,
Ryan Lane
mediawiki-l@lists.wikimedia.org