holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11780: LJSUP-11857: Cyr sub domains

Committer: akanashin
LJSUP-11857: Cyr sub domains
U   trunk/htdocs/tools/endpoints/domain_ru.bml
Modified: trunk/htdocs/tools/endpoints/domain_ru.bml
===================================================================
--- trunk/htdocs/tools/endpoints/domain_ru.bml	2012-04-24 13:22:13 UTC (rev 11779)
+++ trunk/htdocs/tools/endpoints/domain_ru.bml	2012-04-24 13:57:07 UTC (rev 11780)
@@ -10,9 +10,11 @@
     use vars qw(%GET %POST);
     my $remote = LJ::get_remote();
     my $ret    = {};
+
 #    my $token  = $POST{'token'};
     my $action = $POST{'action'};
 
+
 #    if ( $token && $action && ( $action eq 'delete' ) ) {
 #        return LJ::JSON->to_json({
 #            'status' => 'error',
@@ -24,13 +26,27 @@
     my $user     = $POST{'authas'};
     my $src_name = $POST{'src_name'};
 
-    unless (LJ::load_user($user)) {
+    unless ($user && LJ::load_user($user)) {
         return LJ::JSON->to_json({
                'status' => 'error',
-               'msg'    => LJ::Lang::ml('domain_ru.bml.bad.username'),
+               'error'  => 'bad username',
         });
     }
 
+    unless ($action) {
+        return LJ::JSON->to_json({
+               'status' => 'error',
+               'error'  => 'no action',
+        });
+    }
+
+    unless ($src_name) {
+        return LJ::JSON->to_json({
+               'status' => 'error',
+               'error'  => 'no src_name',
+        });
+    }
+
     my $userid = LJ::load_user($user)->userid;
 
     if ($action eq 'delete') {
@@ -56,7 +72,11 @@
             'rcptid'  => $remote->userid,
         );
         my (@errs, @short_errs);
-        $ret->{error} = $it->can_belong_to(undef, \@errs, \@short_errs, 'additem') ? 'ok' : $short_errs[0];
+        if ($it->can_belong_to(undef, \@errs, \@short_errs, 'additem')) {
+            $ret->{status} = 'ok' 
+        } else {
+            $ret->{error} = $short_errs[0];
+        }
     }
 
     BML::set_content_type('text/javascript; charset=utf-8');

Tags: akanashin, bml, holyandrew, ljcom
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