журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22747: LJSUP-13430: Add error message on update...

Committer: nnikulochkina
LJSUP-13430: Add error message on update.bml
U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2012-08-27 15:21:32 UTC (rev 22746)
+++ trunk/bin/upgrading/en.dat	2012-08-28 07:33:04 UTC (rev 22747)
@@ -10221,6 +10221,9 @@
 xmlrpc.error.223|staleness=1
 xmlrpc.error.223=Repost budget is empty
 
+xmlrpc.error.224|staleness=1
+xmlrpc.error.224=Repost budget is not numeic
+
 xmlrpc.error.300|staleness=1
 xmlrpc.error.300=Don't have access to requested journal
 

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-08-27 15:21:32 UTC (rev 22746)
+++ trunk/cgi-bin/ljprotocol.pl	2012-08-28 07:33:04 UTC (rev 22747)
@@ -102,6 +102,7 @@
      "221" => E_PERM,
      "222" => E_PERM,    
      "223" => E_TEMP,
+     "224" => E_TEMP,
 
      # Access Errors
      "300" => E_TEMP,
@@ -2433,6 +2434,10 @@
     if (LJ::is_enabled("paid_repost")) {
         my $error;
 
+        if ($req->{'repost_budget'} && $req->{'repost_budget'} =~ /\D/) {
+            return fail($err,224);
+        }
+
         $repost_offer = LJ::Pay::Repost::Offer->from_create_entry(
             \$event, 
             {repost_budget => $req->{'repost_budget'},
@@ -3287,6 +3292,20 @@
     if (LJ::is_enabled("paid_repost") && $req->{'event'} =~ /\S/) {
         my $error;
 
+        if(!$curprops{$itemid}->{repost_offer} &&
+           $req->{paid_repost_on} &&
+           !$req->{repost_budget}) {
+            return fail($err,223);
+        }
+
+        if ($req->{repost_budget} && $req->{repost_budget} =~ /\D/){
+            return fail($err,224);
+        }
+
+        if ($req->{add_repost_budget} && $req->{add_repost_budget} =~ /\D/){
+            return fail($err,224);
+        }
+
         ($repost_offer, $repost_offer_action) = LJ::Pay::Repost::Offer->from_edit_entry(
             \$req->{event},
             {

Tags: dat, livejournal, nikulochkina, nnikulochkina, pl
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