PhpWebmin

A port of Webmin's weblib.pl to help writing PHP webmin modules

PhpWebmin consists of a port of Webmin's weblib.pl to PHP, and the integration of the phplib html template class, to help you in writing Webmin modules in PHP and to have a true separation between code and html.

Main features:

To be done / Known bugs:

Resources:

How to use it ?

If you already know how to make regular webmin modules

Install PHP4 on your server (>= 4.2.0) and a recent release of Webmin (>= 1.030). You should be familiar with writing Webmin Modules (if not, follow the Perl Writing Webmin Modules tutorial. Now to make a PHP webmin module a few things need to be altered: If you get a PHP security alert (which talks about force-cgi-redirect), then you should add the following lines to your php.ini:
cgi.force_redirect=1
cgi.redirect_status_env="MINISERV_CONFIG"
If you use Debian Sarge, with php4-cgi package version 4.3, you must use #!/usr/lib/cgi-bin/php4 instead of #!/usr/bin/php4. /usr/bin/php4 is the CLI version of PHP4, and so can't be used to run PHP web scripts. If your scripts are not executed but only "No input file specified." is displayed, you need to set cgi.fix_pathinfo=1 in /etc/php4/cgi/php.ini.

New functions added to the web-lib:

tmplInit($array)
Sets the templates directory to "./tmpl/your_language" accordingly to Webmin settings. If the directory does not exists, fall back to "./tmpl/en". Initializes {TB} and {CB} template variables to $tb and $cb global variables (used as the background colour for table headers and body rows). Takes an optional array to set template files (similar to set_file in the phplib). Returns a template object (see the official phplib documentation).

Simple example:

A simple example with templates: here.
This library is also used in the 'Inventory' and 'Files Backup' module of the Linbox Rescue Server.

Authors:

Ludovic Drolez and Linbox/Free&ALterSoft. Initial work done by Nicolas FAURANT.

License:

web-lib.php is licensed under the BSD license. templates.inc which comes from PHPLib is licensed under the LGPL.
Hosted by: