Moodle plugins directory: PaperCut Print Quotas | Moodle.org
PaperCut Print Quotas
Papercut is a print management system designed to cut the cost of printing. The system provides some web widgets to display users' remaining credit, and the environmental impact of their printing. This block acts as a wrapper for those widgets allowing them to be displayed on Moodle pages.
The Moodle 1.9 version of this block was written by SchoolsICT. This update provides Moodle 2 support, and allows the widgets to be called over HTTPS (if the papercut sever is configured to serve HTTPS requests).
This block is no longer maintained.
Unfortunately I'm no longer working in an institution that uses PaperCut, so am unable to debug or fix issues with the block. As such, I wont be making any new releases. If anyone wishes to take over maintenance of the block, please contact me.
Currently it'll only try to include the widgets if the workstation you're accessing Moodle from is on the same subnet as the papercut server. This is by design as you're unlikely to have your Papercut server open to the public Internet. However it is feasible that the papercut server will be on a seperate subnet while still being accessible, so I'll try and think of a way to make it work.
As it stands our clients are on a different subnet unfortunately and this would also mean that this block will not work off-site if I understand the problem? The Moodle server however, is on the same subnet as the PaperCut server if that helps!
Thanks,
Chris
When I look in the console I can see the request is being blocked, does that mean it's a port issue? I can't see how, but I'm definitely no expert in that area?
You can try editing block_papercut.php to add the line $internal = true; after the line $internal = address_in_subnet(.... which will force it to try including the script regardless of subnets. This will work as long as the client's workstation can access the papercut server.
Derek:
Your problem sounds different - if your workstation isn't on the same subnet as the papercut server, the widgets shouldn't be requested at all. If it's trying but failing, its likely to be an issue with the firewall or similar - perhaps the client isn't allowed to access the port that papercut's web interface is running on? Try manually requesting the widgets file by going to http://$url:$port/content/widgets/widgets.js in a browser where $url and $port are the Papercut server URL and port number you defined in the block's config.
thanks for the quick response, I tried what you suggested. If I run it on my local machine (in the office) it works fine (ie downloads the js file).
I VNC'd onto the webserver and tried it there and I get a 404 error with the error
Cannot read file: ${server.home}/data/content/widgets/widget.js
Which to me suggest there is something wrong on the papercut server?
I should stress that I have had nothing to do with the papercut server, I only deal with the webserver(s), but they are both sat about ten foot from me right next to each other.
I've solved it, it was to with the ports that the secure cert had been installed on. I wasn't told that there was a different port for the secure version until now.
Thanks again for the help though.
Thank you for this block, but I have a problem: The Moodle 2.3.3-Server runs in the dmz in a 192.168.0-subnet, the novellserver with papercut in the intranet in a 10.0-subnet and I get the error "Balance not available". The ldap-authentication from the moodle-server to the same novell-server works and I opend port 9191 for papercut. For papercut we use the user-authentication and not the pc-authentication - is this a problem?
Thanks,
Hartwig
Thanks for the answer! Now it works There is just one thing: You write " This will work as long as the client's workstation can access the papercut server" - so it works from the clients in school, but not from the clients at home, when the students try it at home - will there be an update, that this will also work?
Thanks from Austria,
Hartwig
If I can think of a tidy enough way of doing it, I might try and produce an update that will quietly check if the client can access the papercut server and load the widget if it can, rather than basing it on IP addresses (which is inexact as it is).
I've just pushed a new branch called "noip" to github. This will try and load the widgets regardless, and if it can't after 10 seconds you'll get a message in your javascript error console rather than on the page.
However, I don't currently have a Papercut server to test this out on. If you do and are willing to give it a try, please download the code from here: https://github.com/marxjohnson/moodle-block_papercut/tree/noip and let me know if it works as expected.
Installs find.
However... sadly.. when I try an put the block on the front page, it comes up with this error
The pcUsername variable is not defined. Please define and set to the logged in username.
I am not even able to edit the block settings.
I am running NTLM Single Sign On (SSO) for authentication. Is that going to be an issue ?
Regards
The following comes up in the block on the page
ConfigurationDeleteHideAssign roles
Widget Error: User details not loaded. Call pcGetUserDetails() first.
Widget Error: User details not loaded. Call pcGetUserDetails() first.
Thanks very much for your feedback. I'm unable to work on the block for the next couple of weeks but after that I'll take a look at these issues and get in touch with you.