Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#1014 closed New feature (fixed)

Export as image via server-side proxy

Reported by: barry_van_dijk Owned by: vipsoft
Priority: normal Milestone: Piwik 1.1
Component: Core Keywords:
Cc: Sensitive: no

Description

The export as image functionality does not work, at least not for the section Visitors - Overview - Evolution over the last days. The results is shown in attached document.

Attachments (2)

Export as image.doc (215.5 KB) - added by barry_van_dijk 4 years ago.
Screenshots
1014.patch (6.7 KB) - added by vipsoft 4 years ago.
Proxy plugin

Download all attachments as: .zip

Change History (21)

Changed 4 years ago by barry_van_dijk

Screenshots

comment:1 Changed 4 years ago by vipsoft (robocoder)

  • Milestone set to 1 - Piwik 0.5
  • Resolution set to invalid
  • Status changed from new to closed

Unless this is IE8, this feature is not available on earlier versions of Internet Explorer (i.e., lack support for data: pseudo-protocol).

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Keywords interesting added

Just got pinged on this. An alternative might be to somehow POST the data back to the server and have the server generate a regular image in response. e.g.,

// pseudo-code
$.ajax({
  type: 'POST',
  url: 'http://URL/?module=CoreHome&action=getImage',
  data: { 'nonce' : '__secret__', 'data' : '__imagedata__',
  success: function(src) {
    // add the image to the DOM
  },
  dataType: 'image/png'
});

Care needed to avoid introducing any security vulnerabilities, e.g., arbitrary file upload & execution, XSS reflection, etc.

comment:3 Changed 4 years ago by vipsoft (robocoder)

  • Keywords interesting removed
  • Milestone changed from Piwik 0.5 to Features requests 1.x or 2.x
  • Priority changed from major to normal
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from Export as image does not work to Export as image via server-side proxy
  • Type changed from Bug to New feature

It looks like greg already implemented this for UserCountryMap. We should be able to refactor this and make it available to the OFC charts as well.

comment:4 Changed 4 years ago by vipsoft (robocoder)

I'm thinking of putting all the proxy stuff into its own module, eg Piwik_Proxy

  • getCss, getJs, getPieHtc
  • getImage

Can I move the misc/redirectUrl code here too?

comment:5 Changed 4 years ago by vipsoft (robocoder)

  • Milestone changed from Features requests 1.x or 2.x to 1.1 - Piwik 1.1
  • Owner set to vipsoft
  • Status changed from reopened to new

Better yet, move to the CoreTheme plugin.

comment:6 Changed 4 years ago by matt (mattab)

Piwik_Proxy sounds good ; not sure about CoreTheme plugin, as this code would be shared by all themes? I still have to review your proposal about theming, will do in the next few days :)

Changed 4 years ago by vipsoft (robocoder)

Proxy plugin

comment:7 Changed 4 years ago by vipsoft (robocoder)

We can either have Piwik_CoreHome_Controller extend Piwik_Proxy_Controller, or change the URLs to use module=Proxy. (Ditto for UserCountryMap.)

comment:8 Changed 4 years ago by matt (mattab)

By changing URLs, do you mean just the 'export as image' URLs and/or the getCSS/getJS? I think it would make sense...?

comment:10 Changed 4 years ago by vipsoft (robocoder)

(In [3175]) refs #1014 - move getCss, getJs, getHtc, and redirect to Proxy plugin; todo: exportImage (requires a change to open-flash-chart.swf and common.js)

comment:11 Changed 4 years ago by vipsoft (robocoder)

(In [3176]) refs #1014 - typo in [3175]

comment:15 Changed 3 years ago by vipsoft (robocoder)

(In [3323]) refs #1711, refs #1014 - move plugin-specific logic out of Url.php to Proxy module; simplify code; re-org related tests

comment:16 Changed 3 years ago by matt (mattab)

Export as image works for me in dashboard and Visitors>Overview on FF and IE8 - should this bug be closed?

comment:17 Changed 3 years ago by vipsoft (robocoder)

(In [3349]) refs #1014 - split UserCountryMap Controller into a separate file and call proxy methods for "export as image"

comment:18 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

Closing for now... the change to common.js is more involved.

comment:19 Changed 3 years ago by vipsoft (robocoder)

(In [3350]) refs #1014 - rename methods

Note: See TracTickets for help on using tickets.