/** * Determines if the current post is protected * * @since 4.0 * @access public * @param string * @return */ public function isProtected(EasyBlogPost &$blog) { // Password protection disabled if (!$this->config->get('main_password_protect')) { return false; } // Site admin should not be restricted if (EB::isSiteAdmin()) { return false; } // Blog does not contain any password protection if (empty($blog->blogpassword)) { return false; } // User already entered password if ($blog->verifyPassword()) { return false; } // Set the return url to the current url $return = base64_encode(JRequest::getURI()); $category = $blog->getPrimaryCategory(); $blog->category = $category; $blog->categories = $blog->getCategories(); // Get the blogger object $blogger = EB::user($blog->created_by); // Set the author object into the table. $blog->author = $blogger; $this->set('blogger', $blog->author); $this->set('return', $return); $this->set('blog', $blog); $this->set('category', $category); parent::display('blogs/entry/default.protected'); return; }