Allow us to disable external sites via the config.

        Patch by fu. 

diffs (38 lines):

diff -r 61e82aece0c1 -r 69f3d5ce5d9d cgi-bin/DW/External/Site.pm
--- a/cgi-bin/DW/External/Site.pm       Tue May 03 11:18:42 2011 +0800
+++ b/cgi-bin/DW/External/Site.pm       Tue May 03 18:02:18 2011 +0800
@@ -86,7 +86,7 @@ sub get_sites { return values %domaintos
 # returns a list of all supported sites for crossposting
 sub get_xpost_sites {
     my %protocols = DW::External::XPostProtocol->get_all_protocols;
-    return grep { exists $protocols{ $_->{servicetype} } }
+    return grep { exists $protocols{ $_->{servicetype} } && LJ::is_enabled( 
"external_sites", $_ ) }
            values %domaintosite;
 }
 
diff -r 61e82aece0c1 -r 69f3d5ce5d9d cgi-bin/LJ/Widget/ImportChooseSource.pm
--- a/cgi-bin/LJ/Widget/ImportChooseSource.pm   Tue May 03 11:18:42 2011 +0800
+++ b/cgi-bin/LJ/Widget/ImportChooseSource.pm   Tue May 03 18:02:18 2011 +0800
@@ -33,7 +33,9 @@ sub render_body {
     return $class->ml( 'widget.importchoosesource.disabled' )
         unless LJ::is_enabled('importing');
 
-    my @services = (
+    my @services;
+
+    for my $service ( (
         {
             name => 'livejournal',
             url => 'livejournal.com',
@@ -49,7 +51,10 @@ sub render_body {
             url => 'journalfen.net',
             display_name => 'JournalFen',
         },
-    );
+    ) ){
+        push @services, $service
+            if LJ::is_enabled( "external_sites", { sitename => 
$service->{display_name}, domain => $service->{url} } );
+    }
 
     my $ret;
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to