https://bugzilla.wikimedia.org/show_bug.cgi?id=24948

--- Comment #1 from lampak <llam...@gmail.com> 2010-08-30 10:07:57 UTC ---
Created attachment 7660
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=7660
MediaWiki-side patch

(discussion which resulted in filing the bug:
http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/49447)

I have written the first patch, i.e. the one on MediaWiki core side. 

The autopromotion can be now done like: 
$wgHooks['ArticleSaveComplete'][] = array (
    'Autopromote::autopromoteOnceHook', 
    array( 'somegroup' => array(APCOND_EDITCOUNT, 100) )
);

The format of conditions is the same as $wgAutopromote. The differences are:
* The group can be removed from a user via Special:UserRights. 
* The user is not autopromoted to the groups he/she has once belonged to. 
* The user won't lose the group automatically if he/she no longer meets the
criteria. 
* The Autopromote::autopromoteOnceHook() function can be assigned to any hook
so autopromotion is "only checked on certain events". The function simply calls
a new method User::autopromoteOnce() on $wgUser so if there's such need a
custom function may be written. 

My autopromotion mechanism is separate from $wgAutopromote, though it uses the
same format of conditions.

And I had to create a new database table: user_former_groups. It's actually a
clone of user_groups but stores the groups the user has once belonged to, not
necessarily belongs now. 

I haven't tested if the table is created properly on anything different then
MySQL (though it should work on sqlite and postgres because it's actually
copy-pasted user_groups).

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to