: " . wfElement( 'input', array( 'name' => 'ctToken', 'id' => 'ctToken' ) ) . "

\n"; } /** * Inject whazawhoo * @fixme must be loaded after ConfirmEdit in LocalSettings.php, * that extension stomps on template 'header' * @param SimpleTemplate $template * @return bool true to keep running callbacks */ function injectUserCreate( &$template ) { global $wgOut; $f = $template->data['header'] . "
" . $wgOut->parse( "Enter XXX" ) . $this->getForm() . "
\n"; $template->set( 'header', $f ); return true; } /** * Hook for user creation form submissions. * @param User $u * @param string $message * @return bool true to continue, false to abort user creation */ function confirmUserCreate( $u, &$message ) { $this->trigger = "new account"; if( !$this->passConfirmTest() ) { $message = 'You did not enter XXX'; return false; } return true; } /** * Test form input for correct * input on the open session. * @return bool if passed, false if failed or new session */ function passConfirmTest() { global $wgRequest; $tokenProvided = $wgRequest->getVal( 'ctToken' ); if( $tokenProvided == 'XXX' ) { $this->log( "passed" ); return true; } else { $this->log( "bad form input" ); return false; } } /** * Log the status and any triggering info for debugging or statistics * @param string $message */ function log( $message ) { wfDebugLog( 'ctTest', $message . '; ' . $this->trigger ); } } } # End invocation guard ?>