Cataly...Captcha(3pm)

πŸ“¦
version 0.04 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ Cataly...Captcha β€” Catalyst::Plugin::Captcha πŸ’–

okay bestie, so this page is literally the manual for Catalyst::Plugin::Captcha, and it lives in section 3pm of the Perl docs (user contributed Perl documentation, iykyk). grab a strawberry πŸ“ and let's get into it.


🌸 NAME 🌸

Catalyst::Plugin::Captcha β€” the plugin that creates and validates Captcha for Catalyst. yes ma'am, that's the whole job and it does it fabulously πŸ’…


✨ SYNOPSIS ✨

here's the vibe, copy-paste ready:

  use Catalyst qw/Captcha/;

  MyApp->config->{ 'Plugin::Captcha' } = {
    session_name => 'captcha_string',
    new => {
      width => 80,
      height => 30,
      lines => 7,
      gd_font => 'giant',
    },
    create => [qw/normal rect/],
    particle => [100],
    out => {force => 'jpeg'}
  };

  sub captcha : Local {
    my ($self, $c) = @_;
    $c->create_captcha();
  }

  sub do_post : Local {
    my ($self, $c) = @_;
    if ($c->validate_captcha($c->req->param('validate')){
      ..
    } else {
      ..
    }
  }

  #validate with CP::FormValidator::Simple
  sub do_post : Local {
    my ($self, $c) = @_;
    $c->form(
      validate => [['EQUAL_TO',$c->captcha_string]]
    )
  }

like, look at that config block. it's giving organized. it's giving I know what I'm doing. πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

This plugin create, validate Captcha. that's the whole errand, no notes.

⚠️ heads up bestie: this plugin uses GD::SecurityImage and it requires a session plugin, like Catalyst::Plugin::Session. no session, no captcha, no slay. periodt.

πŸ¦‹ METHODS πŸ¦‹

🌈 create_captcha

Create Captcha image and output it. that's it. that's the method. make the image, spit it out. πŸŽ€

🌈 validate_captcha

  $c->validate_captcha($key);

validate key. you hand it the key, it tells you if it's real or if someone's out here lying. πŸ’€

🌈 captcha_string

Return a string for validation which is stroed in session. (yes, "stroed" β€” we keep the original spelling, no cap, it's iconic in its own way πŸ™ˆ)

🌈 clear_captcha_string

Clear a string which is stroed in session. bye bye string, you did great 🫢


πŸŽ€ CONFIGURATION πŸŽ€

πŸ’… session_name

The keyword for storing captcha string.

πŸ’… new

πŸ’… create

πŸ’… particle

πŸ’… out

These parameters are passed to each GD::Security's method. Please see GD::SecurityImage for details. (so like, if you wanna know what new, create, particle and out actually do β€” the details live over in that other page. this page is just the messenger 🧚)


⭐ SEE ALSO ⭐

GD::SecurityImage, Catalyst β€” go read those too, bestie, they're the supporting cast and they ate.


πŸ‘‘ AUTHOR πŸ‘‘

Masahiro Nagano <kazeburo@nomadscafe.jp> β€” legend behavior, fr fr.


Copyright (C) 2006 by Masahiro Nagano

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page!! πŸ’…βœ¨ this one was rendered by perl v5.26.1, dated 2018-03-30, under the manual name Cataly...Captcha(3pm) β€” mwah, take care of her, she's vintage πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from