holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r21869: LJSUP-12044: Incorrect notification

Committer: akanashin
LJSUP-12044: Incorrect notification
U   trunk/htdocs/manage/domain.bml
Modified: trunk/htdocs/manage/domain.bml
===================================================================
--- trunk/htdocs/manage/domain.bml	2012-05-02 13:49:28 UTC (rev 21868)
+++ trunk/htdocs/manage/domain.bml	2012-05-03 07:39:37 UTC (rev 21869)
@@ -56,21 +56,21 @@
             $POST{'journaldomain'} =~ s!^(http://)?(www\.)?!!;
             my $dom = lc($POST{'journaldomain'});
             if (($dom_cap && !$dom) || (!$dom_cap && $POST{'journaldomain_del'})) {
-                $dbh->do("DELETE FROM domains WHERE userid=?", undef, $u->{'userid'});
+                $dbh->do("DELETE FROM domains WHERE userid=? and type <> ?", undef, $u->{'userid'}, 'shop');
                 LJ::MemCache::delete("domain:" . $dom); 
             } else {
                 if ($dom =~ /(?:(?:живойжурнал|жж)\.рф)|(?:(?:xn--80adlbbiisqhy9a|xn--f1aa)\.xn--p1ai)/) {
                     return LJ::bad_input($ML{'domain.bml.error.domainru'});
                 }
-                $dbh->do("INSERT INTO domains VALUES (?, ?)", undef, $dom, $u->{'userid'});
+                $dbh->do("INSERT INTO domains (domain, userid, rcptid, type) VALUES (?, ?, ?, ?)", undef, $dom, $u->{'userid'}, $u->{'userid'}, 'alias');
                 if ($dbh->err) {
                     my $otherid = $dbh->selectrow_array("SELECT userid FROM domains WHERE domain=?",
                                                         undef, $dom);
                     return LJ::bad_input($ML{'.error.dupdomainalias'}) if $otherid != $u->{'userid'};
                 }
                 if ($u->{'journaldomain'}) {
-                    $dbh->do("DELETE FROM domains WHERE userid=? AND domain <> ?",
-                             undef, $u->{'userid'}, $dom);
+                    $dbh->do("DELETE FROM domains WHERE userid=? AND domain <> ? and type <> ?",
+                             undef, $u->{'userid'}, $dom, 'shop');
                 }
                 LJ::MemCache::set("domain:$dom", $u->{userid}); 
             }

Tags: akanashin, bml, holyandrew, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments