Exemplo n.º 1
0
 ########
 /* check local requirements */
 $minDurationMet = false;
 $script->printWiki();
 do {
     $script->eligible = true;
     ########
     ## Registered for six months (i.e. <= 2014-Aug-08)
     ########
     $script->condition($script->user['registration_raw'] < 20140808000000.0, "has an account registered before 08 August 2014 (registered {$script->user['registration']})...", "does not have an account registered before 08 August 2014 (registered {$script->user['registration']}).");
     ########
     ## Flagged as a sysop for three months (as of 2015-Feb-08)
     ########
     if (!$minDurationMet) {
         /* check flag duration */
         $months = $script->get_role_longest_duration('sysop', 20150208000000.0);
         $minDurationMet = $months >= 3;
         $script->condition($minDurationMet, 'was flagged as an administrator for a continuous period of at least three months before 08 February 2015 (' . ($months > 0 ? 'longest flag duration is ' . $months . ' months' : 'never flagged') . ')...', 'was not flagged as an administrator for a continuous period of at least three months before 08 February 2015 (' . ($months > 0 ? 'longest flag duration is ' . $months . ' months' : 'never flagged') . ').');
         /* edge case: if the user was registered before 2005, they might have been flagged before flag changes were logged */
         if (!$minDurationMet && (!$script->user['registration_raw'] || $script->user['registration_raw'] < 20050000000000.0)) {
             // output warning
             $script->msg('<small>' . $script->user['name'] . ' registered here before 2005, so he might have been flagged before the rights log was created.</small>', 'is-warn is-subnote');
             // add note
             $script->event['warn_ineligible'] = '<strong>This result might be inaccurate.</strong> ' . $script->user['name'] . ' registered on some wikis before the rights log was created in 2005. You may need to investigate manually.';
         } else {
             if ($minDurationMet) {
                 $script->event['warn_ineligible'] = NULL;
             }
         }
         /* link to log for double-checking */
         $script->msg('<small>(See <a href="//' . $script->wiki['domain'] . '/wiki/Special:Log/rights?page=User:'******'name'] . '" title="local rights log">local</a> & <a href="//meta.wikimedia.org/wiki/Special:Log/rights?page=User:'******'name'] . '@' . $script->wiki['code'] . '" title="crosswiki rights log">crosswiki</a> rights logs.)</small>', 'is-subnote');