automatically run --daemon-mode when admin or notices are run.

This commit is contained in:
kestes%walrus.com 2002-04-26 22:42:44 +00:00
parent 2762eaebca
commit ec30a74a29
3 changed files with 24 additions and 12 deletions

View File

@ -6,8 +6,8 @@
# on the tinderbox status page.
# $Revision: 1.10 $
# $Date: 2001/12/03 19:57:35 $
# $Revision: 1.11 $
# $Date: 2002/04/26 22:42:44 $
# $Author: kestes%walrus.com $
# $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/bin/addnote.cgi,v $
# $Name: $
@ -192,6 +192,8 @@ sub save_note {
push @out, "posted notice: \n",p().
pre($NOTE);
HTMLPopUp::regenerate_HTML_pages();
return @out;
}

View File

@ -7,8 +7,8 @@
# columns from being shown on the default pages.
# $Revision: 1.18 $
# $Date: 2001/12/07 19:30:34 $
# $Revision: 1.19 $
# $Date: 2002/04/26 22:42:44 $
# $Author: kestes%walrus.com $
# $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/bin/admintree.cgi,v $
# $Name: $
@ -265,7 +265,7 @@ sub format_input_page {
password_field(-name=>'passwd', -size=>8,),
p(),
checkbox( -label=>("If correct, ".
"remember password and email ".
"remember password and email field".
"as a cookie"),
-name=>'use_cookie'),
p(),
@ -534,12 +534,8 @@ sub make_all_changes {
"different administrators can change ".
"the settings at the same time.");
# I believe this will work, it is too hard to get the full
# pathname of tinder.cgi into the script. However the webserver
# may play strange games with our ARGV and prevent us from
# updating the state.
HTMLPopUp::regenerate_HTML_pages();
system( (basename($0).'/tinder.cgi'), '--daemon-mode' );
} else {
push @results, "No changes attempted due to security issues.";
}

View File

@ -12,8 +12,8 @@
# the completed string before it is returned.
# $Revision: 1.11 $
# $Date: 2001/12/03 19:48:47 $
# $Revision: 1.12 $
# $Date: 2002/04/26 22:42:42 $
# $Author: kestes%walrus.com $
# $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/lib/HTMLPopUp.pm,v $
# $Name: $
@ -229,8 +229,22 @@ sub split_cgi_args {
return %form;
}
# Run tinderbox again to regenerate the pages. I put this function
# here because we need to bypass the security arangements. Normally
# you can not run --daemon-mode from an arbitrary CGI script. This
# part of the code (split_cgi_args) is the only part which knows which
# Environmental variables are checked for security.
sub regenerate_HTML_pages {
local $ENV{"QUERY_STRING"} = '';
system(
$FileStructure::URLS{'tinderd'},
'--daemon-mode',
);
return 0;
}