ok.. so I get that my first line is:
$wgHooks['AutopromoteCondition'][] =
'MyExtensionHooks::onAutopromoteCondition';
and next I must define the function "onAutopromoteCondition" as:
public static function onAutopromoteCondition( $type, $args, $user, &$result ) { ...
}
but I'm not clear on what to set for ( $type, $args, $user, &$result ) and what
condition the code in { ... } is run.
Is it simply to say that in { ... } I should "return true;" if I want the user
to be promoted and "return false;" if not?
-Rich
-----Original Message-----
From: Evans, Richard K. (GRC-H000)
Sent: Friday, November 03, 2017 9:32 AM
To: MediaWiki announcements and site admin list
Subject: RE: [MediaWiki-l] using $wgAutopromote based on session header variable
Thanks Bartosz,
Any chance you could give a concrete example of how to write a single line in
LocalSettings that promotes a user to the group say 'mygroup' without condition..
just a straight automatic promotion to all users? (I would wrap that line of code in a PHP
if statement with the condition I want.
Sorry to have to ask for explicit help.. this is my first time encountering hooks in
localsettings and I am not a programmer by trade.
Truest thanks
-Rich
Looks like you can define custom conditions using the AutopromoteCondition hook:
https://www.mediawiki.org/wiki/Manual:Hooks/AutopromoteCondition
--
Bartosz DziewoĆski