Guest User

Untitled

a guest
Feb 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Index: /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb
  2. ===================================================================
  3. --- /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1873)
  4. +++ /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (working copy)
  5. @@ -119,6 +119,11 @@
  6.  
  7. + unless @params[:paste][:authorization]=="burger" or @paste.textmate_html
  8. + flash[:notice]="You appear to be a bot, I can't accept your paste. JS is now required to paste."
  9. + render :action => "edit" and return
  10. + end
  11. +
  12.  
  13. Index: /Users/jgoebel/rails/pastie/app/views/pastes/edit.rhtml
  14. ===================================================================
  15. --- /Users/jgoebel/rails/pastie/app/views/pastes/edit.rhtml (revision 1873)
  16. +++ /Users/jgoebel/rails/pastie/app/views/pastes/edit.rhtml (working copy)
  17. @@ -30,7 +30,9 @@
  18. <%= javascript_tag "toggle_private();" %>
  19.  
  20. <p>
  21. -<%= text_area 'paste', 'body', :class=>"pastebox", :tabindex => "20" %></p>
  22. +<%= text_area 'paste', 'body', :class=>"pastebox", :tabindex => "20" %>
  23. +<%= hidden_field_tag 'paste[authorization]', "booger", :id => "paste_authorization" %>
  24. +</p>
  25. <input type="hidden" name="key" value="<%=@paste.access_key%>">
  26.  
  27. <%= submit_tag (@paste.body.blank? ? 'Paste' : 'Save Paste'), :id => "submit", :class => "submit", :tabindex => "30" %>
  28. @@ -56,3 +58,7 @@
  29. <%= end_form_tag %>
  30.  
  31. <%= javascript_tag "$('paste_body').focus();" %>
  32. +
  33. +<% if @paste.new_record? %>
  34. +<%= javascript_tag "$('paste_authorization').value='burger';" %>
  35. +<% end %>
Add Comment
Please, Sign In to add comment