Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export as image via server-side proxy #1014

Closed
anonymous-matomo-user opened this issue Oct 23, 2009 · 21 comments
Closed

Export as image via server-side proxy #1014

anonymous-matomo-user opened this issue Oct 23, 2009 · 21 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

Attachment: Screenshots
Export as image.doc

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Better yet, move to the CoreTheme plugin.

@mattab
Copy link
Member

mattab commented Sep 20, 2010

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
Copy link
Contributor

Attachment: Proxy plugin
1014.patch

@robocoder
Copy link
Contributor

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

@mattab
Copy link
Member

mattab commented Sep 22, 2010

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

@robocoder
Copy link
Contributor

Both.

@robocoder
Copy link
Contributor

(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
Copy link
Contributor

(In [refs #1014 - typo in 3175)

@robocoder
Copy link
Contributor

(In [3190]) refs #1014

@robocoder
Copy link
Contributor

(In [3271]) refs #1014

@robocoder
Copy link
Contributor

(In [refs #1014 - revert 3271)

@robocoder
Copy link
Contributor

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

@mattab
Copy link
Member

mattab commented Nov 24, 2010

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

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants