summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmdkonline51
1 files changed, 35 insertions, 16 deletions
diff --git a/mdkonline b/mdkonline
index 3c55305d..344c5188 100755
--- a/mdkonline
+++ b/mdkonline
@@ -54,7 +54,7 @@ sub translate {
$s ? c::dgettext('mdkonline', $s) : '';
}
-my $authentication_host = "http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php";
+#my $authentication_host = "http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php";
my $nb_pages=6; # 0 to 5
my $page;
@@ -135,6 +135,18 @@ sub init_ui {
$Button_End->signal_connect(clicked =>\&on_end_clicked);
}
+sub gtk_main_quit {
+ # remove local files
+ if ($login && $passwd) {
+ [ -f "/root/$login.$passwd.online.log.bz2.uue" ] && unlink ("/root/$login.$passwd.online.log.bz2.uue");
+ [ -f "/root/$login.$passwd.online.log.bz2" ] && unlink ("/root/$login.$passwd.online.log.bz2");
+ }
+
+ # quit
+ print _("Quitting Wizard\n");
+ main_quit Gtk;
+}
+
sub on_end_clicked {
gtk_main_quit();
}
@@ -249,10 +261,10 @@ sub test_passwd () {
my $ua = LWP::UserAgent->new;
$ua->agent("MdkOnlineAgent/0.15" . $ua->agent);
# TEST URL
- my $request = HTTP::Request->new(GET => 'http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php?u=mark&p=26bdb06eabafac3aea95991149dd8ea9');
+# my $request = HTTP::Request->new(GET => 'http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php?u=mark&p=26bdb06eabafac3aea95991149dd8ea9');
# REAL ONE
-# print STDERR "url used for auth.: $authentication_host?u=$login&p=$passwd \n";
-# my $request = HTTP::Request->new(GET => '$authentication_host?u=$login&p=$passwd');
+# print STDERR "url used for auth.: http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php?u=$login&p=$passwd\n";
+ my $request = HTTP::Request->new(GET => 'http://www.mandrakeexpert.com/firsttimewizard/validusercheck.php?u='.$login.'&p='.$passwd);
my $response = $ua->request($request);
# Check the outcome of the response
if ($response->is_success) {
@@ -310,27 +322,36 @@ sub send_config {
# NEW METHOD (http)
my $ua = LWP::UserAgent->new;
$ua->agent("MdkOnlineAgent/0.15" . $ua->agent);
- my $response = $ua->request(POST 'http://dev-online/upload/wizard.php',
+# TESTS ONLY
+# my $response = $ua->request(POST 'http://dev-online/upload/wizard.php',
+# Content_Type => 'form-data',
+# Content => [submit => "upload_wizard",
+# wizard => ["/root/$login.$passwd.online.log.bz2.uue"]
+# ]);
+ my $response = $ua->request(POST 'http://upload.mandrakeonline.net/wizard.php',
Content_Type => 'form-data',
Content => [submit => "upload_wizard",
wizard => ["/root/$login.$passwd.online.log.bz2.uue"]
]);
# Check the outcome of the response
- print "REPONSE: ".$response->content."\n";
+# print "REPONSE: ".$response->content."\n";
if ($response->is_success) {
- $result = 0;
+ $result = ($response->content =~ /TRUE/) ? 0 : -1;
} else {
# pb with the connection ?
- info_popup (_("Connection problem"), _("MandrakeOnline could not be contacted, please try again at a later time"));
+# info_popup (_("Connection problem"), _("MandrakeOnline could not be contacted, please try again at a later time"));
$result = -1;
}
# if informations were sent correctly (exit code: 0 from scp script), go to page 5
if (! $result) {
+ # go to last page
$notebook_global->set_page(5);
} else {
# if incorrect, go/stay on page 4 to retry sending data
+ # pb with the connection ?
+ info_popup (_("Connection problem"), _("MandrakeOnline could not be contacted, please try again at a later time"));
$notebook_global->set_page(4);
}
@@ -371,7 +392,7 @@ sub step_wizard {
my $vbox_rev=new Gtk::VBox(0,0);
write_on_pixmaps($vbox_rev,"mailnews.png",_("Sending your Configuration"),540,100);
- my $label_rev = new Gtk::Label(_("In order to benefit from MandrakeOnline services,\nwe are about to upload your configuration.\n\nThe Wizard will now send the following information to MandrakeSoft:\n1) the list of packages you have installed on your system,\n2) your hardware configuration.\n\nIf you feel uncomfortable by that idea, or do not want to benefit from this service,\nplease press 'Cancel'. By pressing 'Next', you allow us to keep you informed\nabout security updates and useful upgrades via personalized email alerts.\nFurthermore, you benefit from discounted paid support services on\nwww.mandrakeexpert.com.\nFinally, an email alias with your username@mandrakeonline.net will be provided to you."));
+ my $label_rev = new Gtk::Label(_("In order to benefit from MandrakeOnline services,\nwe are about to upload your configuration.\n\nThe Wizard will now send the following information to MandrakeSoft:\n1) the list of packages you have installed on your system,\n2) your hardware configuration.\n\nIf you feel uncomfortable by that idea, or do not want to benefit from this service,\nplease press 'Cancel'. By pressing 'Next', you allow us to keep you informed\nabout security updates and useful upgrades via personalized email alerts.\nFurthermore, you benefit from discounted paid support services on\nwww.mandrakeexpert.com.\nFinally, an email alias with your username\@mandrakeonline.net will be provided to you."));
$label_rev->set_uposition(20,150);
$vbox_rev->pack_start($label_rev,0,0,1);
$notebook_global->append_page($vbox_rev,new Gtk::Label("revision"));
@@ -429,7 +450,7 @@ sub confirm_quit {
$bbox1->add($button_cancel);
my $button_quit = new Gtk::Button(" " . _("Quit") . " ");
- $button_quit->signal_connect_object("clicked",\&gtk_main_quit);
+ $button_quit->signal_connect (clicked =>\&gtk_main_quit);
$bbox1->add($button_quit);
my $label = new Gtk::Label(
@@ -466,7 +487,8 @@ sub load_text {
open( FILE, $file ) or die "load_text: missing file $file";
foreach $line ( <FILE> )
{
- $text->insert( $fixed_font, undef, undef, $line );
+# $text->insert( $fixed_font, undef, undef, $line );
+ $text->insert( undef, undef, undef, $line );
}
close( FILE );
}
@@ -493,7 +515,8 @@ sub gtkpng { new Gtk::Pixmap(gtkcreate_png(@_)) }
sub gtkcreate_png {
my ($f) = @_;
$f =~ m|.png$| or $f="$f.png";
- if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach $ENV{SHARE_PATH}, "$pixmaps", "pixmaps" }
+# if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach $ENV{SHARE_PATH}, "$pixmaps", "pixmaps" }
+ if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach $ENV{SHARE_PATH}, "pixmaps" }
my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f";
$im->render($im->rgb_width, $im->rgb_height);
($im->move_image(), $im->move_mask);
@@ -544,8 +567,4 @@ sub splash_warning {
$win_about->set_modal(1);
}
-sub gtk_main_quit {
- print _("Quitting Wizard\n");
- main_quit Gtk;
-}