comparison contrib/web/php-admin/htdocs/save.php @ 759: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 b37f66e0852b
children dbb144f085a5
comparison
equal deleted inserted replaced
752:c02582939bbc 759:73c8715367fb
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 * IN THE SOFTWARE. 26 * IN THE SOFTWARE.
27 */ 27 */
28 28
29 require("../conf/config.php"); 29 require(dirname(dirname(__FILE__))."/conf/config.php");
30 require("class.rFastTemplate.php"); 30 require(dirname(__FILE__)."/class.rFastTemplate.php");
31 31
32 function mlmmj_boolean($name, $nicename, $text) 32 function mlmmj_boolean($name, $nicename, $text)
33 { 33 {
34 global $tpl, $topdir, $list, $HTTP_POST_VARS; 34 global $tpl, $topdir, $list, $HTTP_POST_VARS;
35 35
91 die("non-existent list"); 91 die("non-existent list");
92 92
93 $tpl->define(array("main" => "save.html")); 93 $tpl->define(array("main" => "save.html"));
94 $tpl->assign(array("LIST" => htmlentities($list))); 94 $tpl->assign(array("LIST" => htmlentities($list)));
95 95
96 $handle = fopen("$templatedir/../conf/tunables.pl", "r"); 96 $tunables = file_get_contents($confdir.'/tunables.pl');
97 $tunables = fread($handle, filesize("$templatedir/../conf/tunables.pl"));
98 fclose($handle);
99
100 eval($tunables); 97 eval($tunables);
101 98
102 $tpl->parse("MAIN","main"); 99 $tpl->parse("MAIN","main");
103 $tpl->FastPrint("MAIN"); 100 $tpl->FastPrint("MAIN");
104 101