<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=MyWiki%3ADatabase_reports%2FUnusually_long_user_blocks%2FConfiguration</id>
	<title>MyWiki:Database reports/Unusually long user blocks/Configuration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=MyWiki%3ADatabase_reports%2FUnusually_long_user_blocks%2FConfiguration"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=MyWiki:Database_reports/Unusually_long_user_blocks/Configuration&amp;action=history"/>
	<updated>2026-04-29T08:59:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=MyWiki:Database_reports/Unusually_long_user_blocks/Configuration&amp;diff=12041822&amp;oldid=prev</id>
		<title>imported&gt;HaleBot: Bot: updating database report</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=MyWiki:Database_reports/Unusually_long_user_blocks/Configuration&amp;diff=12041822&amp;oldid=prev"/>
		<updated>2023-12-30T13:00:17Z</updated>

		<summary type="html">&lt;p&gt;Bot: updating database report&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This report is updated every 28 days.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rust&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Copyright 2008, 2013 bjweeks, MZMcBride, Tim Landscheidt&lt;br /&gt;
Copyright 2021 Kunal Mehta &amp;lt;legoktm@debian.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program is free software: you can redistribute it and/or modify&lt;br /&gt;
it under the terms of the GNU General Public License as published by&lt;br /&gt;
the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
(at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
This program is distributed in the hope that it will be useful,&lt;br /&gt;
but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
You should have received a copy of the GNU General Public License&lt;br /&gt;
along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use anyhow::Result;&lt;br /&gt;
use dbreps2::{escape_reason, str_vec, Frequency, Report};&lt;br /&gt;
use mysql_async::prelude::*;&lt;br /&gt;
use mysql_async::Conn;&lt;br /&gt;
&lt;br /&gt;
pub struct Row {&lt;br /&gt;
    ipb_address: String,&lt;br /&gt;
    actor_name: String,&lt;br /&gt;
    ipb_timestamp: String,&lt;br /&gt;
    ipb_expiry: String,&lt;br /&gt;
    comment_text: String,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pub struct ExcessiveUsers {}&lt;br /&gt;
&lt;br /&gt;
impl Report&amp;lt;Row&amp;gt; for ExcessiveUsers {&lt;br /&gt;
    fn title(&amp;amp;self) -&amp;gt; &amp;amp;&amp;#039;static str {&lt;br /&gt;
        &amp;quot;Unusually long user blocks&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn frequency(&amp;amp;self) -&amp;gt; Frequency {&lt;br /&gt;
        Frequency::Monthly&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn query(&amp;amp;self) -&amp;gt; &amp;amp;&amp;#039;static str {&lt;br /&gt;
        r#&amp;quot;&lt;br /&gt;
/* excessiveusers.rs SLOW_OK */&lt;br /&gt;
SELECT&lt;br /&gt;
  ipb_address,&lt;br /&gt;
  actor_name,&lt;br /&gt;
  ipb_timestamp,&lt;br /&gt;
  ipb_expiry,&lt;br /&gt;
  comment_text&lt;br /&gt;
FROM&lt;br /&gt;
  ipblocks&lt;br /&gt;
  INNER JOIN actor_ipblocks ON ipb_by_actor = actor_id&lt;br /&gt;
  INNER JOIN comment_ipblocks ON ipb_reason_id = comment_id&lt;br /&gt;
WHERE&lt;br /&gt;
  ipb_expiry &amp;gt; DATE_FORMAT(DATE_ADD(NOW(), INTERVAL 2 YEAR), &amp;#039;%Y%m%d%H%i%s&amp;#039;)&lt;br /&gt;
  AND ipb_expiry != &amp;quot;infinity&amp;quot;&lt;br /&gt;
  AND ipb_user != 0;&lt;br /&gt;
&amp;quot;#&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    async fn run_query(&amp;amp;self, conn: &amp;amp;mut Conn) -&amp;gt; Result&amp;lt;Vec&amp;lt;Row&amp;gt;&amp;gt; {&lt;br /&gt;
        let rows = conn&lt;br /&gt;
            .query_map(&lt;br /&gt;
                self.query(),&lt;br /&gt;
                |(&lt;br /&gt;
                    ipb_address,&lt;br /&gt;
                    actor_name,&lt;br /&gt;
                    ipb_timestamp,&lt;br /&gt;
                    ipb_expiry,&lt;br /&gt;
                    comment_text,&lt;br /&gt;
                )| Row {&lt;br /&gt;
                    ipb_address,&lt;br /&gt;
                    actor_name,&lt;br /&gt;
                    ipb_timestamp,&lt;br /&gt;
                    ipb_expiry,&lt;br /&gt;
                    comment_text,&lt;br /&gt;
                },&lt;br /&gt;
            )&lt;br /&gt;
            .await?;&lt;br /&gt;
        Ok(rows)&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn intro(&amp;amp;self) -&amp;gt; &amp;amp;&amp;#039;static str {&lt;br /&gt;
        &amp;quot;Unusually long (more than two years) blocks of users&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn headings(&amp;amp;self) -&amp;gt; Vec&amp;lt;&amp;amp;&amp;#039;static str&amp;gt; {&lt;br /&gt;
        vec![&amp;quot;User&amp;quot;, &amp;quot;Admin&amp;quot;, &amp;quot;Timestamp&amp;quot;, &amp;quot;Expiry&amp;quot;, &amp;quot;Reason&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn format_row(&amp;amp;self, row: &amp;amp;Row) -&amp;gt; Vec&amp;lt;String&amp;gt; {&lt;br /&gt;
        str_vec![&lt;br /&gt;
            format!(&amp;quot;{{{{User|1={}}}}}&amp;quot;, &amp;amp;row.ipb_address),&lt;br /&gt;
            format!(&amp;quot;[[User talk:{}|]]&amp;quot;, &amp;amp;row.actor_name),&lt;br /&gt;
            row.ipb_timestamp,&lt;br /&gt;
            row.ipb_expiry,&lt;br /&gt;
            escape_reason(&amp;amp;row.comment_text)&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn code(&amp;amp;self) -&amp;gt; &amp;amp;&amp;#039;static str {&lt;br /&gt;
        include_str!(&amp;quot;excessiveusers.rs&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;HaleBot</name></author>
	</entry>
</feed>