]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Better techniques for locating support files in php-admin
authorBen Schmidt <none@none>
Tue, 5 Oct 2010 23:35:04 +0000 (10:35 +1100)
committerBen Schmidt <none@none>
Tue, 5 Oct 2010 23:35:04 +0000 (10:35 +1100)
- existing installations will need to have their conf/config.php altered to set
  the variable $confdir

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

index a9dabd5cc67cbe75cd16273a7f315efe35fefaf3..fc431cb73389fe1a326ffe497bcc33075bbbbc43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 Remove .sh from mlmmj-make-ml.sh; symlink original name
  o Correct spelling of 'receive' and 'voodoo' throughout the code and
    documentation, making mlmmj-recieve a symlink to mlmmj-receive (Chris Webb)
index 855076e3670c057afc23b958a24b95014ede0f35..ade2b6f56850445549c2c593f5dafff724611f89 100644 (file)
@@ -7,25 +7,27 @@ To use this web-interface you have to:
    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 @@ To enable access control on Apache you have to:
 
    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.
index eba5ad2dcda372566e2f2225f7c9b6d268218c8f..10ca6525cb8c245a84071d8be98122528a5b1986 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 $topdir = "/var/spool/mlmmj";
-$templatedir = "/home/mlmmj/templates";
+$confdir = dirname(__FILE__);
+$templatedir = dirname(dirname(__FILE__))."/templates";
 
 ?>
index eb4d37096fbe0cddbc5a1d17e56415e0eb85cae0..c9faf53b0ffa8d7a0e4691f06edacc6e8f061ba5 100644 (file)
@@ -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->define(array("main" => "edit.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");
index b49e3ad4a11248eeb80335949058f58940ffa559..8970bb4beed3ce82f8fd14a8ee4d6e73b3388c56 100644 (file)
@@ -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);
 
index 27b01da68daa35f94f130a485b4579c985c049d4..fcc6466ddfe08ed28b9249623500dd36de1d7a87 100644 (file)
@@ -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 @@ die("non-existent list");
 $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");