|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/libexec/webmin/status/ |
Upload File : |
# change-monitor.pl
# Check if some file or directory has changed
sub get_change_status
{
local %change;
&read_file("$module_config_directory/change", \%change);
local $t = $change{$_[0]->{'file'}};
local @st = stat($_[0]->{'file'});
local $rv;
if ($t && $st[9] != $t) {
$rv = { 'up' => 0 };
}
elsif (!$t) {
$rv = { 'up' => -1 };
}
else {
$rv = { 'up' => 1 };
}
$change{$_[0]->{'file'}} = $st[9];
&write_file("$module_config_directory/change", \%change);
return $rv;
}
sub show_change_dialog
{
print &ui_table_row($text{'change_file'},
&ui_textbox("file", $_[0]->{'file'}, 30)." ".
&file_chooser_button("file", 0), 3);
}
sub parse_change_dialog
{
$_[0]->{'file'} = $in{'file'};
}