Solved Add Google recaptcha
-
Hi,
Can we add google recaptcha in the form ? when someone creates a ticket via web form , i need to verify they are spam or not ? -
For knowledgebase section create ticket form you need to add it here.
locate path: vendor/uvdesk/support-center-bundle/blob/master/Resources/views/Knowledgebase/ticket.html.twigOpen ticket.html.twig file and add Google recaptcha in form.
- 2 months later
-
Hi, I have the same question.
How can I add the re captcha in the open source?I see the file you mentioned but don't know what and where paste.
I can get the site key but can you tell me what code and where need add to have the captcha required?Also what kind of re-captcha is supported? 2, 3, invisible?
I'm able to insert the re captcha but is not required and is always skipped.
How to validate?(You should integrate in the operator web interface for made the activation process more easily.)
Hot to made it work as required filed?
If the site key should go in the page you say where the secret key go? Need to put somewhere?
Can I also insert re-captcha on operator login?
How?Thanks
-
Resolved.
Instruction:On vendor/uvdesk/support-center-bundle/Resources/views/Knowledgebase/ticket.html.twig
Open ticket.html.twigfind the line (98):
<button type="submit" id="create-ticket-btn" class="uv-btn">{{ 'Create Ticket'|trans }}</button>
in the row before you will find (97):
<div class="uv-element-block">
before that line add on line (96):
<div class="clearfix"></div> <div class="g-recaptcha" data-sitekey="YOUR SITE KEY"></div> <div class="clearfix"></div>
now find some rows below in the script check (153)
'reply' : { required : true, msg : '{{ "This field is mandatory"|trans }}' },
after that add (on line 154):
'g-recaptcha-response' : { fn: function(value) { if(grecaptcha.getResponse().length > 0) return false; else return true; }, msg : 'Please select CAPTCHA' }
save and clean cache.
This will work only for ticket page, for protect login page I have no idea.
-
If the UVdesk staff can tell me how add reCaptcha also on operator login page I will be gratefu.
Security is very important to me, I want protect as the best possible the login page.
Maybe also customer login page.I tried but was unable to do on the login page.
First of all I need add the line with the recaptcha script<script src='https://www.google.com/recaptcha/api.js'></script>
I was able also to place the recaptcha but I'm unable to required it. It broken the page as when press submit the login page doesn't work... so please can you help me?
In the login pages can I insert the invisible recaptcha? I need the steps please.
-
@peopleinside said in Add Google recaptcha:
If the UVdesk staff can tell me how add reCaptcha also on operator login page I will be gratefu.
Security is very important to me, I want protect as the best possible the login page.
Maybe also customer login page.You can add google recaptcha here for admin side.
-
@Sanjeev I don't wanna have recaptcha on operator ticket creation but on login page.
-
-
@Sanjeev Yes, thanks!
As I said I was able to insert and see the visual ReCaptcha but unable to ask as mandatory and see the login form working.Without a guide to how to do I will not be able to insert ReCaptcha there.
Thanks anyway made a more stronger password for the operator. -
@peopleinside
You need to define a name field for recaptcha as same we have added for input field.https://github.com/uvdesk/core-framework/blob/master/Resources/views/login.html.twig#L35
And make it required here as same we did for _username.
https://github.com/uvdesk/core-framework/blob/master/Resources/views/login.html.twig#L94And check if it works for you !!
-
@Sanjeev great, thanks! Maybe I forget the input type!
I will try, thanks! -
@Sanjeev nothing, still unable to do.
I give up - 2 months later
-
- 14 days later
-
i also want to add Google recaptchabut facing some issues in API call, try this method.
Darik elwan
- 2 months later
-
I created a GitHub issue requesting a better management of the reCaptcha.
https://github.com/uvdesk/community-skeleton/issues/368 -
We also want to provide recaptcha but the problem is a key need to generate for your site from https://www.google.com/recaptcha/ here to use recaptcha into your site and which is unique code for the site as project is opensource(no fix domain or site) so person need to set it up for themselves.
But still we will check if we just write code for that and once you enter your recaptcha code for your site then it will enable for you !!
-
@Sanjeev I use other application different from uvdesk, for example a live chat system.
I know is possibile add an option in the admin side where user can activate reCaptcha.For example in live helper chat you have a setting where you can set the secret code for reCaptcha than activate.
If reCaptcha is active is showed on login page, if not is not active and not showed.The same should be possible also in Uvdesk.
-
Is live chat self hosted ?
-
-
Fine, We will check the possibility with our system and will try to add this.