Skip to content

Commit

Permalink
skipped t&c check
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbung committed Nov 4, 2014
1 parent 539ad79 commit 122be79
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions easyblog/easyblog/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public function post() {

if (!$blogId) {
$this->plugin->setResponse( $this->getErrorResponse(404, 'Invalid Blog') );
return;
}

// @task: Cleanup posted values.
Expand All @@ -94,7 +93,6 @@ public function post() {
if(! $this->_validateFields($post))
{
$this->plugin->setResponse( $this->getErrorResponse(500, $this->err[0]) );
return;
}

// @task: Akismet detection service.
Expand All @@ -111,7 +109,6 @@ public function post() {
if( EasyBlogHelper::getHelper( 'Akismet' )->isSpam( $data ) )
{
$this->plugin->setResponse( $this->getErrorResponse(500, JText::_('COM_EASYBLOG_SPAM_DETECTED_IN_COMMENT')) );
return false;
}
}

Expand All @@ -131,11 +128,6 @@ public function post() {
// @task: Bind posted values into the table.
$comment->bindPost( $post );

if( !EasyBlogHelper::getHelper( 'Captcha' )->verify( $post ) )
{
return EasyBlogHelper::getHelper( 'Captcha' )->getError( $ajax , $post );
}

// @task: Process registrations
$registerUser = isset( $post[ 'esregister' ] ) ? true : false;
$fullname = isset( $post[ 'name' ] ) ? $post['name'] : '';
Expand All @@ -151,11 +143,7 @@ public function post() {

if( !is_numeric( $state ) )
{
$ajax->script( "eblog.loader.doneLoading();" );
$ajax->script( 'eblog.comment.displayInlineMsg( "error" , "' . $state . '");' );
EasyBlogHelper::getHelper( 'Captcha' )->reload( $ajax , $post );

return $ajax->send();
$this->plugin->setResponse( $this->getErrorResponse(500, $state) );
}

$newUserId = $state;
Expand Down Expand Up @@ -201,13 +189,6 @@ public function post() {
$this->plugin->setResponse( $this->getErrorResponse(500, 'There was a problem saving the comment') );
}

$message = JText::_('COM_EASYBLOG_COMMENTS_SUCCESS');

if( $newUserId != 0 && $registerUser )
{
$message = JText::_('COM_EASYBLOG_COMMENTS_SUCCESS_AND_REGISTERED');
}

// @rule: Process subscription for blog automatically when the user submits a new comment and wants to subscribe to the blog.
if( $subscribeBlog && $config->get( 'main_subscription' ) && $blog->subscription )
{
Expand Down Expand Up @@ -333,16 +314,6 @@ function _validateFields($post)
}
}

if($config->get('comment_tnc') == true && ( ( $config->get('comment_tnc_users') == 0 && $my->id <=0) || ( $config->get('comment_tnc_users') == 1 && $my->id >= 0) || ( $config->get('comment_tnc_users') == 2) ) )
{
if(empty($post['tnc']))
{
$this->err[0] = JText::_( 'COM_EASYBLOG_YOU_MUST_ACCEPT_TNC' );
$this->err[1] = 'tnc';
return false;
}
}

return true;
}

Expand Down

0 comments on commit 122be79

Please sign in to comment.