diff options
Diffstat (limited to 'kolab_wizard')
-rwxr-xr-x | kolab_wizard/Kolab.pm | 98 |
1 files changed, 62 insertions, 36 deletions
diff --git a/kolab_wizard/Kolab.pm b/kolab_wizard/Kolab.pm index 88c6af17..c68236a2 100755 --- a/kolab_wizard/Kolab.pm +++ b/kolab_wizard/Kolab.pm @@ -20,11 +20,11 @@ package MDK::Wizard::Kolab; use strict; - use common; use MDK::Wizard::IFCFG; use MDK::Wizard::Wizcommon; + my $wiz = new MDK::Wizard::Wizcommon; my $HOSTNAME = chomp_(`hostname`); @@ -34,48 +34,48 @@ if (!$IPSERVER) { ($IPSERVER) = `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/m; } my $DOMAINNAME = chomp_(`domainname`); - +my $kolab_config = "/etc/kolab/kolab.conf"; my $o = { - name => N("Kolab configuration wizard"), - init => sub { - if (member($DOMAINNAME, qw(localdomain (none)))) { - return 0, N("You need to readjust your domainname, not equal to localdomain or none. Please launch drakconnect to adjust it.") - } - 1 - }, - var => { - HOSTNAME => $HOSTNAME, - ip1 => $IPSERVER, - maildomain => $DOMAINNAME, - password => '', - }, -# needed_rpm => [ 'kolab-server', 'postfix', 'openldap-servers', 'proftpd' ], - defaultimage => $ENV{__WIZ_HOME__}, -}; + name => N("Kolab configuration wizard"), + init => sub { + if (member($DOMAINNAME, qw(localdomain (none)))) { + return 0, N("You need to readjust your domainname, not equal to localdomain or none. Please launch drakconnect to adjust it.") + } + 1 + }, + var => { + HOSTNAME => $HOSTNAME, + ip1 => $IPSERVER, + maildomain => $DOMAINNAME, + password => 'a', + }, + needed_rpm => [ 'kolab-server', 'postfix', 'openldap-servers', 'proftpd' ], + defaultimage => $ENV{__WIZ_HOME__}, + }; $o->{pages} = { welcome => { - name => N("Welcome to the Kolab Groupware server configuration Wizard."), + name => N("Welcome to the Kolab Groupware server configuration Wizard.") . "\n\n" . N("Kolab is a secure, scalable and reliable groupware server. Some of the major features include: a web administration interface, a shared address book with provision for mailbox users as well as contacts and a POP3 as well as IMAP4(rev1) access to mail"), no_back => 1, - next => 'hostname' + next => 'password', }, - hostname => { - name => N("Hostname"), - data => [ - { label => N("Hostname:"), val => \$o->{var}{HOSTNAME} }, - { label => N("Mail domain:"), val => \$o->{var}{maildomain} }, - ], - next => 'password' - }, +# hostname => { +# name => N("Hostname"), +# data => [ +# { label => N("Hostname:"), val => \$o->{var}{HOSTNAME} }, +# { label => N("Mail domain:"), val => \$o->{var}{maildomain} }, +# ], +# next => 'password', +# }, password => { - name => N("Password"), + name => N("Enter pasword for the manager account of Kolab server."), data => [ { label => N("Password:"), val => \$o->{var}{password} }, { label => N("Password again:"), val => \$o->{var}{password2} }, ], post => \&check_password, - next => 'summary' + next => 'summary', }, warning => { name => N("Warning.") . "\n\n", @@ -83,7 +83,7 @@ $o->{pages} = { }, error => { name => N("Error.") . "\n\n", - next => 'config' + next => 'config', }, summary => { name => N("The wizard will now configured Kolab server with this parameters"), @@ -93,12 +93,12 @@ $o->{pages} = { { label => N("Mail domain:"), fixed_val => \$o->{var}{maildomain} }, ], post => \&do_it, - next => 'end' + next => 'end', }, end => { - name => N("Congratulations") . "\n\n" . N("The kolab server is now configured and running. Log in as 'manager' with the password you entered."), + name => N("Congratulations") . "\n\n" . N("The kolab server is now configured and running. Log in as 'manager' with the password you entered at https://127.0.0.1/kolab/admin/"), end => 1, - next => 0 + next => 0, }, }; @@ -109,14 +109,40 @@ sub new { }, $class; } +sub backup_conf { +#/etc/postfix/main.cf /etc/postfix/master.cf +#/etc/postfix/transport /etc/postfix/virtual +#/etc/cyrus.conf /etc/imapd.conf +#/etc/proftpd.conf /etc/openldap/slapd.conf +#/etc/sysconfig/saslauthd +#cp -a /var/lib/ldap $BAK +#for service in ldap saslauthd cyrus-imapd httpd postfix +#do chkconfig --level 35 $service off +#done +#/etc/init.d/kolab-server stop +#/usr/sbin/kolab_bootstrap.real -b +} + sub check_password { $o->{var}{password} ne $o->{var}{password2} or return 'passwd'; } sub do_it { - $::testing or return; - print ".....\n"; + return if $::testing; + my $in = 'interactive'->vnew('su', 'Kolab server'); + my $w = $in->wait_message(N("Kolab server"), N("Configuring Kolab server on your system...")); + system("service $_ stop") foreach qw(ldap saslauthd cyrus-imapd httpd postfix); + + open(F, "|/usr/sbin/kolab_bootstrap.real -b\n"); + print F "$o->{var}{HOSTNAME} +$o->{var}{maildomain} +$o->{var}{password} +"; + close F; + + system("service kolab-server restart"); + undef $w; } 1; |