/** * Determines if the current post is protected * * @since 4.0 * @access public * @param string * @return */ public function isProtected(EasyBlogPost &$post) { // 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 (!$post->isPasswordProtected()) { return false; } // User already entered password if ($post->verifyPassword()) { return false; } $post = EB::formatter('entry', $post); // Set the return url to the current url $return = base64_encode($post->getPermalink(false)); // Get the menu params associated with this post $this->theme->params = $post->getMenuParams(); $this->set('post', $post); parent::display('blogs/entry/default.protected'); return; }