mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add Captcha handling in Application
This commit is contained in:
@@ -565,6 +565,36 @@ class Application extends SilexApplication
|
||||
return $this['session']->getFlashBag()->get($type, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks for a captcha ar next authentication
|
||||
*
|
||||
* @return Application
|
||||
*/
|
||||
public function requireCaptcha()
|
||||
{
|
||||
if ($this['phraseanet.registry']->get('GV_captchas')) {
|
||||
$this['session']->add('require_captcha', true);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells if a captcha is required for next authentication
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isCaptchaRequired()
|
||||
{
|
||||
if ($this['session']->has('require_captcha')) {
|
||||
$this['session']->remove('require_captcha');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an an array of available collection for offline queries
|
||||
*
|
||||
|
Reference in New Issue
Block a user