Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Export as image via server-side proxy #1014

Closed
anonymous-piwik-user opened this Issue · 21 comments

3 participants

@anonymous-piwik-user

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.

@anonymous-piwik-user

Attachment: Screenshots
Export as image.doc

@robocoder
Collaborator

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

@robocoder
Collaborator

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.

@robocoder
Collaborator

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.

@robocoder
Collaborator

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?

@robocoder
Collaborator

Better yet, move to the CoreTheme plugin.

@mattab
Owner

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 :)

@robocoder
Collaborator

Attachment: Proxy plugin
1014.patch

@robocoder
Collaborator

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

@mattab
Owner

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

@robocoder
Collaborator

Both.

@robocoder
Collaborator

(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)

@robocoder
Collaborator

(In [refs #1014 - typo in 3175)

@robocoder
Collaborator

(In [3190]) refs #1014

@robocoder
Collaborator

(In [3271]) refs #1014

@robocoder
Collaborator

(In [refs #1014 - revert 3271)

@robocoder
Collaborator

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

@mattab
Owner

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

@robocoder
Collaborator

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

@robocoder
Collaborator

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

@robocoder
Collaborator

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

@anonymous-piwik-user anonymous-piwik-user added this to the Piwik 1.1 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.