[prev in list] [next in list] [prev in thread] [next in thread]
List: webmin-devel
Subject: Re: [webmin-devel] Subdirectories in Modules
From: Jamie Cameron <jcameron () webmin ! com>
Date: 2005-03-31 0:27:57
Message-ID: 1112228876.7282.72.camel () temasek ! home
[Download RAW message or body]
On Thu, 2005-03-31 at 01:48, Bruce M Potter wrote:
> I've developed a webmin module that has some of the cgi scripts in
> subdirectories, just to keep things organized. But somewhere between
> webmin 1.130 and 1.190 it stopped working because when web-lib.pl
> loads web-lib-funcs.pl it assumes it is either in the same dir or 1
> level up. In my subdirs, it is actually 2 levels up, so none of the
> functions get defined. I have a temporary work-around, but I wanted
> to bring this to your attention so you could hopefully fix it and let
> me know if there are any other assumptions in the code about a single
> directory level. Thanks!
>
> Thanks for a great tool!
Probably the best way to write a module that uses subdirectories is to
put code into your CGI script like this :
#!/usr/local/bin/perl
chdir("..");
require './webmin-lib.pl';
&header("smeg", "");
print "module = $module_name<br>\n";
print "module root = $module_root_directory<br>\n";
print "module config = $module_config_directory<br>\n";
&footer();
The initial chdir will solve any problems related to finding files in
the expected directories just fine.
- Jamie
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
-
Forwarded by the Webmin development list at webmin-devel@webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic