Skip to content

Commit

Permalink
Updated forum configuration from downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jan 5, 2016
1 parent 2ecb86a commit 1376b09
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions forum/src/VanillaConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ protected function migrate()
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
ini_set('display_errors', 0);

// Used in attached files to drop all tables before seeding
$Drop = true;

// Create the database tables
require_once 'public/applications/dashboard/settings/structure.php';
require_once 'public/applications/vanilla/settings/structure.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@

class ApiDiscussionController extends DiscussionController
{
/**
* Toggle spam check limit for \VanillaModel::checkForSpam()
*/
public function toggleSpamCheck()
{
$enable = Gdn::request()->getValue('Enable');

saveToConfig('Vanilla.Comment.SpamCount', $enable ? 5 : 9999);
}

/**
* Get a single discussion.
*
Expand Down
5 changes: 5 additions & 0 deletions forum/src/apiextended/settings/class.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public function DiscussionsAPI_register_handler($sender)
'controller' => 'ApiDiscussion',
'method' => 'deletebyforeignid',
]);

$sender::put('/spamcheck', [
'controller' => 'ApiDiscussion',
'method' => 'togglespamcheck',
]);
}

/**
Expand Down

0 comments on commit 1376b09

Please sign in to comment.