public static function onGetAutoPromoteGroups($user, &$promote) { global $wgMemc; $key = AbuseFilter::autoPromoteBlockKey($user); if ($wgMemc->get($key)) { $promote = array(); } return true; }
public function execute() { if (!$this->getUser()->isAllowed('abusefilter-modify')) { $this->dieUsage('You do not have permissions to unblock autopromotion', 'permissiondenied'); } $params = $this->extractRequestParams(); $user = User::newFromName($params['user']); if ($user === false) { // Oh god this is so bad but this message uses GENDER $msg = wfMessage('abusefilter-reautoconfirm-none', $params['user'])->text(); $this->dieUsage($msg, 'notsuspended'); } global $wgMemc; $key = AbuseFilter::autoPromoteBlockKey($user); if (!$wgMemc->get($key)) { // Same as above :( $msg = wfMessage('abusefilter-reautoconfirm-none', $params['user'])->text(); $this->dieUsage($msg, 'notsuspended'); } $wgMemc->delete($key); $res = array('user' => $params['user']); $this->getResult()->addValue(null, $this->getModuleName(), $res); }
public static function ajaxReAutoconfirm($username) { global $wgUser; if (!$wgUser->isAllowed('abusefilter-modify')) { // Don't allow it. return wfMsg('abusefilter-reautoconfirm-notallowed'); } $u = User::newFromName($username); global $wgMemc; $k = AbuseFilter::autoPromoteBlockKey($u); if (!$wgMemc->get($k)) { return wfMsgExt('abusefilter-reautoconfirm-none', array('parsemag'), $username); } $wgMemc->delete($k); return wfMsgExt('abusefilter-reautoconfirm-done', array('parsemag'), $username); }