selectRow( 'Comments', array( 'comment_username', 'comment_user_id' ), array( 'CommentID' => $this->getMain()->getVal( 'commentID' ) ), __METHOD__ ); if ( $s !== false ) { $userID = $s->comment_user_id; $username = $s->comment_username; } CommentFunctions::blockUser( $this->getUser(), $userID, $username ); if ( class_exists( 'UserStatsTrack' ) ) { $stats = new UserStatsTrack( $userID, $username ); $stats->incStatField( 'comment_ignored' ); } $result = $this->getResult(); $result->addValue( $this->getModuleName(), 'ok', 'ok' ); return true; } public function needsToken() { return 'csrf'; } public function isWriteMode() { return true; } public function getAllowedParams() { return array( 'commentID' => array( ApiBase::PARAM_REQUIRED => true, ApiBase::PARAM_TYPE => 'integer' ), 'UsernameKOK' => array( ApiBase::PARAM_REQUIRED => false, ApiBase::PARAM_TYPE => 'string' ) ); } }