Re: [webmin-devel] Subdirectories in Modules

Jamie Cameron <[email protected]>
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
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 [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.