<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1341: Delete spam users from ckan</title>
    <link>http://localhost/ticket/1341</link>
    <description>&lt;p&gt;
Spam users where added to thedatahub and we need to clean them.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1341</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Wed, 14 Sep 2011 10:32:48 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/1341#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1341#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
This was run to delete the users and their mistaken revisions that where created.
&lt;/p&gt;
&lt;pre class="wiki"&gt;BEGIN;
delete from revision r where r.id in (
    select r.id from "user" join revision r on r.author = "user".name
    left join resource_revision rr on rr.revision_id = r.id
    left join package_revision pr on pr.revision_id = r.id
    left join group_revision gr on gr.revision_id = r.id
    where "user".created between '2011-08-15' and '2011-09-06'
    and gr.id is null and rr.id is null and pr.id is null
    and ("user".name similar to '%[0-9]' or "user".fullname similar to '[A-Z][a-z]*[A-Z]%')
    and "user".name not like 'http%'
);
delete from "user" u where u.id in (
    select "user".id from "user"
    left join revision r on r.author = "user".name
    where r.id is null and "user".created between '2011-08-15' and '2011-09-06'
    and ("user".name similar to '%[0-9]' or "user".fullname similar to '[A-Z][a-z]*[A-Z]%')
    and "user".name not like 'http%'
);
COMMIT;
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 26 Oct 2011 17:19:33 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1341#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1341#comment:2</guid>
      <description>
        &lt;p&gt;
The majority of our 6000 users are still spammers. Can we simply elimenate those who've not made any revisions? Even if we take a few genuine users with it, these are pretty dead accounts anyway.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Thu, 27 Oct 2011 10:06:37 GMT</pubDate>
      <title>status changed; resolution deleted</title>
      <link>http://localhost/ticket/1341#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/1341#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;closed&lt;/em&gt; to &lt;em&gt;reopened&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                &lt;em&gt;fixed&lt;/em&gt; deleted
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Reopening - this is still a serious problem. We can't link to the user page because it is so embarrassing: &lt;a class="ext-link" href="http://thedatahub.org/user"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://thedatahub.org/user&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Tue, 01 Nov 2011 09:59:00 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/1341#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/1341#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-sprint-2011-09-12&lt;/em&gt; to &lt;em&gt;ckan-backlog&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>