Update i've got the structure and things now but i cant get the script to pass a variable called $fulldom.
Any ideas
Thanks Paul
\\\\\\\script
<?
This function opens a directory, and prints a
function parse_dir($dir,$level, $fulldom){
print $dir." (DIR)<BR>\n";
$dirrep = (ereg_replace ("scriptfiles", $fulldom, $dir));
echo $dirrep;
mkdir("$dirrep", 0755);
$dp=opendir($dir);
while (false!=($file=readdir($dp))){
if ($file!="." && $file!=".."){
if (is_dir($dir."/".$file)) parse_dir($dir."/".$file,$level+1);
else {
$dir2 = (ereg_replace ("./", "/home/sites/home/web/extras/email/", $dir));
$dirrep2 = (ereg_replace ("./", "/home/sites/home/web/extras/email/", $dirrep));
$file1 = ($dir2."/".$file);
$file2 = ($dirrep2."/".$file);
echo ("$file1 copying to $file2 <br>");
copy($file1, $file2);
print ("file");
}
}
}
}
$start_dir="./scriptfiles";
$level=1;
parse_dir($start_dir,$level,$fulldom);
$str = "<?php // TWIG Header Configuration File ?>
<?php
\$config[\"fromdomain\"] = \"$shortdom\"; // This is where mail will be sent from
\$config[\"basedir\"] = \"/mail\"; // The path of the URL to your TWIG installation
\$config[\"imgdir\"] = \"/mail/images\"; // The path to graphics files
\$config[\"index\"] = \"index.php3\"; // This is what you name the index file
// Note: index.php3 can be aliased to the value of
\$config[\"basedir\"]
// in apache's httpd.conf, which cleans up the URL area.
\$config[\"auth\"] = \"forms\"; // Authorization Type (basic|forms)
\$config[\"auth_timeout\"] = 3600; // Set the auth cookie timeout value, in
seconds. Set to 0 for session length cookies
\$config[\"auth_logout_redirect\"] = \"http://$fulldom\";
// Complete URL to redirect browsers to after they have been logged out
\$config[\"auth_provider\"] = \"imap-new\"; // Authorization Method
(imap-new|imap|sqltable|mysql|pgsql|ldap|sqlimap|sqlopen|nntp)
\$config[\"security\"] = \"basic\"; // Type of security to use (basic|advanced)
\$config[\"groups\"] = \"standard\"; // What level of group support to use
(none|standard|personal)
\$config[\"language\"] = \"english\"; // language file to use (english is the default).
// language files are in /lib/strings
// language options are in
/features/prefs/modules/global.inc.php3
\$config[\"spellcheck\"] = \"/usr/local/bin/aspell -a\"; // Command, including full path and
flags, to run a spellcheck (via pipe)
\$config[\"session_handler\"] = \"get\"; // Session handler (get|get2|sqltable)
\$config[\"session_expiry\"] = 300; // How long session records are retained (in seconds)
\$config[\"login_handler\"] = \"cookie\"; // Login handler (cookie|sqltable)
// Color Configuration
\$config[\"cellcolor\"] = \"#e0e0e0\"; // Background color of certain cells
\$config[\"cellcoloralt\"] = \"#ffffff\"; // Alternate background color of list cells
\$config[\"cellcolorhigh\"] = \"#b0c4de\"; // Hilight backgroud color of cells
\$config[\"celltext\"] = \"#000000\"; // Text color inside those cells
\$config[\"cellheadcolor\"] = \"#778899\"; // Background color of header cells
\$config[\"cellheadtext\"] = \"#ffffff\"; // Text color inside those cells
\$config[\"cellfont\"] = \"Arial,Helvetica\"; // Font of text inside those cells
\$config[\"tabcolorlight\"] = \"#c6c6c6\"; // The light (main body) color of tabs
\$config[\"tabcolordark\"] = \"#848484\"; // The light (highlight) color of tabs
\$config[\"timeformat\"][\"12\"] = \"h:i a\"; // Format to display time in (12 hour foramt)
\$config[\"timeformat\"][\"24\"] = \"H:i\"; // Format to display time in (24 hour format)
\$config[\"longdateformat\"] = \"l, F j Y\"; // Format to display long dates in
\$config[\"shortdateformat\"] = \"d/m/y\"; // Format to display dates in
// Default styles, user overridable in prefs
\$config[\"MenuType\"] = 0; // Default TWIG feature list style (bold hyperlinks)
\$config[\"SubMenuType\"] = 3; // Default feature submenu style (non-bold
hyperlinks)
\$config[\"PrevNextType\"] = \"multitabs\"; // Default paging indicator style
(colored tabs)
// IMAP Mail Server Settings
\$config[\"imap_server\"] = \"localhost\"; // IMAP Server Host (defaults to
localhost)
\$config[\"imap_port\"] = \"143\"; // IMAP Server Port (defaults to 143)
\$config[\"imap_path\"] = \"\"; // IMAP Mail Path (defaults to home dir)
// Set to \"INBOX.\" for Cyrus and Courier IMAP servers.
\$config[\"imap_sentfolder\"] = \"sent-mail\"; // IMAP folder to hold sent messages (defaults
to sent-mail)
\$config[\"imap_savesent\"] = 1; // Save sent messages by default
\$config[\"mail_sender\"] = \"relay\"; // How to we deal with outgoing mail?
(internal/relay)
\$config[\"smtp_server\"] = \"localhost\"; // SMTP Relay server to send mail
through
\$config[\"smtp_port\"] = \"25\"; // SMTP Relay server port to send mail through
\$config[\"smtp_clientip\"] = 0; // Add \"X-Client-IP: <ip address of web browser>\" to
SMTP headers. (0|1)
\$config[\"news_server\"] = \"news\"; // News Server Host (defaults to localhost)
\$config[\"news_port\"] = \"119\"; // News Server Port (defaults to 119)
\$config[\"news_articles\"] = 20; // Default max number of headers to retreive at once
// \$vhosts[\"<server_name>\"] = \"config/<server_name>\"; // Setup support for virtual hosts
// Non-overridable feature disables
\$disabled[\"global_goto\"] = 0; // Disable the goto box at the bottom of page (1=yes,
0=no)
\$disabled[\"mail_showattach\"] = 1; // Disable extra message info in mailbox view
(off for performance boost)
\$disabled[\"help\"] = 1;
\$disabled[\"news\"] = 1;
\$disabled[\"meetings\"] = 1; // Disable the meetings code, it is currently in
beta testing
\$config[\"debug\"] = 0; // Set to 10 view debugging output in some parts of TWIG
// Set to 20 to view more detailed info, but may
conflict with cookie setting,
// if you need this level you should set the login
handler to sesssion
// Set to 30 to see lots of extra information that is
typiclly useless 🙂
?>
";
$fp = fopen ("$file2/config/config.inc.php3", "w");
$size = fwrite( $fp, $str);
echo ("$file2/config/config.inc.php3");
?>
\\\\\\end