PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/captcha.php

https://github.com/Laurelai/tsukiboards
PHP | 49 lines | 18 code | 3 blank | 28 comment | 5 complexity | 151fd6a37847fea70c8f613c0ef5366d MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. /**
  3. * RH - Handle captcha.php requests appropriately depending on the CAPTCHA type we are using.
  4. * Only reason we need this is for compatibility with dollchan extension tools.
  5. * In future, if/when we add native thread watching and updating, we can probably drop this.
  6. *
  7. * @package kusaba
  8. *
  9. * This file is part of arcNET
  10. *
  11. * arcNET uses core code from Kusaba X and Oneechan
  12. *
  13. * tsukihi.me kusabax.cultnet.net oneechan.org
  14. *
  15. * arcNET is free software; you can redistribute it and/or modify it under the
  16. * terms of the GNU General Public License as published by the Free Software
  17. * Foundation; either version 2 of the License, or (at your option) any later
  18. * version.
  19. *
  20. * kusaba is distributed in the hope that it will be useful, but WITHOUT ANY
  21. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  22. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License along with
  25. * kusaba; if not, write to the Free Software Foundation, Inc.,
  26. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  27. */
  28. require 'config.php';
  29. if( KU_CAPTCHA_TYPE == 'faptcha' )
  30. {
  31. // RH 06/01/2012 - Bug report that dollchan seems to cache stale faptchas, hopefully rand querystring will fix this
  32. $faptchaURL = 'faptcha.php?'.mt_rand();
  33. header("Location: ".$faptchaURL);
  34. }
  35. else if( KU_CAPTCHA_TYPE == 'recaptcha' )
  36. {
  37. // RH - use reCAPTCHA challenge instead of the faptcha.
  38. require_once(KU_ROOTDIR.'recaptchalib.php');
  39. $publickey = "6LdVg8YSAAAAAOhqx0eFT1Pi49fOavnYgy7e-lTO";
  40. echo recaptcha_get_html($publickey);
  41. }
  42. else
  43. {
  44. die("Unrecognised CAPTCHA type set in config.php!");
  45. }
  46. ?>