Committer: gariev
LJSUP-10578: Comments for side projects (Digital october) - add new partnerU trunk/cgi-bin/LJ/PartnerSite.pm
Modified: trunk/cgi-bin/LJ/PartnerSite.pm =================================================================== --- trunk/cgi-bin/LJ/PartnerSite.pm 2011-12-02 08:59:06 UTC (rev 11237) +++ trunk/cgi-bin/LJ/PartnerSite.pm 2011-12-02 14:27:28 UTC (rev 11238) @@ -141,7 +141,7 @@ =item * -domain: the domain of the partner's site +domain: the domain of the partner's site (string or array ref with list of all possible domains) =item * @@ -405,7 +405,7 @@ $entry = LJ::Entry->new( $self->journal, 'jitemid' => $protocol_res->{'itemid'} ); - $self->insert_mapping( $entry, $docid ); + $self->replace_mapping( $entry, $docid ); my $sclient = LJ::theschwartz(); if ($sclient) { @@ -520,7 +520,10 @@ my ( $self, $domain ) = @_; my $self_domain = $self->domain; - return ( $domain =~ /^(?:.*\.)?\Q$self_domain\E$/ ) ? 1 : 0; + foreach my $d (ref $self_domain ? @$self_domain : ($self_domain)) { + return 1 if $domain =~ /^(?:.*\.)?\Q$d\E$/; + } + return 0; } =item * @@ -542,7 +545,9 @@ sub domain_check_js { my ($self, $opts) = @_; - my $domains_out = LJ::JSON->to_json([ $self->domain ]); + my $domain_list = $self->domain; + $domain_list = [$domain_list] unless ref $domain_list; + my $domains_out = LJ::JSON->to_json($domain_list); if ( $opts->{'mode'} eq 'logcom' ) { my $uri