diff --git a/create.php b/create.php index f01a97cb..e0939549 100644 --- a/create.php +++ b/create.php @@ -6,10 +6,14 @@ include "inc/mod/auth.php"; checkBan('*'); $bannedWords = array('/^cake$/', '8ch', '/^cp$/', 'child', '/^inc$/', '/^static$/', '/^templates$/', '/^js$/', '/^stylesheets$/', '/^tools$/'); -$ayah = new AYAH(); +$ayah = (($config['playagame']) ? new AYAH() : false); if (!isset($_POST['uri'], $_POST['title'], $_POST['subtitle'], $_POST['username'], $_POST['password'])) { -$publisher_html = $ayah->getPublisherHTML(); +if (!$ayah){ + $game_html = ''; +} else { + $game_html = 'Game' . $ayah->getPublisherHTML() . ''; +} $password = base64_encode(openssl_random_pseudo_bytes(9)); $body = <<Subtitle (must be < 200 chars) Username (must contain only alphanumeric, periods and underscores) Password (write this down) -Game{$publisher_html} +{$game_html} @@ -38,7 +42,11 @@ $title = $_POST['title']; $subtitle = $_POST['subtitle']; $username = $_POST['username']; $password = $_POST['password']; +if (!$ayah){ +$score = true; +} else { $score = $ayah->scoreResult(); +} if (!preg_match('/^[a-z0-9]{1,10}$/', $uri)) error('Invalid URI'); @@ -118,3 +126,4 @@ EOT; echo Element("page.html", array("config" => $config, "body" => $body, "title" => "Success", "subtitle" => "This was a triumph")); } +?> \ No newline at end of file diff --git a/inc/config.php b/inc/config.php index e88f4935..11770e57 100644 --- a/inc/config.php +++ b/inc/config.php @@ -277,6 +277,21 @@ 'no_country' ); + + + /*uses are you a human to stop automated requests to make boards disabled by default + if you wish to use 'are you a human' to block automated board creation requests + + to use AYAH you must enter your 'AYAH_PUBLISHER_KEY' and your 'AYAH_SCORING_KEY' in + the configuration file for AYAH. The config file for AYAH + is located in the following directory:'/inc/lib/ayah/ayah_config.php' + + */ + $config['playagame'] = false; + + + + // Enable reCaptcha to make spam even harder. Rarely necessary. $config['recaptcha'] = false;