]> git.p6c8.net - devedit.git/blobdiff - modules/Config/DevEdit.pm
Added new configurtaion option for hiding dot files.
[devedit.git] / modules / Config / DevEdit.pm
index aa76b5ebbc190d1286453e81994569c8e0385ee3..8d9d50398f6eb7d19a388e25c66ea984edb608d1 100644 (file)
@@ -6,7 +6,7 @@ package Config::DevEdit;
 # Read and parse the configuration files
 #
 # Author:        Patrick Canterino <patrick@patshaping.de>
-# Last modified: 2005-08-24
+# Last modified: 2005-09-30
 #
 
 use strict;
@@ -45,6 +45,20 @@ sub read_config($)
  {
   my $userconf = parse_config($config->{'userconf_file'});
 
+  # Parse aliases (we use references, so we won't get a memory
+  # problem so soon...)
+
+  foreach my $user(keys(%$userconf))
+  {
+   if(my $aliases = $userconf->{$user}->{'aliases'})
+   {
+    foreach my $alias(parse_line('\s+',0,$aliases))
+    {
+     $userconf->{$alias} = $userconf->{$user} unless($userconf->{$alias});
+    }
+   }
+  }
+
   if($userconf->{$ENV{'REMOTE_USER'}})
   {
    # The current HTTP Auth user has got an individual configuration
@@ -52,12 +66,14 @@ sub read_config($)
 
    my $new_conf = $userconf->{$ENV{'REMOTE_USER'}};
 
-   $config->{'fileroot'}  = $new_conf->{'fileroot'}  if($new_conf->{'fileroot'});
-   $config->{'httproot'}  = $new_conf->{'httproot'}  if($new_conf->{'httproot'});
+   $config->{'fileroot'}       = $new_conf->{'fileroot'}  if($new_conf->{'fileroot'});
+   $config->{'httproot'}       = $new_conf->{'httproot'}  if($new_conf->{'httproot'});
+
+   $config->{'forbidden'}      = $new_conf->{'forbidden'} if(defined $new_conf->{'forbidden'});
 
-   $config->{'forbidden'} = $new_conf->{'forbidden'} if(defined $new_conf->{'forbidden'});
+   $config->{'hide_dot_files'} = $new_conf->{'hide_dot_files'} if(defined $new_conf->{'hide_dot_files'});
 
-   $config->{'user_config'} = 1;
+   $config->{'user_config'}    = 1;
   }
  }
 

patrick-canterino.de