Skip to content

Commit

Permalink
Fix to use API when printing done or error
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 29, 2022
1 parent ab30000 commit 009a33e
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions import.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ if ($in{'confirm'}) {
&foreign_call($usermodule, "making_changes");
&foreign_call($usermodule, "create_group", \%ginfo);
&foreign_call($usermodule, "made_changes");
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}
else {
%ginfo = %$ginfo;
Expand All @@ -247,7 +247,7 @@ if ($in{'confirm'}) {
&foreign_call($usermodule, "making_changes");
&foreign_call($usermodule, "create_user", \%uinfo);
&foreign_call($usermodule, "made_changes");
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

if (!-d $uinfo{'home'}) {
# Create his home directory, and copy files into it
Expand All @@ -259,7 +259,7 @@ if ($in{'confirm'}) {
&system_logged("chown $uid:$gid '$uinfo{'home'}'");
&copy_skel_files($config{'virtual_skel'},
\%uinfo, $uinfo{'home'});
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}
}
else {
Expand All @@ -279,7 +279,7 @@ if ($in{'confirm'}) {
"chown $uid:$ugid '$uinfo{'home'}/$d->[0]'");
}
}
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

if ($found{'ssl'}) {
# Find and record the SSL key files
Expand Down Expand Up @@ -318,7 +318,7 @@ if ($in{'confirm'}) {
$u->{'uid'}, $oldu->{'gid'},
$u->{'uid'}, $u->{'gid'});
}
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}

# Find any slave DNS servers with the domain
Expand All @@ -341,7 +341,7 @@ if ($in{'confirm'}) {
&find_html_cgi_dirs(\%dom);
print $text{'setup_save'},"<br>\n";
&save_domain(\%dom, 1);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# Create or update webmin user
if ($in{'webmin'} && !$parent) {
Expand Down
2 changes: 1 addition & 1 deletion install_ratelimit.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (!$before && $ok) {
}
&flush_file_lines();
&unlock_file(&get_ratelimit_config_file());
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}

&webmin_log("install", "ratelimit");
Expand Down
6 changes: 3 additions & 3 deletions restart_script.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ $sinfo && $script || &error($text{'stopscript_egone'});
print &text('stopscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
&{$script->{'stop_server_func'}}($d, $sinfo->{'opts'});
sleep(1); # Give it time to shut down
print &text('setup_done'),"<p>\n";
&$second_print($text{'setup_done'});

print &text('startscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
$err = &{$script->{'start_server_func'}}($d, $sinfo->{'opts'});
if ($err) {
print &text('startscript_failed', $err),"<p>\n";
&$second_print(&text('startscript_failed', $err));
}
else {
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}
&run_post_actions();
if (!$err) {
Expand Down
4 changes: 2 additions & 2 deletions save_domain.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ if ($plan && $plan->{'id'} ne $d->{'plan'}) {
}
$d->{'plan'} = $plan->{'id'};
&set_plan_on_children($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}

# Update prefix
Expand Down Expand Up @@ -326,7 +326,7 @@ else {
# Save new domain details
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# If the IP has changed, update any alias domains too
if ($d->{'ip'} ne $oldd->{'ip'} ||
Expand Down
4 changes: 2 additions & 2 deletions save_frame.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ if ($in{'enabled'}) {
# Regenerate frame-forwarding file
print $text{'frame_gen'},"<br>\n";
&create_framefwd_file($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}

# Save the domain
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# Run the after command
&run_post_actions();
Expand Down
4 changes: 2 additions & 2 deletions save_newip.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ foreach $f (&list_feature_plugins()) {
# Save new domain details
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"\n";
&$second_print($text{'setup_done'});
&$outdent_print();

# Get and update all alias domains
Expand Down Expand Up @@ -381,7 +381,7 @@ foreach $sd (@doms) {
# Save new domain details
print $text{'save_domain'},"<br>\n";
&save_domain($sd);
print $text{'setup_done'},"\n";
&$second_print($text{'setup_done'});
&$outdent_print();
}

Expand Down
2 changes: 1 addition & 1 deletion save_newips.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ foreach $d (@doms) {
# Save new domain details
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# Run the after command
&set_domain_envs($d, "MODIFY_DOMAIN", undef, \%oldd);
Expand Down
2 changes: 1 addition & 1 deletion save_pass.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if ($d) {
# Save new domain details
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# Run the after command
&run_post_actions();
Expand Down
2 changes: 1 addition & 1 deletion save_proxy.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ foreach $f (&list_ordered_features($d)) {
# Save the domain
print $text{'save_domain'},"<br>\n";
&save_domain($d);
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});

# Run the after command
&run_post_actions();
Expand Down
4 changes: 2 additions & 2 deletions start_script.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ $sinfo && $script || &error($text{'stopscript_egone'});
print &text('startscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
$err = &{$script->{'start_server_func'}}($d, $sinfo->{'opts'});
if ($err) {
print &text('startscript_failed', $err),"<p>\n";
&$second_print(&text('startscript_failed', $err));
}
else {
print $text{'setup_done'},"<p>\n";
&$second_print($text{'setup_done'});
}
&run_post_actions();
if (!$err) {
Expand Down
2 changes: 1 addition & 1 deletion stop_script.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $sinfo && $script || &error($text{'stopscript_egone'});

print &text('stopscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
&{$script->{'stop_server_func'}}($d, $sinfo->{'opts'});
print &text('setup_done'),"<p>\n";
&$second_print($text{'setup_done'});
&run_post_actions();
&webmin_log("stop", "script", $sinfo->{'name'},
{ 'ver' => $sinfo->{'version'},
Expand Down

0 comments on commit 009a33e

Please sign in to comment.