diff options
Diffstat (limited to 'www/wiki/extensions/ConfirmEdit/includes/store/CaptchaSessionStore.php')
-rw-r--r-- | www/wiki/extensions/ConfirmEdit/includes/store/CaptchaSessionStore.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/www/wiki/extensions/ConfirmEdit/includes/store/CaptchaSessionStore.php b/www/wiki/extensions/ConfirmEdit/includes/store/CaptchaSessionStore.php new file mode 100644 index 00000000..a02f569c --- /dev/null +++ b/www/wiki/extensions/ConfirmEdit/includes/store/CaptchaSessionStore.php @@ -0,0 +1,26 @@ +<?php + +use MediaWiki\Session\SessionManager; + +class CaptchaSessionStore extends CaptchaStore { + protected function __construct() { + // Make sure the session is started + SessionManager::getGlobalSession()->persist(); + } + + function store( $index, $info ) { + SessionManager::getGlobalSession()->set( 'captcha' . $index, $info ); + } + + function retrieve( $index ) { + return SessionManager::getGlobalSession()->get( 'captcha' . $index, false ); + } + + function clear( $index ) { + SessionManager::getGlobalSession()->remove( 'captcha' . $index ); + } + + function cookiesNeeded() { + return true; + } +} |