Committer: akanashin
LJSUP-11857: Cyr sub domainsU trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm 2012-04-24 10:43:21 UTC (rev 11768) +++ trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm 2012-04-24 10:49:48 UTC (rev 11769) @@ -32,6 +32,9 @@ my $current = $self->authas || $remote; my $buy_manage = LJ::Request->get_param('type'); + my $delete = LJ::Request->get_param('delete'); + my $auth = LJ::Request->get_param('auth'); + my $dom = LJ::Request->get_param('dom'); my $authas_opts = { 'authas' => $current->user, @@ -42,6 +45,10 @@ 'type' => 'S', }; + if ($delete && grep {$auth} [ LJ::get_authas_list($remote, $authas_opts) ]) { + LJ::Pay::Payment::PayItem::DomainRU->delete_domains($auth, $dom); + } + my $domains = LJ::Pay::Payment::PayItem::DomainRU->get_domains(); my %ret = ( @@ -70,16 +77,10 @@ sub process_post_request { my ($self) = @_; - my $action = LJ::Request->post_param('action'); my $src_name = LJ::Request->post_param('src_name'); my $remote = LJ::get_remote(); my $authas = LJ::load_user(LJ::Request->post_param('authas'))->userid; - if ($action eq 'delete') { - LJ::Pay::Payment::PayItem::DomainRU->delete_domains($authas, $src_name); - return LJ::Request->redirect( "$LJ::SITEROOT/shop/domain_ru.bml?type=manage" ); - } - my @subitem_params = ( $src_name, $authas, );