added script to remove unneeded .wgaccess files instead of running during upgrade

This commit is contained in:
Graham Knop 2008-02-26 23:28:08 +00:00
parent 8fdd413d12
commit 1673a67dfc
3 changed files with 32 additions and 21 deletions

View file

@ -4,8 +4,9 @@
- The YUI library used in WebGUI has been upgraded to 2.5.0.
- The resizable text area implementation used in WebGUI has been
migrated to the code provided by YUI 2.5.0.
- As a result of the above, we no longer need extjs, and it has been
- As a result of the above, we no longer need extjs, and it has been
removed.
- added script to remove unneeded .wgaccess files instead of having it run during upgrade
7.5.3
- prevent HTML and Macro injection in usernames

View file

@ -23,31 +23,11 @@ my $quiet; # this line required
my $session = start(); # this line required
removePublicStorageAccessFiles($session);
# upgrade functions go here
finish($session); # this line required
#-------------------------------------------------
sub removePublicStorageAccessFiles {
my $session = shift;
print "\tRemoving unnecessary .wgaccess files.\n" unless ($quiet);
my $uploadsPath = $session->config->get('uploadsPath');
File::Find::find({no_chdir => 1, wanted => sub {
return if -d $File::Find::name;
my $filename = (File::Spec->splitpath($File::Find::name))[2];
return if $filename ne '.wgaccess';
open my $fh, '<', $File::Find::name or return;
local $/ = "\n";
chomp (my ($user, $viewGroup, $editGroup) = <$fh>);
close $fh;
if ($user eq '1' || $viewGroup eq '1' || $viewGroup eq '7' || $editGroup eq '1' || $editGroup eq '7') {
unlink $File::Find::name;
}
}}, $uploadsPath);
}
##-------------------------------------------------
#sub exampleFunction {
# my $session = shift;