Browse Source

add captcha settings

main
yggverse 9 months ago
parent
commit
630e2b21e4
  1. 11
      example/config.json
  2. 13
      src/webui/explore.php

11
example/config.json

@ -125,6 +125,17 @@ @@ -125,6 +125,17 @@
"index":
{
"enabled":true
},
"captcha":
{
"length":5,
"phrase":"0123456789abcdef",
"background":
{
"r":46,
"g":52,
"b":54
}
}
},
"cli":

13
src/webui/explore.php

@ -215,8 +215,17 @@ if ($config->webui->index->enabled) @@ -215,8 +215,17 @@ if ($config->webui->index->enabled)
);
}
$captcha = new \Gregwar\Captcha\CaptchaBuilder();
$captcha->setBackgroundColor(46, 52, 54);
$captcha = new \Gregwar\Captcha\CaptchaBuilder(
$config->webui->captcha->length,
$config->webui->captcha->phrase
);
$captcha->setBackgroundColor(
$config->webui->captcha->background->r,
$config->webui->captcha->background->g,
$config->webui->captcha->background->b
);
$captcha->build();
$_SESSION['captcha'] = $captcha->getPhrase();

Loading…
Cancel
Save