Advertisement
Guest User

Untitled

a guest
Oct 5th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. {% extends 'admin/master.html' %}
  2. {% block body %}
  3. {{ super() }}
  4.  
  5. <script>
  6. //Submits an invalid authentication header, causing the user to be 'logged out'
  7. function logout() {
  8. $.ajax({
  9. type: "GET",
  10. url: "/admin/",
  11. dataType: 'json',
  12. async: true,
  13. username: "fake username",
  14. password: "fake password",
  15. data: '{ "comment" }'
  16. })
  17. //In our case, we WANT to get access denied, so a success would be a failure.
  18. .done(function(){
  19. alert('Error!')
  20. })
  21. //Likewise, a failure *usually* means we succeeded.
  22. //set window.location to redirect the user to wherever you want them to go
  23. .fail(function(){
  24. window.location = "/";
  25. });
  26. }
  27. </script>
  28.  
  29.  
  30. <!-- HTML button linked to the JS logout() function defined above -->
  31. <button type="button" onclick=logout()>End Session</button>
  32.  
  33.  
  34. <div class="container">
  35. <div class="row">
  36. <div class="col-sm-10 col-sm-offset-1">
  37. <h1>Admin View</h1>
  38. <p class="lead">
  39. The <a href="http://0.0.0.0:5000/admin/storedwords/">Stored Words</a> panel provides a management interface for the audio files recorded by participants.
  40. </p>
  41.  
  42. <p>
  43. </p>
  44. </div>
  45. </div>
  46. </div>
  47. {% endblock body %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement