mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
add captcha settings
This commit is contained in:
parent
b5b042b5fa
commit
630e2b21e4
2 changed files with 22 additions and 2 deletions
|
|
@ -125,6 +125,17 @@
|
||||||
"index":
|
"index":
|
||||||
{
|
{
|
||||||
"enabled":true
|
"enabled":true
|
||||||
|
},
|
||||||
|
"captcha":
|
||||||
|
{
|
||||||
|
"length":5,
|
||||||
|
"phrase":"0123456789abcdef",
|
||||||
|
"background":
|
||||||
|
{
|
||||||
|
"r":46,
|
||||||
|
"g":52,
|
||||||
|
"b":54
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cli":
|
"cli":
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,17 @@ if ($config->webui->index->enabled)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$captcha = new \Gregwar\Captcha\CaptchaBuilder();
|
$captcha = new \Gregwar\Captcha\CaptchaBuilder(
|
||||||
$captcha->setBackgroundColor(46, 52, 54);
|
$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();
|
$captcha->build();
|
||||||
|
|
||||||
$_SESSION['captcha'] = $captcha->getPhrase();
|
$_SESSION['captcha'] = $captcha->getPhrase();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue