#!/usr/bin/perl
# postinstall.pl
# ...  Postinstalling module Services with Tarantella.
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.31051043346- [2004_01_29_102036]

do '../web-lib.pl';
do '../stta/global-lib.pl';
do '../stta/config_info.pl';

sub module_install
{
#   chmod(0755, "$module_config_directory/site");
    $m="stta";
    &set_variables_cfg();
    # This is to parse old previous 1.3  STTA versions and to migrate them
    if (!(-d $configDir ) && ( -r "$config_directory/tarantella/config" )) {
        &read_file("$config_directory/tarantella/config", \%main::config);
        if ( $main::config{'tta_dir'} ne "" ) {
             print "<tr $cb><td><h2>$text{migrate_title} $text{config_title} </h2></td><tr>\n";
             $main::config{ldap_version}="2";
             $main::config{ldapcache_version}="2";
             $main::config{ldap2_version}="2";
             $main::config{ldapcache2_version}="2";
             $main::config{back_return}="/stta";
             $main::config{msg_noticket}=$text{msg_noticket};
             $main::config{msg_nosess}=$text{msg_nosess};
             %sttaconfig=%main::config;
             &config_save();
             &write_file("$config_directory/$m/config", \%main::config);
        }
    }
}


