Search found 21 matches

by Mythotical
05 Sep 2020, 10:00
Forum: Customizations
Topic: CSP headers
Replies: 4
Views: 5819

Re: CSP headers

Ok that was my fault, I thought I had http_api.php opened but I had html_api.php so oops.
by Mythotical
05 Sep 2020, 09:33
Forum: Customizations
Topic: CSP headers
Replies: 4
Views: 5819

Re: CSP headers

I looked in that file and found nothing related to CSP.
by Mythotical
05 Sep 2020, 05:24
Forum: Customizations
Topic: CSP headers
Replies: 4
Views: 5819

CSP headers

I'm working on adding reCaptcha and hCaptcha to the core files on a pull request giving admins the choice on which Captcha to use. Anyway, I'm trying to find where CSP is handled so I can add the sites for google and hCaptcha to the headers. I can do it by a plugin for the time being but would rathe...
by Mythotical
30 Aug 2020, 21:22
Forum: Customizations
Topic: Using plugin to replace code in specific pages
Replies: 8
Views: 11671

Re: Using plugin to replace code in specific pages

After some testing I found I don't need a new point added but being able to replace the captcha that exists now with custom code would be needed without editing core files.
by Mythotical
28 Aug 2020, 19:49
Forum: Customizations
Topic: Where is the user_signup code?
Replies: 2
Views: 4545

Re: Where is the user_signup code?

It's easier to ask and the specific file be pointed out. I am programming an entire site so I don't have a lot of time to devote to diving into each and every file but I may take a day to make notes of which files handle what to make finding things easier.
by Mythotical
28 Aug 2020, 19:47
Forum: Customizations
Topic: Using plugin to replace code in specific pages
Replies: 8
Views: 11671

Re: Using plugin to replace code in specific pages

I know how to trigger events but I wasn't sure about adding my own event to the core file because if I do that then it will get replaced on updates to Mantis so it would need to be done via a file similar to what we do with config_inc.php is that possible with adding my own event to html_api.php or ...
by Mythotical
28 Aug 2020, 19:44
Forum: Customizations
Topic: reCaptcha on Signup/Login Page
Replies: 16
Views: 11400

Re: reCaptcha on Signup/Login Page

this is indeeed what was described on the Stackoverflow page :mrgreen: I didn't read everything on that page because I saw something in the first couple of posts that made me do another search which lead me to that issue I linked. But at least that is fixed and working, now I just need to figure ou...
by Mythotical
27 Aug 2020, 20:14
Forum: Customizations
Topic: Where is the user_signup code?
Replies: 2
Views: 4545

Where is the user_signup code?

I'm trying to find where between signup_page.php and signup.php the SQL query is initiated to insert new users after they click submit. I need to wrap in code just in case they failed the bot check or didn't do it at all.
by Mythotical
27 Aug 2020, 19:28
Forum: Customizations
Topic: reCaptcha on Signup/Login Page
Replies: 16
Views: 11400

Re: reCaptcha on Signup/Login Page

Final update: After hours of digging and testing, this thread https://www.mantisbt.org/bugs/view.php?id=14679 had the answer. It was CSP blocking it from loading. Once I added the sites to CSP, it loaded and works. Now to figure out where it calls to insert the user so it can check for captcha befor...
by Mythotical
27 Aug 2020, 19:04
Forum: Customizations
Topic: reCaptcha on Signup/Login Page
Replies: 16
Views: 11400

Re: reCaptcha on Signup/Login Page

UPDATE AGAIN: I think I found my problem and that is with content security policy so can someone let me know if I'm doing this right. function hooks(){ return array( "EVENT_CORE_HEADERS" => 'csp_headers', "EVENT_LAYOUT_RESOURCES" => 'scripts' ); } function csp_headers() { http_cs...
by Mythotical
27 Aug 2020, 18:32
Forum: Customizations
Topic: reCaptcha on Signup/Login Page
Replies: 16
Views: 11400

Re: reCaptcha on Signup/Login Page

Update: I tried implementing hCaptcha and still have the same issue with the box not showing at all and I can't figure out what could be interfering to make it not show.
by Mythotical
27 Aug 2020, 16:57
Forum: Customizations
Topic: reCaptcha on Signup/Login Page
Replies: 16
Views: 11400

Re: reCaptcha on Signup/Login Page

I did some tests on a completely new page I created called testload.php where I added everything and a test form. It all displays and shows correctly, I even added a script call before </head> making the google api call second to last and it still worked. So I'm wondering if there is something on th...
by Mythotical
27 Aug 2020, 16:54
Forum: Customizations
Topic: Using plugin to replace code in specific pages
Replies: 8
Views: 11671

Re: Using plugin to replace code in specific pages

So you define your own event ( declare it within the plugin) and add the event statement @ the place where you require it. If it needs to be right before the </head> statement, you need to declare your event within function html_head_end which you can find within core/html_api.php Since I'm new to ...
by Mythotical
27 Aug 2020, 15:39
Forum: Customizations
Topic: Using plugin to replace code in specific pages
Replies: 8
Views: 11671

Re: Using plugin to replace code in specific pages

Plugins are event based, you can find those back in core/events_inc.php You have various events available for the lay-out etcetra. In addition you can add events yourself ( although this requires an adjustment of the core code). The problem with events is they aren't where I need. Such as EVENT_LAY...
by Mythotical
27 Aug 2020, 15:06
Forum: Customizations
Topic: Using plugin to replace code in specific pages
Replies: 8
Views: 11671

Using plugin to replace code in specific pages

I'm wanting to know how I would replace code in the signup_page.php with my own form code. I'm also wanting to know how I can find the </head> tag and replace it with my code followed by the </head> tag.