issue 367, fixed a bug for do not write comment when document is secret

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9530 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-10-10 08:03:03 +00:00
parent 20d1bd80ee
commit 7ee41a75bd

View file

@ -465,7 +465,7 @@
} }
function getComments() { function getComments() {
if(!$this->allowComment() || !$this->getCommentCount()) return; if(!$this->getCommentCount()) return;
if(!$this->isGranted() && $this->isSecret()) return; if(!$this->isGranted() && $this->isSecret()) return;
// cpage is a number of comment pages // cpage is a number of comment pages
$cpage = Context::get('cpage'); $cpage = Context::get('cpage');
@ -704,9 +704,9 @@
function isEnableComment() { function isEnableComment() {
// Return false if not authorized, if a secret document, if the document is set not to allow any comment // Return false if not authorized, if a secret document, if the document is set not to allow any comment
// old version allowed admin(isGranted() method use), but admin not allow comment below condition // old version allowed admin(isGranted() method use), but admin not allow comment below condition
if( $this->isSecret() || $this->isLocked() || !$this->allowComment() ) return false; if( $this->isGranted() && $this->allowComment() ) return true;
return true; return false;
} }
/** /**