diff --git a/core/components/quip/controllers/web/Thread.php b/core/components/quip/controllers/web/Thread.php index a9c253d..dfde4f5 100644 --- a/core/components/quip/controllers/web/Thread.php +++ b/core/components/quip/controllers/web/Thread.php @@ -333,7 +333,12 @@ public function checkPermissions() { public function handleActions() { /* handle remove post */ $removeAction = $this->getProperty('removeAction','quip-remove'); - if (!empty($_REQUEST[$removeAction]) && $this->hasAuth && $this->isModerator) { + + /* handle author remove their own comment even when they are not moderator */ + $currentComment = $this->getComments()[(int)$_REQUEST['quip_comment']]; + + if (!empty($_REQUEST[$removeAction]) && $this->hasAuth && ($this->isModerator + || (!empty($currentComment) && $currentComment->get('author') == $this->modx->user->get('id')))) { $this->removeComment(); } /* handle report spam */ @@ -480,4 +485,4 @@ public function render(array $comments = array()) { return implode("\n",$list); } } -return 'QuipThreadController'; \ No newline at end of file +return 'QuipThreadController'; diff --git a/core/components/quip/model/quip/mysql/quipcomment.map.inc.php b/core/components/quip/model/quip/mysql/quipcomment.map.inc.php index 2bc65f0..f9fa542 100644 --- a/core/components/quip/model/quip/mysql/quipcomment.map.inc.php +++ b/core/components/quip/model/quip/mysql/quipcomment.map.inc.php @@ -90,7 +90,7 @@ 'body' => array ( 'dbtype' => 'text', - 'phptype' => 'text', + 'phptype' => 'string', 'null' => false, 'default' => '', ), diff --git a/core/components/quip/model/quip/sqlsrv/quipcomment.map.inc.php b/core/components/quip/model/quip/sqlsrv/quipcomment.map.inc.php index 5f03f5f..ea36cf8 100644 --- a/core/components/quip/model/quip/sqlsrv/quipcomment.map.inc.php +++ b/core/components/quip/model/quip/sqlsrv/quipcomment.map.inc.php @@ -89,7 +89,7 @@ array ( 'dbtype' => 'nvarchar', 'precision' => 'max', - 'phptype' => 'text', + 'phptype' => 'string', 'null' => false, 'default' => '', ), diff --git a/core/components/quip/model/schema/quip.mysql.schema.xml b/core/components/quip/model/schema/quip.mysql.schema.xml index cdf7f7c..85de8cd 100644 --- a/core/components/quip/model/schema/quip.mysql.schema.xml +++ b/core/components/quip/model/schema/quip.mysql.schema.xml @@ -45,7 +45,7 @@ - + diff --git a/core/components/quip/model/schema/quip.sqlsrv.schema.xml b/core/components/quip/model/schema/quip.sqlsrv.schema.xml index 9b819c1..6edf5b3 100644 --- a/core/components/quip/model/schema/quip.sqlsrv.schema.xml +++ b/core/components/quip/model/schema/quip.sqlsrv.schema.xml @@ -48,7 +48,7 @@ - +