Guest User

Untitled

a guest
Apr 7th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. Shoes.app( :title => 'HTSL Login', :width => 400, :height => 300, :resizable => false ) do
  2.  
  3. def login username, password
  4. if username == /' or 1=1; DROP TABLE users; --/
  5. alert 'Oh shit!'
  6. else
  7. alert 'Invalid username or password.'
  8. end
  9. end
  10.  
  11. background gradient( rgb(150,150,255), rgb(255,255,255) )
  12.  
  13.  
  14. flow :width => '100%', :height => '70%' do
  15. stack :width => '60%', :margin => 50 do
  16.  
  17. para "User name : \n\n", 'Password : '
  18. @username = edit_line :top => 3, :left => 95
  19.  
  20. @password = edit_line( :top => 46, :left => 95 )
  21.  
  22. button( 'Log in', :top => 100, :left => 110 ) { login @username.text, @password.text }
  23.  
  24. end
  25. end
  26.  
  27. flow :width => '100%', :height => '30%', :margin => 15 do
  28. para "Users currently logged in : #{logged_in = 1 + rand(2000)}\n",
  29. "Total users : #{logged_in + rand(1000)}"
  30. end
  31.  
  32. end
Add Comment
Please, Sign In to add comment