Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

external authentication and groups

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


ganfab at gmail

May 2, 2008, 6:09 AM

Post #1 of 5 (241 views)
Permalink
external authentication and groups

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[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


dan_the_man at telus

May 2, 2008, 1:50 PM

Post #2 of 5 (223 views)
Permalink
Re: external authentication and groups [In reply to]

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[at]lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ganfab at gmail

May 5, 2008, 2:12 AM

Post #3 of 5 (216 views)
Permalink
Re: external authentication and groups [In reply to]

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[at]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.
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ganfab at gmail

May 5, 2008, 2:46 AM

Post #4 of 5 (215 views)
Permalink
Re: external authentication and groups [In reply to]

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[at]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.
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Ryan.Lane at ocean

May 5, 2008, 7:11 AM

Post #5 of 5 (210 views)
Permalink
Re: external authentication and groups [In reply to]

> 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 mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.