Guest User

Untitled

a guest
Mar 22nd, 2011
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. public function redirect($headers, $pageParams)
  2. {
  3. $uamOptions = $this->getAdminOptions();
  4.  
  5. if (isset($_GET['uamgetfile'])
  6. && isset($_GET['uamfiletype'])
  7. ) {
  8. $fileUrl = $_GET['uamgetfile'];
  9. $fileType = $_GET['uamfiletype'];
  10. $this->getFile($fileType, $fileUrl);
  11. } elseif (!$this->atAdminPanel() && $uamOptions['redirect'] != 'false') {
  12. $object = null;
  13.  
  14. if (isset($pageParams->query_vars['p'])) {
  15. $object = get_post($pageParams->query_vars['p']);
  16. $objectType = $object->post_type;
  17. $objectId = $object->ID;
  18. } elseif (isset($pageParams->query_vars['page_id'])) {
  19. $object = get_post($pageParams->query_vars['page_id']);
  20. $objectType = $object->post_type;
  21. $objectId = $object->ID;
  22. } elseif (isset($pageParams->query_vars['cat_id'])) {
  23. $object = get_category($pageParams->query_vars['cat_id']);
  24. $objectType = 'category';
  25. $objectId = $object->term_id;
  26. }
  27.  
  28. if ($object === null
  29. ||$object !== null
  30. && !$this->getAccessHandler()->checkObjectAccess($objectType, $objectId)
  31. ) {
  32. $this->redirectUser($object);
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment