Giter Site home page Giter Site logo

Comments (3)

dapphp avatar dapphp commented on July 29, 2024

getCaptchaHtml has the ability to control some aspects of the captcha, but nothing that affects the properties of the image itself. The reason for this is because there is no facility to pass customization options through the URL to affect the appearance of the captcha image (malicious users could then customize the appearance of your image to make it easier to solve).

If you want to use a math captcha, you can either change the properties in securimage_show.php, or edit config.inc.php in the securimage directory and set the appearance options there.

Acceptable options to getCaptchaHtml() can be seen here.

from securimage.

skibulk avatar skibulk commented on July 29, 2024

That makes sense, thanks. It might be helpful to list the bad properties under getCaptchaHtml in the docs, with your explanation. I did a page search for "captcha_type", but didn't find this information.

from securimage.

dapphp avatar dapphp commented on July 29, 2024

I agree, they need to be documented somewhere better, other than the code.

Currently they are:

/**
 * Returns HTML code for displaying the captcha image, audio button, and form text input.
 *
 * Options can be specified to modify the output of the HTML.  Accepted options:
 *
 *     'securimage_path':
 *         Optional: The URI to where securimage is installed (e.g. /securimage)
 *     'show_image_url':
 *         Path to the securimage_show.php script (useful when integrating with a framework or moving outside the securimage directory)
 *         This will be passed as a urlencoded string to the <img> tag for outputting the captcha image
 *     'audio_play_url':
 *         Same as show_image_url, except this indicates the URL of the audio playback script
 *     'image_id':
 *          A string that sets the "id" attribute of the captcha image (default: captcha_image)
 *     'image_alt_text':
 *         The alt text of the captcha image (default: CAPTCHA Image)
 *     'show_audio_button':
 *         true/false  Whether or not to show the audio button (default: true)
 *     'disable_flash_fallback':)
 *         Allow only HTML5 audio and disable Flash fallback
 *     'show_refresh_button':
 *         true/false  Whether or not to show a button to refresh the image (default: true)
 *     'audio_icon_url':
 *         URL to the image used for showing the HTML5 audio icon
 *     'icon_size':
 *         Size (for both height & width) in pixels of the audio and refresh buttons
 *     'show_text_input':
 *         true/false  Whether or not to show the text input for the captcha (default: true)
 *     'refresh_alt_text':
 *         Alt text for the refresh image (default: Refresh Image)
 *     'refresh_title_text':
 *         Title text for the refresh image link (default: Refresh Image)
 *     'input_id':
 *         A string that sets the "id" attribute of the captcha text input (default: captcha_code)
 *     'input_name':
 *         A string that sets the "name" attribute of the captcha text input (default: same as input_id)
 *     'input_text':
 *         A string that sets the text of the label for the captcha text input (default: Type the text:)
 *     'input_attributes':
 *         An array of additional HTML tag attributes to pass to the text input tag (default: empty)
 *     'image_attributes':
 *         An array of additional HTML tag attributes to pass to the captcha image tag (default: empty)
 *     'error_html':
 *         Optional HTML markup to be shown above the text input field
 *     'namespace':
 *         The optional captcha namespace to use for showing the image and playing back the audio. Namespaces are for using multiple captchas on the same page.
 *
 * @param array $options Array of options for modifying the HTML code.
 * @param int   $parts Securiage::HTML_* constant controlling what component of the captcha HTML to display
 *
 * @return string  The generated HTML code for displaying the captcha
 */
public static function getCaptchaHtml($options = array(), $parts = Securimage::HTML_ALL)

For reference, they are in securimage.php at function getCaptchaHtml(). I'll leave this open for a while longer for any feedback and easier accessibility.

from securimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.