Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * 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;
 }