Cool Solutions



May 14, 2009 9:00 am





A PHP Script which creates a web page of iPrint Servers from a csv file stored on the web server which can be edited with whatever tool is convenient.

This php page is designed for larger iPrint implementations with buildings at multiple sites. A csv file contains a list of each building and the iprint server related to that building and the page uses that to present a list of all sites, ordered in various ways. It also does a comparison of the calling ip address in order to present the user with the nearest server at the top of the list, which is usually the one they will want to select a printer from.

An example csv file is included. The file and code includes three columns for the name of the building. My organisation seems to refer to some buildings by multiple names, so it helps our users, but its not necessary to use them all. You’ll almost certainly want to customise the html to suit your intranet look and feel. There are hooks in the code where you can insert html style class tags and so on.

To install this you need to have a web server which supports php. The tool is tested and installed on Netware 6.5 with Apache, but should be capable of running on other combinations of web server and operating system provided that php is installed and configured with LDAP support. I recommend you create a new folder for the application files in the web server root folder. On an “out of the box” NW65 install this will be sys:Apache2\htdocs, so create sys:Apache\htdocs\iprintlist. Extract the two files from the zip archive, iprintlist.php and iprintsites.csv into this folder.

The next task is to configure the csv file to contain your servers and offices. You need to enter all your servers into this file, together with the town and building name(s). Most columns are obvious: note that you should use the complete server name including DNS domain. The subnet needs a little more explanation. In order to decise whether there is a “nearest site” the script compares the address of the calling workstation with that of each server. If there is a match then that server is presented as “nearest site”. In the script below workstations and would match up with server fs1, workstation would match up with server fs2a, but workstation wouldn’t match with any servers.

Town,Server,IPSubnet, Notes, BuildingName1, BuildingName2, BuildingName3
Atown,, subnet 10.100,All printers, Atown Sub Office,Park Street,Finance Offices
Atown,, subnet 10.101.1, 1st and 2nd Floors,Headquarters, Company House,,
Atown,, subnet 10.101.100, 3rd 4th and 5th Floors,Headquarters, Company House,,
Btown,, subnet 10.130, All printers, Btown Office,Sales Building,    

To run the script start a web browser on an appropriate device and point it at the iprintlist.php script. In the example above the url would be http://[servername]/printlist/iprintlist.php. From there on it should be self explanatory. The script should run on any reasonably recent web browser and client operating system, but of course the platform will also need to support iprint to download drivers etc.

N.B., I found a small bug in the code where some in house customisation wasn’t fully removed. If you are already using the script you will almost certainly have found and dealt with this as it is a trvial fix. If you are considering using this script then make sure you download a version dated 14 May 2009 or later.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Categories: Uncategorized

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.