Determine if an IP address belongs to a subnetwork
This class can be used to determine wether a given IP address belongs to a given list of subnetworks.
The class takes an array of subnetwork masks to be checked in the form of strings with decimal numbers seperated dots .
Then the class can check whether a given IP address belongs to any of the specified subnetworks by applying the respective masks.
This class was created to emulate the "Deny from x.x.x.x" directive for Apache (nd other servers -- for example, Samba uses a similar format for allowing/denying access to a range of IP addresses). I needed a way to deny/allow access to a range of IP addresses but, for technical reasons, I could not use a .htaccess file, and had to do the IP address processing within the PHP script itself.
For example, you can emulate the line "Deny from 192.168.0.0/24" by supplying the string "192.168.0.0/24" to the class. To see exactly how to do this, see the documentation within the class file itself.
This class is meant to provide a Web interface to access shared resources in networks that use the Windows Samba protocol.
The class can browse shared directories, browse printer queues, retrieve files, print files, cancel print jobs, delete files and directories.
The class can detect the listed file types from their file name extensions and present the appropriate icon images. The images binary data is defined built in the class.
You may configure the Samba root domain, server, share and path, where to cache files, in which language the messages of the Web interface will appear (currently supporting 14 languages), the path of log file if any, the Web server being used to present the Web interface, the path of the Samba client program and the Samba socket options.