diff options
Diffstat (limited to 'news_wizard')
-rwxr-xr-x | news_wizard/Inn.pm | 4 | ||||
-rw-r--r-- | news_wizard/news.wiz | 283 | ||||
-rw-r--r-- | news_wizard/scripts/Newsconf.pm | 77 |
3 files changed, 3 insertions, 361 deletions
diff --git a/news_wizard/Inn.pm b/news_wizard/Inn.pm index 92779f1d..76ebf4e3 100755 --- a/news_wizard/Inn.pm +++ b/news_wizard/Inn.pm @@ -2,7 +2,9 @@ # Drakwizard -# Copyright (C) 2003 Florent Villard <warly@mandrakesoft.com> +# Copyright (C) 2003 Mandrakesoft +# +# Author: Florent Villard <warly@mandrakesoft.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/news_wizard/news.wiz b/news_wizard/news.wiz deleted file mode 100644 index 1a56faf2..00000000 --- a/news_wizard/news.wiz +++ /dev/null @@ -1,283 +0,0 @@ -<?xml version="1.0"?> - - -<Wizard - name="general" - libScript="__WIZ_HOME__/common/scripts/functions.sh" - wizardTitle="News Wizard" - imagePosition="top" - defaultImage="__WIZ_HOME__/news_wizard/images/news.png" - perlModule="__WIZ_HOME__/news_wizard/scripts/Newsconf.pm" - rpm="leafnode" - summaryFunc="do_it" -> - - <Variable - name="newsServer" - comment="The host name of the news server" - shellVariable="wiz_news_server" - valueIsTranslated="false" - > - </Variable> - - <Variable - name="newsFreq" - comment="The frequency of the news server polling" - shellVariable="wiz_news_freq" - defaultValue="12" - valueIsTranslated="false" - > - </Variable> - - <Page - name="Welcome" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - <Info - helpText="Welcome to the News Wizard" - > - </Info> - - - <Info - helpText="This wizard will help you configuring the Internet News services for your network." - > - </Info> - </Page> - - <Page - name="ask_news_server" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - jumpScript="__WIZ_HOME__/news_wizard/scripts/check_news_server.sh" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Target - targetName="error_in_news_server" - jumpIndex="1" - > - </Target> - - <Target - targetName="ask_news_freq" - jumpIndex="10" - > - </Target> - - <Info - helpText="News Server" - > - </Info> - - - <Info - helpText="The news server name is the name of the host providing the Internet news to your network; the name is usually provided by your provider." - > - </Info> - - - <Freetext - name="freetext1" - comment="Host name input field" - variableName="newsServer" - fillfunc="get_server" - helpText="News Server Name:" - editable="true" - > - </Freetext> - - - <Info - helpText="Internet host names must be in the form \qhost.domain.domaintype\q; for example, if your provider is \qprovider.com\q, the internet news server is usually \qnews.provider.com\q." - > - </Info> - </Page> - - <Page - name="error_in_news_server" - comment="Error message for an incorrect hostname" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - jumpPage="ask_news_server" - nextButtonText="Fix it" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Info - helpText="The news server name is not correct" - > - </Info> - </Page> - - <Page - name="ask_news_freq" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - jumpScript="__WIZ_HOME__/news_wizard/scripts/check_valid_hours.sh" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Target - targetName="error_in_news_freq" - jumpIndex="1" - > - </Target> - - <Target - targetName="doit" - jumpIndex="10" - > - </Target> - - <Info - helpText="Polling Period" - > - </Info> - - - <Info - helpText="Your server will regularly poll the News Server for obtaning the latest Internet News; the polling period set the interval between two consecutive polling." - > - </Info> - - <Freetext - name="freetext2" - variableName="newsFreq" - helpText="Polling Period (Hours):" - editable="true" - > - </Freetext> - - - <Info - helpText="Depending on the kind of internet connection you have, an appropriate polling period can change between 6 and 24 hours." - > - </Info> - </Page> - - <Page - name="error_in_news_freq" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - jumpPage="ask_news_freq" - nextButtonText="Fix it" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Info - helpText="The polling period is not correct" - > - </Info> - </Page> - - <Page - name="doit" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - func="do_it" - nextButtonText="Configure" - executionLevel="NORMAL" - nextFinish="false" - canBack="true" - canCancel="true" - > - - <Target - targetName="catastrophic_exit" - jumpIndex="1" - > - </Target> - - <Target - targetName="done" - jumpIndex="10" - > - </Target> - - <Info - helpText="Configuring the Internet News" - > - </Info> - - - <Info - helpText="The wizard collected the following parameters -needed to configure your Internet News Service:" - > - </Info> - - - <Freetext - name="freetext" - variableName="newsServer" - helpText="News Server:" - editable="false" - > - </Freetext> - - <Freetext - name="freetext2" - variableName="newsFreq" - helpText="Polling Interval:" - editable="false" - > - </Freetext> - - - <Info - helpText="To accept these values, and configure your server, click the Next button or use the Back button to correct them." - > - </Info> - </Page> - - <Page - name="done" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - nextButtonText="Quit" - executionLevel="NORMAL" - nextFinish="true" - canBack="false" - canCancel="false" - > - - <Info - helpText="Congratulations" - > - </Info> - - - <Info - helpText="The wizard successfully configured your Internet News service of your server." - > - </Info> - </Page> - - <Page - name="catastrophic_exit" - comment="Exit in case of catastrophhic system error" - helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-news.html" - nextButtonText="Exit" - executionLevel="NORMAL" - nextFinish="true" - canBack="false" - canCancel="false" - > - - <Info - helpText="Something terrible happened" - > - </Info> - </Page> -</Wizard> diff --git a/news_wizard/scripts/Newsconf.pm b/news_wizard/scripts/Newsconf.pm deleted file mode 100644 index 10b6bfa6..00000000 --- a/news_wizard/scripts/Newsconf.pm +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl - -# Drakwizard - -# Copyright (C) 2002 MandrakeSoft Arnaud Desmons <adesmons@mandrakesoft.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -package Newsconf; -require "__WIZ_HOME__/common/scripts/Vareqval.pm"; -use MDK::Common; -use strict; - -sub normalize_freq { - my ($freq) = @_; - - if ($freq =~ /(\d*)/) { - $freq = $1; - } - if ($freq <= 0) { - $freq = 0; - } - if ($freq >= 24) { - $freq = 24; - } - $freq; -} - -sub get_server { - my %mdk = Vareqval->get("/etc/leafnode/config"); - $mdk{server}; -} - -sub normalize_server { - my ($server) = @_; - - $server; -} - -sub do_it { - $ENV{wiz_news_freq} and my $freq = normalize_freq($ENV{wiz_news_freq}) or - die "freq not defined: $!"; - $ENV{wiz_news_server} and my $server = normalize_server($ENV{wiz_news_server}) or - die "server not defined: $!"; - my $file = "/etc/leafnode/config"; - output($file, map { - s|__server__|$server|g; - $_; - } cat_("__WIZ_HOME__/news_wizard/scripts/config.default")); - $file = "/var/spool/cron/news"; - my $file_c = "/etc/leafnode/crontab"; - if (-f $file) { - MDK::Common::cp_af($file, $file_c); - MDK::Common::cp_af($file, $file . ".orig"); - } - output($file_c, map { - s|__freq__|$freq|g; - $_; - } cat_("__WIZ_HOME__/news_wizard/scripts/news.cron")); - system("crontab -u news /etc/leafnode/crontab"); - 10; -} - -1; |