I found some old topics regarding recaptcha but those mods (for a really old version) dont work anymore so has anyone implemented re-captcha or question captcha to the script successfully yet?
Mantis 2.26.1
Thanks
Moderators: Developer, Contributor
I could not find this in the install instructions - Select Install behind Captcha 2.1.0Missing Plugin Base Class
A directory for this Plugin was found, but there was no corresponding Plugin code inside of it. Make sure the directory's name matches the Plugin's base name (case sensitive)
Thanks so muchCopy the Captcha directory into the plugins folder of your installation.
Code: Select all
config_get_string('recaptcha_key');
config_get_string('recaptcha_theme');Content-Security-Policy: The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive: “script-src https://google.com 'self'”
Code: Select all
function init() {
plugin_event_hook( 'EVENT_LAYOUT_RESOURCES', 'resources' );
plugin_event_hook( 'EVENT_AUTH_USER_FLAGS', 'auth_user_flags' );
//dave mod
plugin_event_hook('EVENT_CORE_HEADERS', 'addPolicy');
}
function config() {
return array(
'lifetime' => 20,
'length' => 5,
'recaptcha_enable' => 0,
'recaptcha_key' => '',
'recaptcha_theme' => 'light'
);
}
//dave mod
//add google to content security policy
function addPolicy()
{
http_csp_add('script-src', 'google.com');
// i also tried add inline parameter http_csp_add('script-src', 'google.com', 'inline');
}
# Loading needed styles and javascripts
function resources()
{
if ( is_page_name( 'plugin.php' ) ) {
return "<script src='" . plugin_file( 'captcha_script.js' ) . "'></script>";
}
//dave mod
if(is_page_name('signup_page.php') || is_page_name('login_page.php'))
{
return '<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
}
}
So not sure i can run it locally but ill try. If i can this also means that i have to update it all the time to get new version unless i run a file get contents on it every time it loads../* PLEASE DO NOT COPY AND PASTE THIS CODE. */
I went through the entire statistics plugin files, are you referring to the csp_support.php file ?cas wrote: 16 Jun 2024, 08:16 Have a look @ my Statistics plugin(https://github.com/mantisbt-plugins/Statistics), there i had to do somethuing similar![]()