Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function redirect($headers, $pageParams)
- {
- $uamOptions = $this->getAdminOptions();
- if (isset($_GET['uamgetfile'])
- && isset($_GET['uamfiletype'])
- ) {
- $fileUrl = $_GET['uamgetfile'];
- $fileType = $_GET['uamfiletype'];
- $this->getFile($fileType, $fileUrl);
- } elseif (!$this->atAdminPanel() && $uamOptions['redirect'] != 'false') {
- $object = null;
- if (isset($pageParams->query_vars['p'])) {
- $object = get_post($pageParams->query_vars['p']);
- $objectType = $object->post_type;
- $objectId = $object->ID;
- } elseif (isset($pageParams->query_vars['page_id'])) {
- $object = get_post($pageParams->query_vars['page_id']);
- $objectType = $object->post_type;
- $objectId = $object->ID;
- } elseif (isset($pageParams->query_vars['cat_id'])) {
- $object = get_category($pageParams->query_vars['cat_id']);
- $objectType = 'category';
- $objectId = $object->term_id;
- }
- if ($object === null
- ||$object !== null
- && !$this->getAccessHandler()->checkObjectAccess($objectType, $objectId)
- ) {
- $this->redirectUser($object);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment