Page MenuHomePhabricator

+accountcreator users not part of ACC

Authored By
stwalkerster
May 14 2018, 8:19 PM
Size
1 KB
Referenced Files
None
Subscribers
None

+accountcreator users not part of ACC

<?php
chdir(__DIR__);
require('config.php');
$database = new PDO($dburl, '', '');
$enwpdatabase = new PDO('mysql:host=enwiki.analytics.db.svc.eqiad.wmflabs;dbname=enwiki_p', '', '');
$database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$enwpdatabase->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $database->query("SELECT username, status, oauthidentitycache, lastactive FROM user where status in ('User', 'Admin') and oauthidentitycache is not null");
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$stmt = $enwpdatabase->query("select user_name from user_groups inner join user on user_id = ug_user where ug_group = 'accountcreator'");
$enwpresult = $stmt->fetchAll(PDO::FETCH_COLUMN);
$stmt->closeCursor();
// print_r($enwpresult);
$removable =[];
foreach($result as $accUser) {
$userinfo = unserialize($accUser['oauthidentitycache']);
$onwikiname = $userinfo->username;
$present = array_search($onwikiname, $enwpresult);
if($present !== false) {
unset($enwpresult[$present]);
}
}
foreach($enwpresult as $u) {
echo $u . "\n";
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
59319
Default Alt Text
+accountcreator users not part of ACC (1 KB)

Event Timeline