Remove unused sysban types.

        Patch by denise. 

diffs (175 lines):

diff -r cbf80d2d289a -r 793d8bd3906c bin/ljsysban.pl
--- a/bin/ljsysban.pl   Wed Jul 22 01:56:19 2009 +0000
+++ b/bin/ljsysban.pl   Wed Jul 22 02:25:05 2009 +0000
@@ -46,7 +46,7 @@ require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl
 require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl";
 my $dbh = LJ::get_db_writer();
 
-# list bands
+# list bans
 if ($list) {
     my $where;
     if ($banid) {
@@ -113,11 +113,6 @@ if ($add) {
                                          'exptime' => 
LJ::mysqldate_to_time($banuntil) });
         LJ::MemCache::delete("sysban:uniq");
     }
-    if ($what eq 'contentflag') {
-        LJ::procnotify_add("ban_contentflag", { 'username' => $value,
-                                                'exptime' => 
LJ::mysqldate_to_time($banuntil) });
-        LJ::MemCache::delete("sysban:contentflag");
-    }
 
     # log in statushistory
     LJ::statushistory_add(0, 0, 'sysban_add',
@@ -154,11 +149,6 @@ if ($modify) {
             LJ::procnotify_add("unban_uniq", { 'uniq' => $value || 
$ban->{'value'} });
             LJ::MemCache::delete("sysban:uniq");
         }
-
-        if ($ban->{'what'} eq 'contentflag') {
-            LJ::procnotify_add("unban_contentflag", { 'username' => $value || 
$ban->{'value'} });
-            LJ::MemCache::delete("sysban:contentflag");
-        }
     }
         
     # what - must have a value
@@ -184,12 +174,6 @@ if ($modify) {
             LJ::procnotify_add("ban_uniq", { 'uniq' => $value || 
$ban->{'value'},
                                              'exptime' => 
LJ::mysqldate_to_time($new_banuntil) });
             LJ::MemCache::delete("sysban:uniq");
-        }
-
-        if ($ban->{'what'} eq 'contentflag') {
-            LJ::procnotify_add("ban_contentflag", { 'username' => $value || 
$ban->{'value'},
-                                                    'exptime' => 
LJ::mysqldate_to_time($new_banuntil) });
-            LJ::MemCache::delete("sysban:contentflag");
         }
     }
 
diff -r cbf80d2d289a -r 793d8bd3906c cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl  Wed Jul 22 01:56:19 2009 +0000
+++ b/cgi-bin/ljlib.pl  Wed Jul 22 02:25:05 2009 +0000
@@ -2062,17 +2062,6 @@ sub procnotify_callback
         return;
     }
 
-    # contentflag key bans
-    if ($cmd eq "ban_contentflag") {
-        $LJ::CONTENTFLAG_BANNED{$arg->{'username'}} = $arg->{'exptime'};
-        return;
-    }
-
-    if ($cmd eq "unban_contentflag") {
-        delete $LJ::CONTENTFLAG_BANNED{$arg->{'username'}};
-        return;
-    }
-
     # cluster switchovers
     if ($cmd eq 'cluster_switch') {
         $LJ::CLUSTER_PAIR_ACTIVE{ $arg->{'cluster'} } = $arg->{ 'role' };
diff -r cbf80d2d289a -r 793d8bd3906c cgi-bin/sysban.pl
--- a/cgi-bin/sysban.pl Wed Jul 22 01:56:19 2009 +0000
+++ b/cgi-bin/sysban.pl Wed Jul 22 02:25:05 2009 +0000
@@ -87,41 +87,6 @@ sub sysban_check {
         return $LJ::UNIQ_BANNED{$value};
     }
 
-    # cache if contentflag ban
-    if ($what eq 'contentflag') {
-
-        # check memcache first if not loaded
-        unless ($LJ::CONTENTFLAG_BANNED_LOADED) {
-            my $memval = LJ::MemCache::get("sysban:contentflag");
-            if ($memval) {
-                *LJ::CONTENTFLAG_BANNED = $memval;
-                $LJ::CONTENTFLAG_BANNED_LOADED++;
-            }
-        }
-
-        # is it already cached in memory?
-        if ($LJ::CONTENTFLAG_BANNED_LOADED) {
-            return (defined $LJ::CONTENTFLAG_BANNED{$value} &&
-                    ($LJ::CONTENTFLAG_BANNED{$value} == 0 ||     # forever
-                     $LJ::CONTENTFLAG_BANNED{$value} > time())); # not-expired
-        }
-
-        # set this now before the query
-        $LJ::CONTENTFLAG_BANNED_LOADED++;
-
-        LJ::sysban_populate(\%LJ::CONTENTFLAG_BANNED, "contentflag")
-            or return undef $LJ::CONTENTFLAG_BANNED_LOADED;
-
-        # set in memcache
-        my $exp = 60*15; # 15 minutes
-        LJ::MemCache::set("sysban:contentflag", \%LJ::CONTENTFLAG_BANNED, 
$exp);
-
-        # return value to user
-        return (defined $LJ::CONTENTFLAG_BANNED{$value} &&
-                ($LJ::CONTENTFLAG_BANNED{$value} == 0 ||     # forever
-                 $LJ::CONTENTFLAG_BANNED{$value} > time())); # not-expired
-    }
-
     # need the db below here
     my $dbr = LJ::get_db_reader();
     return undef unless $dbr;
@@ -377,11 +342,6 @@ sub sysban_create {
         LJ::MemCache::delete("sysban:uniq");
     }
 
-    if ($opts{'what'} eq 'contentflag') {
-        LJ::procnotify_add("ban_contentflag", { 'username' => $opts{'value'}, 
exptime => $exptime});
-        LJ::MemCache::delete("sysban:contentflag");
-    }
-
     # log in statushistory
     my $remote = LJ::get_remote();
     $banuntil = $opts{'bandays'} ? LJ::mysql_time($exptime) : "forever";
@@ -472,7 +432,6 @@ sub sysban_validate {
                'support_uniq' => 'uniq',
                'lostpassword' => 'user',
                'talk_ip_test' => 'ip',
-               'contentflag' => 'user',
                'invite_user' => 'user',
                'invite_email' => 'email',
                );
diff -r cbf80d2d289a -r 793d8bd3906c doc/raw/lj.book/admin/sysban.xml
--- a/doc/raw/lj.book/admin/sysban.xml  Wed Jul 22 01:56:19 2009 +0000
+++ b/doc/raw/lj.book/admin/sysban.xml  Wed Jul 22 02:25:05 2009 +0000
@@ -39,10 +39,6 @@
     <varlistentry>
       <term><varname>uniq</varname></term>
       <listitem><para>Blocked if value of unique cookie (from 
<uri>/admin/userlog.bml</uri>) matches.</para></listitem>
-    </varlistentry>
-    <varlistentry>
-      <term><varname>contentflag</varname></term>
-      <listitem><para>Blocked if value (username) matches.</para></listitem>
     </varlistentry>
   </variablelist>
 
diff -r cbf80d2d289a -r 793d8bd3906c doc/raw/memcache-keys.txt
--- a/doc/raw/memcache-keys.txt Wed Jul 22 01:56:19 2009 +0000
+++ b/doc/raw/memcache-keys.txt Wed Jul 22 02:25:05 2009 +0000
@@ -63,7 +63,6 @@
 
 sysban:ip == hashref of ip => unix expiration time
 sysban:uniq == hashref of uniq => unix expiration time
-sysban:contentflag == hashref of username => unix expiration time
 
 <uid> userpic2:<uid> == arrayref of hashrefs of userpic2 rows
 
diff -r cbf80d2d289a -r 793d8bd3906c htdocs/admin/sysban.bml
--- a/htdocs/admin/sysban.bml   Wed Jul 22 01:56:19 2009 +0000
+++ b/htdocs/admin/sysban.bml   Wed Jul 22 02:25:05 2009 +0000
@@ -30,9 +30,9 @@ body<=
         return "<?h1 Error h1?><?p $_[0] p?><?p $main_return p?>";
      };
     my $priv = 'sysban';
-    my @all_sb_args = qw( ip uniq email email_domain user pay_cc msisdn 
+    my @all_sb_args = qw( ip uniq email email_domain user pay_cc 
                           pay_user pay_email pay_uniq support_user 
-                          support_uniq lostpassword  talk_ip_test contentflag
+                          support_uniq lostpassword  talk_ip_test 
                           invite_user invite_email );
 
     my $remote = LJ::get_remote();
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to