-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Plugin: Intranet subnet identification #1054
Comments
When I try to activate this plugin I get the following error Fatal error: Call to undefined method Piwik::prefixtable() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\piwik\plugins\IntranetSubNetwork\IntranetSubNetwork.php on line 47 From reading other forums in Piwik it seems that the method Piwik::prefixtable() has been depricated. Are there any efforts being carried out to update the plugin to resolve this issues? |
Change it to Piwik_Common::prefixTable(). |
Plugin is broken currently, per message |
Attachment: v0.2 |
Fixed the obvious errors. I'll patch it later for IPv6 support. |
Attachment: Hack to make plugin work with IPv4 again |
As PHP does not seem to have 128-bit int, this plugin will probably need a bit of refactoring to work with IPv6. Attached patch to make it work with IPv4, no idea if it will barf on IPv6, as I do not have access to such a machine right now. |
Well, that was a lot easier than I thought. The required function was already available in Piwik. |
Attachment: IPv6 support (missing comma) |
Plugin is not working correctly as of 30 Nov 2011. (Running Piwik 1.6) This part
does not appear to be processing the IP address properly. Using stored hex value in column location_ip in piwik_log_visit, it should be using something like base_convert($hex,16,10) to format into decimal value. (Based on testing the DB query select inet_ntoa(conv(location_ip), 16, 10) from piwik_log_visit;) Even when given a VERY broad range of subnet addresses, the plugin still registers every visit as "Unknown." |
I'm unable to upload a .diff due to our rigid network policies, so here's the fix I used. I ended up splitting the conversion into two variables for clarity, but obviously you can change $myipcomp to $myipcomp = hexdec(bin2hex($bin)).
Obviously this means the comparison later needs to be replaced with $myipcomp, e.g.
|
I forgot to mention, intraIPv6.diff should work fine for IPv4 too. (Still works for me in 1.6) |
This plugin is really useful! I created a repository on GitHub for this plugin: https://github.com/pklaus/IntranetSubNetwork Thus, the plugin can also address the feature suggestion ipv6 statistics: http://forum.piwik.org/read.php?3,83250,83250 |
One more thing: You can see all a list of the commits and the diffs of the changes I made to the code on pklaus/IntranetSubNetwork@v0.2...HEAD |
@pklaus, great to hear you published it on Github! Along with the Piwik 2.0 release and new design for Piwik, we have also launched the official Plugins Marketplace to let any developer share their work to the thousands of Piwik users worldwide. Maybe you'd like to publish your plugin there? In any case, keep up the good work! Cheers. |
This plugin currently doesn't work with Piwik 2.x. I've converted to be compatible and have published it to GitHub at https://github.com/kwasib/IntranetSubNetwork. |
A modified provider plugin for intranet subnetwork identification, posted by Alain on the forum.
For example:
Use a spreadsheet to help create the php code to insert in IntranetSubNetwork.php, defining the first address, last address and net name.
Disclaimer: this plugin has not been reviewed by the Piwik team.
Keywords: third-party-plugin
The text was updated successfully, but these errors were encountered: