CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Hosting CiviCRM/CiviEvent on https
Pages: [1] 2

Author Topic: Hosting CiviCRM/CiviEvent on https  (Read 5112 times)

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Hosting CiviCRM/CiviEvent on https
May 02, 2011, 01:34:27 am
It is the holiday here in the UK so I took the opportunity to change the configuration of CiviCRM on my client's server. I used to serve CiviCRM from a subdomain however, with the questions recently asked by my client about SSL, I migrated the installation to a subfolder off the main site to get the https functionality.

Everything works okay, with a redirect setup for tracking links on emails and old hyperlinks.

While I was testing the https configuration using CiviEvent (using Google Chrome) I became aware of a security warning due to the insecure content displayed on the Event Information page. The Google Map identifying the event location was delivered using http rather than https. I understand that, with the Google API v3, developers can display a Google Map over https preventing the warnings about insecure content.

I investigated CiviCRM's base code in:
Code: [Select]
.../civicrm/templates/CRM/Contact/Form/Task/Map/Google.tpland discovered that the Google API v2 is in use, so preventing the delivery of https/ssl maps.

Has anyone had any similar problems or success with modifying/replacing the CiviCRM code to use the Google API v3 instead of v2? Or is there a workaround?

I would be willing to step into the code to modify/create my own mapping code, hopefully after some pointers/advice from the CiviCRM team.

Thanks


“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Hosting CiviCRM/CiviEvent on https
May 02, 2011, 02:19:30 am
Hi,

Would be good to change the code base so it uses google api v3 instead of v2 (if I'm correct, it also allow not to have to set up the api key). Could you try patching Civi ?

Come on IRC if you have questions.

CRM/Event/Page/EventInfo.php
line 170 and following is setting up the params,

and is using CRM/Contact/Form/Task/Map/Event.php and the template you mention.


X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: Hosting CiviCRM/CiviEvent on https
May 02, 2011, 03:24:29 am
Let me think about this, it'll be a good first project...

I'll jump on IRC later (GMT:1400)

“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: Hosting CiviCRM/CiviEvent on https
June 15, 2011, 09:13:10 am
Updating my original post (a bit late, perhaps)

I had a look at the Google Maps API and tried a few samples; these work fine. I would have continued to try a patch had I not been moved on to 'other' CiviCRM tasks.

However, I am filing this for a future personal challenge...
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Hosting CiviCRM/CiviEvent on https
June 15, 2011, 12:13:22 pm
Don't want to put pressure on you and scare you, take your time, we can wait.

Read today that personal challenges are ideally taken on sat 18th. But I'm sure the 19th would be fine as well, again, no pressure ;)

Would be great you write a case study about what you're doing with civi
X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

hp3kman

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 4
Re: Hosting CiviCRM/CiviEvent on https
August 04, 2011, 06:09:43 am
Having the same issue...any progress on this?

I'll take a look at the code and see if it's something I could take on...

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hosting CiviCRM/CiviEvent on https
August 04, 2011, 06:54:32 am

I dont think so. A patch to upgrade google maps to v3 would be great :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hp3kman

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 4
Re: Hosting CiviCRM/CiviEvent on https
August 04, 2011, 07:07:39 am
Happy to take a look, to see if it's something I can handle...

Any pointers? Where to start?

Thanks, Lobo!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hosting CiviCRM/CiviEvent on https
August 04, 2011, 07:15:18 am

i think all the google mapping code is here:

templates/CRM/Contact/Form/Task/Map/Google.tpl


lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

christopherleslie

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • Learning the ropes, one pulled hair at a time :)
    • Midwest Renewable Energy Association
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.1.52
  • PHP version: 5.2.15
Re: Hosting CiviCRM/CiviEvent on https
March 01, 2012, 07:21:03 am
Rather than start a new topic, I'm curious to see if anyone out there has had luck switching to the Google Maps API V3.

My site runs entirely on https and weeding out any calls to http is my goal.

If anyone's successfully made the change to the Google.tpl file, I'd love to see what you did and give it a go myself.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hosting CiviCRM/CiviEvent on https
March 01, 2012, 07:58:38 am

v4.1 has been upgraded to use google api v3

http://issues.civicrm.org/jira/browse/CRM-8032

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

christopherleslie

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • Learning the ropes, one pulled hair at a time :)
    • Midwest Renewable Energy Association
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.1.52
  • PHP version: 5.2.15
Re: Hosting CiviCRM/CiviEvent on https
March 05, 2012, 07:36:31 am
Wonderful! Thanks Lobo :)

christopherleslie

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • Learning the ropes, one pulled hair at a time :)
    • Midwest Renewable Energy Association
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.1.52
  • PHP version: 5.2.15
Re: Hosting CiviCRM/CiviEvent on https
March 15, 2012, 09:03:36 am
Actually, no. The usage of Google API V3 does NOT resolve the issue if you're using https on your site.

I found after upgrading to 4.1.1, that my site was STILL making calls to http for Google Maps, not https. Internet Explorer confirmed as much by denying me access to see the maps for events.

To fix this, you have to make the following change. In your Civicrm directory, follow this structure:

civicrm > templates > CRM > Contact > Form > Task > Map > Google.tpl


Save a copy before editing this one. Then, change Line 35 from "<script src="http://maps.googleapis.com"" to "<script src="https://maps.googleapis.com"". Save, replace, flush caches, and refresh the page.

And this will have to be done every time you update CiviCRM unless it's fixed in an update.


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Hosting CiviCRM/CiviEvent on https
March 15, 2012, 03:44:02 pm
Top of my head, there is a syntax to include either http or https, if I recall it's

<script src="//maps.googleapis.com">

Can you try if it works both on http & https?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: Hosting CiviCRM/CiviEvent on https
March 17, 2012, 02:41:04 am
xavier, I can confirm that your syntax works for https. Cannot check for http.

Great that the API v3 was used for this; thanks Guys!

Noticed something else though:

On an Event Info page, the social networking links to Twitter and Facebook are referencing http links and not https. This produces the usual errors in FF, IE and Chrome re: unsecure content. I am currently looking to see if I can correct this.
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Hosting CiviCRM/CiviEvent on https

This forum was archived on 2017-11-26.