sessions.php 888 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // Expecting the context to be a user
  3. global $context;
  4. ?>
  5. <!doctype html>
  6. <head>
  7. <meta charset="utf8"/>
  8. <title>Sessions for <?=$context->name?></title>
  9. <script src="js/juju/core.js"></script>
  10. <script src="js/juju/page.js"></script>
  11. <script src="js/juju/dom.js"></script>
  12. <script src="js/juju/canvas.js"></script>
  13. <script src="js/juju/fetch.js"></script>
  14. <script src="js/sessions.js"></script>
  15. <link rel="stylesheet" href="css/main.css"></link>
  16. </head>
  17. <body>
  18. <a href="<?=Router::url(Router::$base)?>">Home</a>
  19. <ul>
  20. <?php
  21. foreach($context->sessions as $session){
  22. echo "<li>{$session['ip']}".($session['id']==Bugs::session()?" (You)":'')."<br/>{$session['info']}".($context->id == Bugs::$user->id?"<br/><button class=\"session-delete\" name=\"{$session['id']}\" value=\"Delete\">Delete</button>":'')."</li>";
  23. }
  24. ?>
  25. </ul>
  26. </body>
  27. </html>