Subversion Repositories slis

Compare Revisions

Ignore whitespace Rev 5879 → Rev 5880

/slim/sources/trunk/slis-slim/debian/changelog
16,6 → 16,12
* Modified default view to indicate GENERATED version
* Updated translations
[ Philippe Le Brouster ]
* Updated dns_slim.pl to generate CNAME for *.<slis_host> to <slis_host>
* Bug fix: Network CIDR use now network address instead of one IP address in
the network in scripts/ZDKS/make.php. This may cause somes problems for
somes applications.
 
-- Laurent Cooper <laurent@ac-grenoble.fr> Tue, 19 May 2009 11:45:03 +0200
 
slis-slim (2.0.5~rc5) slim-dev; urgency=low
/slim/sources/trunk/slis-slim/scripts/ZDKS/make.php
1,5 → 1,5
<?PHP
/* $Id$
/*
 
This script has been written by Bruno Bzeznik
Copyright (C) 2002 Bruno Bzeznik <Bruno@ac-grenobole.fr>
53,7 → 53,8
exit;
}
 
$vals = array('slis_name','strict_s','date','version','type','pop_id','installer','request','dks_version','ok');
$vals =
array('slis_name','strict_s','date','version','type','pop_id','installer','request','dks_version','ok');
foreach($vals as $val) {
if (isset($_POST[$val])) {
$$val = $_POST[$val];
87,7 → 88,8
// End of the main script
//
 
function prepare_directory(&$download_dir,&$slim_user,&$link_destdir,&$destdir) {
function prepare_directory(&$download_dir,&$slim_user,&$link_destdir,&$destdir)
{
if (!$download_dir) {
$download_dir="/var/www/html/slim/download";
}
112,7 → 114,8
$link_destdir .= "/output/{$slim_user->login}";
 
if (!file_exists($destdir."/.htaccess")) {
$htaccess="<LIMIT GET POST>\nrequire user {$slim_user->login}\n</LIMIT>";
$htaccess="<LIMIT GET POST>\nrequire user
{$slim_user->login}\n</LIMIT>";
$file = fopen($destdir."/.htaccess","w");
fputs($file,$htaccess);
fclose($file);
128,7 → 131,8
$dir=$download_dir ."/v". $dks_version;
}
if ( ! is_dir("$dir/$name") && ! mkdir("$dir/$name",0755,true) ) {
html_error("Error making setup disk for %s: Unable to create %s directory !",$name,"$dir/$name");
html_error("Error making setup disk for %s: Unable to create %s
directory !",$name,"$dir/$name");
}
}
 
142,8 → 146,11
}
}
 
function do_slis_dks_generations(&$sliss,&$slim_user,&$download_dir,&$link_destdir) {
lock_or_exit("/tmp/slim_make_dks.lock",1800,"Someone is already making DKS, retry later...");
function
do_slis_dks_generations(&$sliss,&$slim_user,&$download_dir,&$link_destdir)
{
lock_or_exit("/tmp/slim_make_dks.lock",1800,"Someone is already making DKS,
retry later...");
 
 
$destdir="";
156,7 → 163,8
 
prepare_directory(&$download_dir,&$slim_user,&$link_destdir,&$destdir);
 
// We need the mkvars.pl script (comes from ftp.ac-grenoble.fr/pub/slis/contribs)
// We need the mkvars.pl script (comes from
// ftp.ac-grenoble.fr/pub/slis/contribs)
if (!file_exists("$download_dir/mkvars.pl")) {
html_error("$download_dir/mkvars.pl not found!");
}
190,21 → 198,25
update_slis_version(&$slis,&$dks_version);
 
if (!file_exists("$dir/MATRIX")) {
html_error("Error making setup disk for %s: Directory %s/MATRIX/ does not exists!",$name,$dir);
html_error("Error making setup disk for %s: Directory %s/MATRIX/
does not exists!",$name,$dir);
}
 
print "version = '".$slis->version ."'\n";
switch($slis->version) {
case "4.1":
$script .= do_slis41_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script);
$script .=
do_slis41_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script);
break;
default:
$script .= do_slis3x_and_slis40_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script);
$script .=
do_slis3x_and_slis40_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script);
 
break;
}
 
$script .= do_finalize_dks(&$slis,&$dir,&$destdir,&$link_destdir,&$links,&$script);
$script .=
do_finalize_dks(&$slis,&$dir,&$destdir,&$link_destdir,&$links,&$script);
}
 
$script .= addCustomScript(&$slis,&$download_dir);
218,7 → 230,9
unlink("/tmp/slim_make_dks.lock");
}
 
function display_information($c,&$sliss,&$links,&$vtuncfg,&$local_host_names,&$download_dir) {
function
display_information($c,&$sliss,&$links,&$vtuncfg,&$local_host_names,&$download_dir)
{
global $Slis,$slim_user;
// Print the links and server confs
if ($c==0) {
235,7 → 249,8
 
// VTUND CONFIG
if ($vtuncfg != "") {
$conf_report .= "## Append this to your vtund server config file:<BR>\n";
$conf_report .= "## Append this to your vtund server config
file:<BR>\n";
$conf_report .= "<PRE>\n$vtuncfg\n</PRE>\n";
$file=fopen("$download_dir/CONFS/vtund.conf","w");
fputs($file,$vtuncfg);
243,7 → 258,8
}
 
// LOCALHOSTNAMES (sendmail config)
$conf_report .= "<BR>\n## Append this to your /etc/mail/local-host-names if necessary:<BR><PRE>\n";
$conf_report .= "<BR>\n## Append this to your
/etc/mail/local-host-names if necessary:<BR><PRE>\n";
$conf_report .= $local_host_names ."\n</PRE>";
$file=fopen("$download_dir/CONFS/local-host-names","w");
fputs($file,$local_host_names);
251,7 → 267,8
 
 
// If the user has the right, print the confs on the screen
if ($slim_user->login == "admin" || $slim_user->has_right("make_server_configs")) {
if ($slim_user->login == "admin" ||
$slim_user->has_right("make_server_configs")) {
print $conf_report;
print "##################\n\n";
 
259,18 → 276,19
// Else, send the confs to the admin by email
else {
if ($conf_required) {
$header="From: Automatic SLIM mail ". $slim_user->name ." <". $slim_user->email .">\nX-Mailer: PHP/";
$header="From: Automatic SLIM mail ". $slim_user->name ." <".
$slim_user->email .">\nX-Mailer: PHP/";
$subject="SLIS configs required from ". $slim_user->name;
$data=$conf_report;
mail($mail_admin,$subject,$data,$header);
}
}
}
} }
 
}
 
 
function do_finalize_dks(&$slis,&$dir,&$destdir,&$link_destdir,&$links,&$script) {
function
do_finalize_dks(&$slis,&$dir,&$destdir,&$link_destdir,&$links,&$script) {
// zip & gzip file creation
 
$name=$slis->name;
294,7 → 312,10
$script .= "mv -f $name $destdir\n";
 
 
$links .= "<LI><A HREF=$link_destdir/$name-$subdir.zip>$name-$subdir.zip</A> or <A HREF=$link_destdir/$name-$subdir.tar.gz>$name-$subdir.tar.gz</A> - <A HREF=$link_destdir/$name.txt>$name.txt</A>\n";
$links .= "<LI><A
HREF=$link_destdir/$name-$subdir.zip>$name-$subdir.zip</A> or <A
HREF=$link_destdir/$name-$subdir.tar.gz>$name-$subdir.tar.gz</A> - <A
HREF=$link_destdir/$name.txt>$name.txt</A>\n";
 
}
 
320,13 → 341,17
print "\nDone.\n";
}
 
function do_slis41_dks_generation(&$slis, &$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script) {
function do_slis41_dks_generation(&$slis,
&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script) {
// Needed to access to the object factories
global $Pop,$Site,$Tunel,$Route,$Slis,$SlisGroup,$FileDefvalue,$HAdminUser,$IPAddress;
global
$Pop,$Site,$Tunel,$Route,$Slis,$SlisGroup,$FileDefvalue,$HAdminUser,$IPAddress;
 
$def = new FileDefvalue();
$slis_defaults = $FileDefvalue->var_select("distinct variable","file='slis41_slis.conf'","");
$lcs_defaults = $FileDefvalue->var_select("distinct variable","file='slis41_lcs.conf'","");
$slis_defaults = $FileDefvalue->var_select("distinct
variable","file='slis41_slis.conf'","");
$lcs_defaults = $FileDefvalue->var_select("distinct
variable","file='slis41_lcs.conf'","");
 
$name = $slis->name;
 
347,7 → 372,8
$script .= "echo \"lcs-squirrelmail\">> ./$name/lcs.packages\n";
$script .= "echo \"lcs-web\">> ./$name/lcs.packages\n";
 
$script .= "echo \"# monitoring (activated in config)\">> ./$name/lcs.packages\n";
$script .= "echo \"# monitoring (activated in config)\">>
./$name/lcs.packages\n";
$script .= "echo \"slis-slim-node\">> ./$name/lcs.packages\n";
 
$script .= "echo \"# cyberschool package \">> ./$name/lcs.packages\n";
371,9 → 397,11
$type = trim($slis->type);
$cnet = find_net($slis->ip_wan,$slis->netmask_wan);
$network_wan = $cnet[network];
$cnet = find_net($network_wan,$slis->netmask_wan);
$cidr_wan = $cnet[cidr];
$cnet = find_net($slis->ip_lan,$slis->netmask_lan);
$network_lan = $cnet[network];
$cnet = find_net($network_lan,$slis->netmask_lan);
$cidr_lan = $cnet[cidr];
$varlist += array(
"%slis_type%" => $type,
381,16 → 409,22
"%slis_version%" => $slis->version,
"%slis_gateway%" => $slis->ip_gateway,
"%slis_is_isdn%" => $slis->is_isdn,
"%slis_wan_ip%" => ( $slis->is_isdn == 't' ? $slis->ip_lan : $slis->ip_wan),
"%slis_wan_netmask%" => ( $slis->is_isdn == 't' ? $slis->netmask_lan : $slis->netmask_wan),
"%slis_wan_network%" => ( $slis->is_isdn == 't' ? $network_lan : $network_wan),
"%slis_wan_cidr%" => ( $slis->is_isdn == 't' ? $cidr_lan : $cidr_wan),
"%slis_wan_ip%" => ( $slis->is_isdn == 't' ? $slis->ip_lan :
$slis->ip_wan),
"%slis_wan_netmask%" => ( $slis->is_isdn == 't' ?
$slis->netmask_lan : $slis->netmask_wan),
"%slis_wan_network%" => ( $slis->is_isdn == 't' ? $network_lan :
$network_wan),
"%slis_wan_cidr%" => ( $slis->is_isdn == 't' ? $cidr_lan :
$cidr_wan),
"%slis_lan_ip%" => $slis->ip_lan,
"%slis_lan_netmask%" => $slis->netmask_lan,
"%slis_lan_network%" => $network_lan,
"%slis_lan_cidr%" => $cidr_lan,
"%is_cyberschool%" => ( $slis->is_cyber_school != 't' ? '0' : '1'),
"%samba%" => ( $slis->is_cyber_school != 't' ? '0' : '1'),
"%is_cyberschool%" => ( $slis->is_cyber_school != 't' ? '0' :
'1'),
"%samba%" => ( $slis->is_cyber_school != 't' ? '0' :
'1'),
"%fetchmail%" => ($slis->is_fetchmail != 't' ? '0' : '1' ),
"%gateway_type%" => $slis->gateway_type,
"%gateway_user%" => $slis->gateway_user,
402,15 → 436,18
$script .= "> $name/users\n";
$groups = & $SlisGroup->select("slis_name='$name'");
foreach ($groups as $slis_group) {
$users = & $HAdminUser->select("group_id='". $slis_group->group_id ."'");
$users = & $HAdminUser->select("group_id='". $slis_group->group_id
."'");
foreach ($users as $user) {
$script .= "htpasswd -b $name/users ". $user->login ." ". $user->password ."\n";
$script .= "htpasswd -b $name/users ". $user->login ." ".
$user->password ."\n";
$n_users++;
}
}
$users = & $HAdminUser->select("slis_name='$name'");
foreach ($users as $user) {
$script .= "htpasswd -b $name/users ". $user->login ." ". $user->password ."\n";
$script .= "htpasswd -b $name/users ". $user->login ." ".
$user->password ."\n";
$n_users++;
if ($user->login == 'admin') {
$varlist += array(
435,22 → 472,24
$sdns=$pop->get_secondary_dns_name();
$smtp = $pop->get_smtp_name();
$mailhost=$pop->get_mailhost_name();
$varlist += array(
"%pop_name%" => $pop->name,
$varlist += array( "%pop_name%" => $pop->name,
"%dns_primary%" => ($pdns ? $pdns : ""),
"%dns_primary_ip%" => ($pdns ? $IPAddress->get_router_ip_from_router_name($pdns) : ""),
"%dns_primary_ip%" => ($pdns ?
$IPAddress->get_router_ip_from_router_name($pdns) : ""),
"%dns_secondary%" => ($sdns ? $sdns : ""),
"%dns_secondary_ip%" => ($sdns ? $IPAddress->get_router_ip_from_router_name($sdns) : ""),
"%dns_secondary_ip%" => ($sdns ?
$IPAddress->get_router_ip_from_router_name($sdns) : ""),
"%proxy%" => $proxy,
"%smtp_relay%" => ($smtp ? $smtp : ""),
"%smtp_relay_ip%" => ($smtp ? $IPAddress->get_router_ip_from_router_name($smtp) : ""),
"%smtp_relay_ip%" => ($smtp ?
$IPAddress->get_router_ip_from_router_name($smtp) : ""),
"%mailhost%" => ($mailhost ? $mailhost : ""),
"%mailhost_ip%" => ($mailhost ? $IPAddress->get_router_ip_from_router_name($mailhost) : "")
"%mailhost_ip%" => ($mailhost ?
$IPAddress->get_router_ip_from_router_name($mailhost) : "")
);
} else {
print "WARNING: Pop $pop_id not found for $name\n";
$varlist += array(
"%pop_name%" => "",
$varlist += array( "%pop_name%" => "",
"%dns_primary%" => "auto",
"%dns_primary_ip%" => "auto",
"%dns_secondary%" => "auto",
534,21 → 573,18
$script .= "\n# Tunel routes\n";
$script .= "> $name/routes.tun\n";
$tunnel=$tunnels[0];
$routes=& $Route->select("tunel_id='". $tunnel->id ."'");
if ($tunnel->type == "vtun") {
$dev="tun0";
} elseif ($tunnel->type == "ipsec") {
$dev="ipsec0";
} else {
$dev="tun0";
}
$routes=& $Route->select("tunel_id='". $tunnel->id ."'"); if
($tunnel->type == "vtun") { $dev="tun0"; } elseif ($tunnel->type ==
"ipsec") { $dev="ipsec0"; } else { $dev="tun0"; }
foreach ($routes as $route) {
$net=$route->network_name;
list($addr,$mask)=explode("/",$net);
if ($mask == "32") {
$script .= "echo \"/sbin/route add -host $addr $dev\" >> $name/routes.tun\n";
$script .= "echo \"/sbin/route add -host $addr $dev\" >>
$name/routes.tun\n";
} else {
$script .= "echo \"/sbin/route add -net $net $dev\" >> $name/routes.tun\n";
$script .= "echo \"/sbin/route add -net $net $dev\" >>
$name/routes.tun\n";
}
}
}
566,13 → 602,10
$script .= "# End of custom script\n\n";
}
 
if ($pop) {
$numbers=& $pop->get_lines();
if ($pop) { $numbers=& $pop->get_lines();
if ($numbers) { $number=$numbers[0]->number; $numip=substr($number,1);}
else { $number="PPP NUMBER NOT FOUND INTO SLIM"; $numip=$number;}
} else {
$number="PPP NUMBER NOT FOUND INTO SLIM";
}
} else { $number="PPP NUMBER NOT FOUND INTO SLIM"; }
 
$varlist = array("XXXIPADDRXXX" => $slis->ip_gateway,
"XXXSLISIPXXX" => $slis->ip_wan,
604,12 → 637,16
fclose ($file);
}
 
function do_slis3x_and_slis40_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script) {
function
do_slis3x_and_slis40_dks_generation(&$slis,&$dir,&$download_dir,&$local_host_names,&$vtuncfg,&$script)
{
// Needed to access to the object factories
global $Pop,$Site,$Tunel,$Route,$Slis,$SlisGroup,$FileDefvalue,$HAdminUser,$IPAddress;
global
$Pop,$Site,$Tunel,$Route,$Slis,$SlisGroup,$FileDefvalue,$HAdminUser,$IPAddress;
 
$def=new FileDefvalue();
$file_defaults=$FileDefvalue->var_select("distinct variable","file='setup.data'","");
$file_defaults=$FileDefvalue->var_select("distinct
variable","file='setup.data'","");
 
// Prepare some variables we'll use later
$name=$slis->name;
699,12 → 736,15
if ($smtp) {
$script .= " SMTP_OUT::\"$smtp\" \\\n";
$script .= " RELAY_HOST::\"$smtp\" \\\n";
$script .= " SMTP_OUT_IP::\"". $IPAddress->get_router_ip_from_router_name($smtp) ."\" \\\n";
$script .= " SMTP_OUT_IP::\"".
$IPAddress->get_router_ip_from_router_name($smtp) ."\" \\\n";
}
$mailhost=$pop->get_mailhost_name();
if ($mailhost) {
$script .= " SMART_HOST::\"$mailhost\" \\\n";
$script .= " SMART_HOST_IP::\"". $IPAddress->get_router_ip_from_router_name($mailhost) ."\" \\\n";
$script .= " SMART_HOST_IP::\"".
$IPAddress->get_router_ip_from_router_name($mailhost) ."\"
\\\n";
}
}
else {
732,8 → 772,10
$vtuncfg .= " encr yes;\n";
$vtuncfg .= " keepalive no;\n";
$vtuncfg .= " up {\n";
$vtuncfg .= " programm /usr/local/sbin/killtun \"". $tun->login ." ". $tun->tun_slis_ip ." %d\" wait;\n";
$vtuncfg .= " ifconfig \"%% ". $tun->tun_svr_ip ." pointopoint ". $tun->tun_slis_ip ." mtu 1350\";\n";
$vtuncfg .= " programm /usr/local/sbin/killtun \"".
$tun->login ." ". $tun->tun_slis_ip ." %d\" wait;\n";
$vtuncfg .= " ifconfig \"%% ". $tun->tun_svr_ip ."
pointopoint ". $tun->tun_slis_ip ." mtu 1350\";\n";
$vtuncfg .= " };\n";
$vtuncfg .= "}\n\n";
}
741,8 → 783,7
$script .= " IPSEC::\"1\" \\\n";
$script .= " IPSEC_SERVER::\"". $tun->server_ip ."\" \\\n";
$script .= " IPSEC_SLIS_ID::\"". $tun->login ."\" \\\n";
$script .= " IPSEC_PUBKEY::\"". $tun->password ."\" \\\n";
}
$script .= " IPSEC_PUBKEY::\"". $tun->password ."\" \\\n"; }
}
 
// Default customized variables (file_default table)
792,15 → 833,18
$script .= "> $name/users\n";
$groups = & $SlisGroup->select("slis_name='$name'");
foreach ($groups as $slis_group) {
$users = & $HAdminUser->select("group_id='". $slis_group->group_id ."'");
$users = & $HAdminUser->select("group_id='". $slis_group->group_id
."'");
foreach ($users as $user) {
$script .= "htpasswd -b $name/users ". $user->login ." ". $user->password ."\n";
$script .= "htpasswd -b $name/users ". $user->login ." ".
$user->password ."\n";
$n_users++;
}
}
$users = & $HAdminUser->select("slis_name='$name'");
foreach ($users as $user) {
$script .= "htpasswd -b $name/users ". $user->login ." ". $user->password ."\n";
$script .= "htpasswd -b $name/users ". $user->login ." ".
$user->password ."\n";
$n_users++;
}
if ($n_users == 0) {
813,21 → 857,18
$script .= "\n# Tunel routes\n";
$script .= "> $name/routes.tun\n";
$tunnel=$tunnels[0];
$routes=& $Route->select("tunel_id='". $tunnel->id ."'");
if ($tunnel->type == "vtun") {
$dev="tun0";
} elseif ($tunnel->type == "ipsec") {
$dev="ipsec0";
} else {
$dev="tun0";
}
$routes=& $Route->select("tunel_id='". $tunnel->id ."'"); if
($tunnel->type == "vtun") { $dev="tun0"; } elseif ($tunnel->type ==
"ipsec") { $dev="ipsec0"; } else { $dev="tun0"; }
foreach ($routes as $route) {
$net=$route->network_name;
list($addr,$mask)=explode("/",$net);
if ($mask == "32") {
$script .= "echo \"/sbin/route add -host $addr $dev\" >> $name/routes.tun\n";
$script .= "echo \"/sbin/route add -host $addr $dev\" >>
$name/routes.tun\n";
} else {
$script .= "echo \"/sbin/route add -net $net $dev\" >> $name/routes.tun\n";
$script .= "echo \"/sbin/route add -net $net $dev\" >>
$name/routes.tun\n";
}
}
}
842,17 → 883,15
}
 
 
// we need to do the query again, as some fields may have been changed (version numbers)
// we need to do the query again, as some fields may have been changed
// (version numbers)
//$sliss =& $Slis->select($cond,"name");
//$Slis->applyRestriction(&$sliss, "make_dks");
 
if ($pop) {
$numbers=& $pop->get_lines();
if ($pop) { $numbers=& $pop->get_lines();
if ($numbers) { $number=$numbers[0]->number; $numip=substr($number,1);}
else { $number="PPP NUMBER NOT FOUND INTO SLIM"; $numip=$number;}
} else {
$number="PPP NUMBER NOT FOUND INTO SLIM";
}
} else { $number="PPP NUMBER NOT FOUND INTO SLIM"; }
 
$varlist = array("XXXIPADDRXXX" => $slis->ip_gateway,
"XXXSLISIPXXX" => $slis->ip_wan,
893,8 → 932,10
$vtuncfg .= " encr yes;\n";
$vtuncfg .= " keepalive no;\n";
$vtuncfg .= " up {\n";
$vtuncfg .= " programm /usr/local/sbin/killtun \"". $tun->login ." ". $tun->tun_slis_ip ." %d\" wait;\n";
$vtuncfg .= " ifconfig \"%% ". $tun->tun_svr_ip ." pointopoint ". $tun->tun_slis_ip ." mtu 1350\";\n";
$vtuncfg .= " programm /usr/local/sbin/killtun \"". $tun->login
." ". $tun->tun_slis_ip ." %d\" wait;\n";
$vtuncfg .= " ifconfig \"%% ". $tun->tun_svr_ip ." pointopoint ".
$tun->tun_slis_ip ." mtu 1350\";\n";
$vtuncfg .= " };\n";
$vtuncfg .= "}\n\n";
}
908,10 → 949,12
$form = new Form();
$form->set_title("Selection des SLIS a generer");
if ($_POST['history_date']){
$form->add_field(new HiddenField("history_date",$_POST['$history_date'],"Date"));
$form->add_field(new
HiddenField("history_date",$_POST['$history_date'],"Date"));
$form->add_field(new HiddenField("slis_name",$slis->name,"Nom"));
} else {
$form->add_field(new FormField("slis_name", "Nom", $_POST['slis_name'], 0));
$form->add_field(new FormField("slis_name", "Nom", $_POST['slis_name'],
0));
}
$fi = new CheckboxField("strict_s", "Strict", $_POST['strict_s']);
if ($history_date){
920,19 → 963,28
// $fi->set_readonly();
$form->add_field($fi);
 
// $form->add_field(new CheckboxField("strict_s", "Strict", $strict_s),$preview == "auto");
// $form->add_field(new CheckboxField("strict_s", "Strict",
// $strict_s),$preview == "auto");
 
$form->add_field(new OptionField("status_id", "Status", $Status->get_status_list(), $_POST['status_id'], 0));
$form->add_field(new OptionField("type", "Type", $Slis->get_types(), $_POST['type'], 0));
$form->add_field(new OptionField("pop_id", "Pop", $Pop->get_pop_list(), $_POST['pop_id'], 0));
$form->add_field(new OptionField("installer", "Installateur", $Installer->get_installer_list(), $_POST['installer'], 0));
$form->add_field(new OptionField("status_id", "Status",
$Status->get_status_list(), $_POST['status_id'], 0));
$form->add_field(new OptionField("type", "Type", $Slis->get_types(),
$_POST['type'], 0));
$form->add_field(new OptionField("pop_id", "Pop", $Pop->get_pop_list(),
$_POST['pop_id'], 0));
$form->add_field(new OptionField("installer", "Installateur",
$Installer->get_installer_list(), $_POST['installer'], 0));
if ($_POST['date']) { $today=$_POST['date']; }
#else { $today=date("Y-m-d"); }
$form->add_field(new FormField("date", "Date de creation posterieure a", "$today", 0));
$form->add_field(new TextField("request", "Requete avancee", $_POST['request'],4,20,1));
# $form->add_field(new CheckboxField("conf_required", "Envoyer requete de conf a l'administrateur du domaine", "0"));
$form->add_field(new FormField("date", "Date de creation posterieure a",
"$today", 0));
$form->add_field(new TextField("request", "Requete avancee",
$_POST['request'],4,20,1));
# $form->add_field(new CheckboxField("conf_required", "Envoyer requete de
# conf a l'administrateur du domaine", "0"));
$form->add_field(new LineField());
$form->add_field(new OptionField("dks_version", "Version to use", $dks_version_list, $_POST['dks_version'], 0));
$form->add_field(new OptionField("dks_version", "Version to use",
$dks_version_list, $_POST['dks_version'], 0));
$form->add_button(new Button("Preview", "preview"));
$form->add_button(new Button("Make", "ok"));
print $form->build_code();
980,7 → 1032,8
function get_dks_versions(&$download_dir) {
global $download_dir;
 
// olecam: if the file dks.conf does exist in the download directory, then use its content to generate
// olecam: if the file dks.conf does exist in the download directory, then
// use its content to generate
// the available dks versions
if (is_file("$download_dir/dks_versions.conf")) {
$fd = fopen("$download_dir/dks_versions.conf", "r");
998,7 → 1051,8
if ($handle = opendir($download_dir)) {
while (false !== ($file = readdir($handle))) {
// print ($file."<br>");
if ($file != "." && $file != ".." && is_dir($download_dir."/".$file)) {
if ($file != "." && $file != ".." &&
is_dir($download_dir."/".$file)) {
if (strpos($file,"v")==0 && strpos($file,"dks")>-1)
$retval[substr($file,1)] = $file ; //substr($file,1);
}
/slim/sources/trunk/slis-slim/system_scripts/dns_slim.pl
135,6 → 135,7
if (($RCF1918_1->contains($space) || $RCF1918_2->contains($space) || $RCF1918_3->contains($space))
&& $found) {
$zone{$domain ."_1918_REJECTS"}.="$host IN A $ip\n";
$zone{$domain ."_1918_REJECTS"}.="*.$host IN CNAME $host\n";
$count{$domain ."_1918_REJECTS"}++;
print "Warning: rejecting $host with ip $ip from $domain zone (no rfc1918 into public zone)\n";
}
152,6 → 153,7
 
#Declaration zone et reverse
$zone{"$domain"}.="$host IN A $ip\n";
$zone{"$domain"}.="*.$host IN CNAME $host\n";
$count{"$domain"}++;
if ($rev{"$ip"} != 1 && $domain ne "UNDEF") {
$rev{"$ip"}=1;
195,6 → 197,7
$domain="MIGRATION-pub.$DOMAIN";
}
$zone{"$domain"}.="$host IN A $ip\n";
$zone{"$domain"}.="*.$host IN CNAME $host\n";
$count{"$domain"}++;
if ($rev{"$ip"} != 1) {
#print "Notice: declaration de $ip -> $host.MIGRATION.$DOMAIN\n";