auditController.php 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. class auditController extends Staple_Controller
  3. {
  4. public function _start()
  5. {
  6. $auth = Staple_Auth::get();
  7. $this->authLevel = $auth->getAuthLevel();
  8. if($this->authLevel < 900)
  9. {
  10. header("location:".$this->_link(array('index','index'))."");
  11. }
  12. }
  13. public function index()
  14. {
  15. if(array_key_exists('items',$_GET))
  16. {
  17. $_SESSION['items'] = $_GET['items'];
  18. }
  19. if(array_key_exists('items',$_SESSION))
  20. {
  21. $items = $_SESSION['items'];
  22. }
  23. else
  24. {
  25. $items = 20;
  26. }
  27. if(array_key_exists('page',$_GET))
  28. {
  29. $page = $_GET['page'];
  30. }
  31. else
  32. {
  33. $page = 1;
  34. }
  35. $audit = new auditModel();
  36. $auditLog = $audit->getAll($page,$items);
  37. $this->view->audit = $auditLog;
  38. $this->view->pager = $audit->getPager();
  39. }
  40. }
  41. ?>