# HG changeset patch # User Ben Schmidt # Date 1287356198 -39600 # Node ID 4bf5317e9bd7c25ff1d1e45328ed9abccc082149 # Parent d4868a6f546d4c6b18a1ec2d0c3bd4e96db328ed# Parent 73c8715367fbc6c8ab7cf80d5e0648ec5f5e3b5c Merged change for improving finding php-admin support files diff -r d4868a6f546d -r 4bf5317e9bd7 ChangeLog --- a/ChangeLog Tue Oct 12 09:14:35 2010 +1100 +++ b/ChangeLog Mon Oct 18 09:56:38 2010 +1100 @@ -1,3 +1,6 @@ + o Better techniques for locating support files in php-admin -- existing + installations will need to have their conf/config.php altered to set + the variable $confdir o Add $controlN$ substitution o Fix theoretically possible memory corruption by chomp() o Remove .sh from mlmmj-make-ml.sh; symlink original name diff -r d4868a6f546d -r 4bf5317e9bd7 contrib/web/php-admin/README --- a/contrib/web/php-admin/README Tue Oct 12 09:14:35 2010 +1100 +++ b/contrib/web/php-admin/README Mon Oct 18 09:56:38 2010 +1100 @@ -7,25 +7,27 @@ don't want the webinterface in the root of your website it is recommended to make an alias in your web server configuration in order to keep the conf directory at the same level as the htdocs directory and still outside - webscope. + webscope. If you want to keep it somewhere else, you will need to modify + the first line of code in index.php, edit.php and save.php. -2) Change the permissions of the listdir/control directories of any list you +2) If your lists are stored somewhere other than /var/spool/mlmmj, edit + conf/config.php to reflect this. + +3) Change the permissions of the listdir/control directories of any list you want to control using the web-interface, so the web server can write in it: # chown -R wwwrun /var/spool/mlmmj/mlmmj-test/control/ - -3) If the web server does not run as the same user the mailserver writes as +4) If the web server does not run as the same user the mailserver writes as you need to create a group (eg. mlmmj) and add both users to it. The subscribers.d directory then needs to be writable by that group: # chgrp -R mlmmj /var/spool/mlmmj/mlmmj-test/subscribers.d/ # chmod -R g+w /var/spool/mlmmj/mlmmj-test/subscribers.d/ -To enable access control on Apache you have to: - -3) Rename dot.htaccess to .htaccess and edit the path inside the file to point - to a htpasswd file somewhere outside the webscope. +5) To enable access control on Apache you have to rename dot.htaccess to + .htaccess and edit the path inside the file to point to a htpasswd file + somewhere outside the webscope. If you don't have one already, you can create one like this @@ -33,4 +35,4 @@ It will then ask you for a password for the given username. -4) That is it, you are ready to use the interface. +6) That is it, you are ready to use the interface. diff -r d4868a6f546d -r 4bf5317e9bd7 contrib/web/php-admin/conf/config.php --- a/contrib/web/php-admin/conf/config.php Tue Oct 12 09:14:35 2010 +1100 +++ b/contrib/web/php-admin/conf/config.php Mon Oct 18 09:56:38 2010 +1100 @@ -1,6 +1,7 @@ diff -r d4868a6f546d -r 4bf5317e9bd7 contrib/web/php-admin/htdocs/edit.php --- a/contrib/web/php-admin/htdocs/edit.php Tue Oct 12 09:14:35 2010 +1100 +++ b/contrib/web/php-admin/htdocs/edit.php Mon Oct 18 09:56:38 2010 +1100 @@ -26,8 +26,8 @@ * IN THE SOFTWARE. */ -require("../conf/config.php"); -require("class.rFastTemplate.php"); +require(dirname(dirname(__FILE__))."/conf/config.php"); +require(dirname(__FILE__)."/class.rFastTemplate.php"); function mlmmj_boolean($name, $nicename, $text) { @@ -117,10 +117,7 @@ $tpl->assign(array("LIST" =>htmlentities($list))); -$handle = fopen("$templatedir/../conf/tunables.pl", "r"); -$tunables = fread($handle, filesize("$templatedir/../conf/tunables.pl")); -fclose($handle); - +$tunables = file_get_contents($confdir.'/tunables.pl'); eval($tunables); $tpl->parse("MAIN","main"); diff -r d4868a6f546d -r 4bf5317e9bd7 contrib/web/php-admin/htdocs/index.php --- a/contrib/web/php-admin/htdocs/index.php Tue Oct 12 09:14:35 2010 +1100 +++ b/contrib/web/php-admin/htdocs/index.php Mon Oct 18 09:56:38 2010 +1100 @@ -26,8 +26,8 @@ * IN THE SOFTWARE. */ -require("class.rFastTemplate.php"); -require("../conf/config.php"); +require(dirname(dirname(__FILE__))."/conf/config.php"); +require(dirname(__FILE__)."/class.rFastTemplate.php"); $tpl = new rFastTemplate($templatedir); diff -r d4868a6f546d -r 4bf5317e9bd7 contrib/web/php-admin/htdocs/save.php --- a/contrib/web/php-admin/htdocs/save.php Tue Oct 12 09:14:35 2010 +1100 +++ b/contrib/web/php-admin/htdocs/save.php Mon Oct 18 09:56:38 2010 +1100 @@ -26,8 +26,8 @@ * IN THE SOFTWARE. */ -require("../conf/config.php"); -require("class.rFastTemplate.php"); +require(dirname(dirname(__FILE__))."/conf/config.php"); +require(dirname(__FILE__)."/class.rFastTemplate.php"); function mlmmj_boolean($name, $nicename, $text) { @@ -93,10 +93,7 @@ $tpl->define(array("main" => "save.html")); $tpl->assign(array("LIST" => htmlentities($list))); -$handle = fopen("$templatedir/../conf/tunables.pl", "r"); -$tunables = fread($handle, filesize("$templatedir/../conf/tunables.pl")); -fclose($handle); - +$tunables = file_get_contents($confdir.'/tunables.pl'); eval($tunables); $tpl->parse("MAIN","main");