mlmmj

changeset 73c8715367fb

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
author Ben Schmidt
date Wed, 06 Oct 2010 10:35:04 +1100
parents c02582939bbc
children 4bf5317e9bd7
files ChangeLog contrib/web/php-admin/README contrib/web/php-admin/conf/config.php contrib/web/php-admin/htdocs/edit.php contrib/web/php-admin/htdocs/index.php contrib/web/php-admin/htdocs/save.php
diffstat 6 files changed, 24 insertions(+), 24 deletions(-) [+]
line diff
     1.1 --- a/ChangeLog	Wed Oct 06 10:12:23 2010 +1100
     1.2 +++ b/ChangeLog	Wed Oct 06 10:35:04 2010 +1100
     1.3 @@ -1,3 +1,6 @@
     1.4 + o Better techniques for locating support files in php-admin -- existing
     1.5 +   installations will need to have their conf/config.php altered to set
     1.6 +   the variable $confdir
     1.7   o Remove .sh from mlmmj-make-ml.sh; symlink original name
     1.8   o Correct spelling of 'receive' and 'voodoo' throughout the code and
     1.9     documentation, making mlmmj-recieve a symlink to mlmmj-receive (Chris Webb)
     2.1 --- a/contrib/web/php-admin/README	Wed Oct 06 10:12:23 2010 +1100
     2.2 +++ b/contrib/web/php-admin/README	Wed Oct 06 10:35:04 2010 +1100
     2.3 @@ -7,25 +7,27 @@
     2.4     don't want the webinterface in the root of your website it is recommended to
     2.5     make an alias in your web server configuration in order to keep the conf
     2.6     directory at the same level as the htdocs directory and still outside
     2.7 -   webscope.
     2.8 +   webscope. If you want to keep it somewhere else, you will need to modify
     2.9 +   the first line of code in index.php, edit.php and save.php.
    2.10  
    2.11 -2) Change the permissions of the listdir/control directories of any list you
    2.12 +2) If your lists are stored somewhere other than /var/spool/mlmmj, edit
    2.13 +   conf/config.php to reflect this.
    2.14 +
    2.15 +3) Change the permissions of the listdir/control directories of any list you
    2.16     want to control using the web-interface, so the web server can write in it:
    2.17  
    2.18       # chown -R wwwrun /var/spool/mlmmj/mlmmj-test/control/
    2.19  
    2.20 -
    2.21 -3) If the web server does not run as the same user the mailserver writes as
    2.22 +4) If the web server does not run as the same user the mailserver writes as
    2.23     you need to create a group (eg. mlmmj) and add both users to it. The
    2.24     subscribers.d directory then needs to be writable by that group:
    2.25  
    2.26       # chgrp -R mlmmj /var/spool/mlmmj/mlmmj-test/subscribers.d/
    2.27       # chmod -R g+w /var/spool/mlmmj/mlmmj-test/subscribers.d/
    2.28  
    2.29 -To enable access control on Apache you have to:
    2.30 -
    2.31 -3) Rename dot.htaccess to .htaccess and edit the path inside the file to point
    2.32 -   to a htpasswd file somewhere outside the webscope.
    2.33 +5) To enable access control on Apache you have to rename dot.htaccess to
    2.34 +   .htaccess and edit the path inside the file to point to a htpasswd file
    2.35 +   somewhere outside the webscope.
    2.36  
    2.37     If you don't have one already, you can create one like this
    2.38  
    2.39 @@ -33,4 +35,4 @@
    2.40  
    2.41     It will then ask you for a password for the given username.
    2.42  
    2.43 -4) That is it, you are ready to use the interface.
    2.44 +6) That is it, you are ready to use the interface.
     3.1 --- a/contrib/web/php-admin/conf/config.php	Wed Oct 06 10:12:23 2010 +1100
     3.2 +++ b/contrib/web/php-admin/conf/config.php	Wed Oct 06 10:35:04 2010 +1100
     3.3 @@ -1,6 +1,7 @@
     3.4  <?php
     3.5  
     3.6  $topdir = "/var/spool/mlmmj";
     3.7 -$templatedir = "/home/mlmmj/templates";
     3.8 +$confdir = dirname(__FILE__);
     3.9 +$templatedir = dirname(dirname(__FILE__))."/templates";
    3.10  
    3.11  ?>
     4.1 --- a/contrib/web/php-admin/htdocs/edit.php	Wed Oct 06 10:12:23 2010 +1100
     4.2 +++ b/contrib/web/php-admin/htdocs/edit.php	Wed Oct 06 10:35:04 2010 +1100
     4.3 @@ -26,8 +26,8 @@
     4.4   * IN THE SOFTWARE.
     4.5   */
     4.6  
     4.7 -require("../conf/config.php");
     4.8 -require("class.rFastTemplate.php");
     4.9 +require(dirname(dirname(__FILE__))."/conf/config.php");
    4.10 +require(dirname(__FILE__)."/class.rFastTemplate.php");
    4.11  
    4.12  function mlmmj_boolean($name, $nicename, $text) 
    4.13  {
    4.14 @@ -117,10 +117,7 @@
    4.15  
    4.16  $tpl->assign(array("LIST" =>htmlentities($list)));
    4.17  
    4.18 -$handle = fopen("$templatedir/../conf/tunables.pl", "r");
    4.19 -$tunables = fread($handle, filesize("$templatedir/../conf/tunables.pl"));
    4.20 -fclose($handle);
    4.21 -
    4.22 +$tunables = file_get_contents($confdir.'/tunables.pl');
    4.23  eval($tunables);
    4.24  
    4.25  $tpl->parse("MAIN","main");
     5.1 --- a/contrib/web/php-admin/htdocs/index.php	Wed Oct 06 10:12:23 2010 +1100
     5.2 +++ b/contrib/web/php-admin/htdocs/index.php	Wed Oct 06 10:35:04 2010 +1100
     5.3 @@ -26,8 +26,8 @@
     5.4   * IN THE SOFTWARE.
     5.5   */
     5.6  
     5.7 -require("class.rFastTemplate.php");
     5.8 -require("../conf/config.php");
     5.9 +require(dirname(dirname(__FILE__))."/conf/config.php");
    5.10 +require(dirname(__FILE__)."/class.rFastTemplate.php");
    5.11  
    5.12  $tpl = new rFastTemplate($templatedir);
    5.13  
     6.1 --- a/contrib/web/php-admin/htdocs/save.php	Wed Oct 06 10:12:23 2010 +1100
     6.2 +++ b/contrib/web/php-admin/htdocs/save.php	Wed Oct 06 10:35:04 2010 +1100
     6.3 @@ -26,8 +26,8 @@
     6.4   * IN THE SOFTWARE.
     6.5   */
     6.6  
     6.7 -require("../conf/config.php");
     6.8 -require("class.rFastTemplate.php");
     6.9 +require(dirname(dirname(__FILE__))."/conf/config.php");
    6.10 +require(dirname(__FILE__)."/class.rFastTemplate.php");
    6.11  
    6.12  function mlmmj_boolean($name, $nicename, $text)
    6.13  {
    6.14 @@ -93,10 +93,7 @@
    6.15  $tpl->define(array("main" => "save.html"));
    6.16  $tpl->assign(array("LIST" => htmlentities($list)));
    6.17  
    6.18 -$handle = fopen("$templatedir/../conf/tunables.pl", "r");
    6.19 -$tunables = fread($handle, filesize("$templatedir/../conf/tunables.pl"));
    6.20 -fclose($handle);
    6.21 -
    6.22 +$tunables = file_get_contents($confdir.'/tunables.pl');
    6.23  eval($tunables);
    6.24  
    6.25  $tpl->parse("MAIN","main");