[vhffs-dev] [2006] reworked Vhffs::Conf

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2006
Author:   gradator
Date:     2012-02-12 19:05:06 +0100 (Sun, 12 Feb 2012)
Log Message:
-----------
reworked Vhffs::Conf

removed %Config and $filename global variables (sic)
removed useless Vhffs::Functions::strtobool(), Config::General do that through -AutoTrue directive
merged some default conf values to Vhffs::Conf using Config::General default feature
workaround added for an espacing bug about the # character in Config::General (fixed bug #274)
removed this workaround for vhffs-irc/modobot.pl since this is now globally handled

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Broadcast.pm
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Constants.pm
    trunk/vhffs-api/src/Vhffs/Functions.pm
    trunk/vhffs-api/src/Vhffs/Main.pm
    trunk/vhffs-api/src/Vhffs/Panel/Auth.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-api/src/Vhffs/Panel/Moderation.pm
    trunk/vhffs-api/src/Vhffs/Panel/Public.pm
    trunk/vhffs-api/src/Vhffs/Panel/Subscribe.pm
    trunk/vhffs-api/src/Vhffs/Panel/User.pm
    trunk/vhffs-api/src/Vhffs/Robots.pm
    trunk/vhffs-api/src/examples/create_cvs.pl
    trunk/vhffs-api/src/examples/create_dns.pl
    trunk/vhffs-api/src/examples/create_group.pl
    trunk/vhffs-api/src/examples/create_list.pl
    trunk/vhffs-api/src/examples/create_mail.pl
    trunk/vhffs-api/src/examples/create_mysql.pl
    trunk/vhffs-api/src/examples/create_postgres.pl
    trunk/vhffs-api/src/examples/create_repository.pl
    trunk/vhffs-api/src/examples/create_user.pl
    trunk/vhffs-api/src/examples/create_web.pl
    trunk/vhffs-api/src/examples/delbox.pl
    trunk/vhffs-api/src/examples/delete_acl.pl
    trunk/vhffs-api/src/examples/mailuser.pl
    trunk/vhffs-api/src/examples/mailuser_add_box.pl
    trunk/vhffs-api/src/examples/modify_user.pl
    trunk/vhffs-api/src/examples/show_dumper_cvs.pl
    trunk/vhffs-api/src/examples/show_dumper_object.pl
    trunk/vhffs-api/src/examples/show_mail_conf.pl
    trunk/vhffs-cron/src/vhffscron.pl
    trunk/vhffs-irc/modobot.pl
    trunk/vhffs-jabber/vhffspipe.pl
    trunk/vhffs-panel/index.pl
    trunk/vhffs-public/index.pl
    trunk/vhffs-robots/src/repository_stats.pl
    trunk/vhffs-robots/src/web_stats.pl
    trunk/vhffs-tools/src/vhffs-webstats

Modified: trunk/vhffs-api/src/Vhffs/Broadcast.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Broadcast.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Broadcast.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -43,8 +43,28 @@
 use Vhffs::Constants;
 use Encode;
 
-sub add_broadcast
-{
+=pod
+
+=head1 NAME
+
+Vhffs::Broadcast - Handle broadcast message to all users.
+
+=head1 METHODS
+
+=cut
+
+=pod
+
+=head2 add_broadcast
+
+	my $ret = Vhffs::Broadcast::add_broadcast( $vhffs, $subject, $message );
+
+Add a broadcast message to all users.
+
+Returns 1 on success, otherwise returns < 0;
+
+=cut
+sub add_broadcast {
 	my $vhffs = shift;	
 	my $subject = shift;
 	my $message = shift;
@@ -60,9 +80,16 @@
 	return 1;
 }
 
+=pod
 
-sub getall
-{
+=head2 getall
+
+	my $broadcasts = Vhffs::Broadcast::getall( $vhffs, $state );
+
+Returns a hash of all broadcasts. $state can be used to filter the state.
+
+=cut
+sub getall {
 	my $vhffs = shift;
 	my $state = shift;
 	my @params;
@@ -80,10 +107,18 @@
 	return $rows;
 }
 
+=pod
 
+=head2 del_broadcast
 
-sub del_broadcast
-{
+	my $ret = Vhffs::Broadcast::del_broadcast( $vhffs, $id );
+
+Delete broadcast $id.
+
+Returns 1 on success, otherwise returns < 0;
+
+=cut
+sub del_broadcast {
 	my $vhffs = shift;	
 	my $id = shift;
 	my $db = $vhffs->get_db_object;
@@ -95,9 +130,16 @@
 	return 1;
 }
 
+=pod
 
-sub get_broadcast
-{
+=head2 get_broadcast
+
+	my $broadcast = Vhffs::Broadcast::get_broadcast( $vhffs, $id );
+
+Fetch broadcast $id.
+
+=cut
+sub get_broadcast {
 	my $vhffs = shift;	
 	my $id = shift;
 	my $db = $vhffs->get_db_object;

Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -36,209 +36,431 @@
 use Encode;
 use Config::General;
 
-#Vhffs::Conf written by sod` <dieu AT gunnm DOT org>
+=pod
 
-#This is obviously a good way to manage the configuration of Vhffs
-#Config::General helps a bit, for sure
+=head1 NAME
 
+Vhffs::Conf - Handle VHFFS Configuration file.
 
-my %Config;
-my $filename;
+=head1 METHODS
 
-sub new
-{
-    my ( $this , $param ) = @_;
-    my $class = ref($this) || $this;
+=cut
 
-    my $self={
-	filename => $param,
-    };
+=pod
 
-    $filename = $param;
+=head2 new
 
-    bless($self , $class );
-    return $self;
-}
+	my $conf = new Vhffs::Conf( $filename );
 
+Returns a Vhffs::Conf object 
 
-#Parse the main Vhffs Configuration file
-sub parse
-{
-    my $conf;
-    
-    $conf = new Config::General( 
-				 -ConfigFile => $filename ,
-				 -UTF8 => 1
-				 );
-    %Config = $conf->getall();
+=cut
+sub new {
+	my ( $this, $filename ) = @_;
+	my $class = ref($this) || $this;
 
-    $Config{users}{available_shells} = '/bin/false' unless( defined $Config{'users'}{'available_shells'} );
-    $Config{users}{default_shell} = '/bin/false' unless( defined $Config{'users'}{'default_shell'} );
+	my $conf = new Config::General( 
+		-ConfigFile => $filename,
+		-DefaultConfig => {
+			'global' => {
+				'available_languages' => 'en_US'
+			},
+			'users' => {
+				'available_shells' => '/bin/false',
+				'default_shell' => '/bin/false'
+			}
+		},
+		-MergeDuplicateBlocks => 1,
+		-MergeDuplicateOptions => 1,
+		-UTF8 => 1,
+		-AutoTrue => 1,
+		-LowerCaseNames => 1
+		);
+	return undef unless defined $conf;
 
-    $Config{'global'}{'host_name'} = Encode::decode_utf8( $Config{'global'}{'host_name'} );
+	my %tmp = $conf->getall();
+	return undef unless %tmp;
+	my $config = \%tmp;
 
-    return \%Config;
+	# Workaround for \# escaping bug in Config::General
+	my @entries = ( $config );
+	while( defined(my $entry = shift @entries) ) {
+		foreach( values(%{$entry}) ) {
+			if( ref($_) ) {
+				push @entries, $_;
+			} else {
+				s/\\#/#/g if defined $_;
+			} 
+		}
+	}
+
+	my $self = $config;
+	bless( $self, $class );
+	return $self;
 }
 
+=pod
+=head1 GET CONFIGURATION BLOCK
+=pod
 
-#return a reference to a hash with the specified configuration
-sub get_global
-{
-	return $Config{'global'};
+=head2 get_global
+
+my $global = $conf->get_global;
+
+Returns global configuration.
+
+=cut
+sub get_global {
+	my $self = shift;
+	return $self->{'global'};
 }
 
-sub get_panel
-{
-	return $Config{'panel'};
+=pod
+
+=head2 get_panel
+
+my $panelconf = $conf->get_panel;
+
+Returns panel configuration.
+
+=cut
+sub get_panel {
+	my $self = shift;
+	return $self->{'panel'};
 }
 
-sub get_gpg
-{
-	return $Config{'gpg'};
+=pod
+
+=head2 get_gpg
+
+my $gpgconf = $conf->get_gpg;
+
+Returns GPG configuration.
+
+=cut
+sub get_gpg {
+	my $self = shift;
+	return $self->{'gpg'};
 }
 
-sub get_database
-{
-	return $Config{'database'};
+=pod
+
+=head2 get_database
+
+my $dbconf = $conf->get_database;
+
+Returns database (backend) configuration.
+
+=cut
+sub get_database {
+	my $self = shift;
+	return $self->{'database'};
 }
 
-sub get_users
-{
-	return $Config{'users'};
+=pod
+
+=head2 get_users
+
+my $userconf = $conf->get_users;
+
+Returns users configuration.
+
+=cut
+sub get_users {
+	my $self = shift;
+	return $self->{'users'};
 }
 
-sub get_groups
-{
-	return $Config{'groups'};
+=pod
+
+=head2 get_groups
+
+my $groupconf = $conf->get_groups;
+
+Returns groups configuration.
+
+=cut
+sub get_groups {
+	my $self = shift;
+	return $self->{'groups'};
 }
 
-# get a service configuration
-# if a parameter is given, the configuration of the service will be returned
-# if not, it returns the whole configuration for all services
-sub get_service
-{
-	my ( $self , $service ) = @_;
-	return $Config{"services"}{$service} if( defined $service );
-	return $Config{"services"};    
+=pod
+
+=head2 get_service
+
+my $serviceconf = $conf->get_service( $servicename );
+
+Get a service configuration. If a parameter is given, the configuration of the service
+will be returned, otherwise it returns the whole configuration for all services.
+
+=cut
+sub get_service {
+	my ( $self, $service ) = @_;
+	return $self->{"services"}{$service} if defined $service;
+	return $self->{"services"};
 }
 
+=pod
 
-# get availability of a service (return 1 if open, 0 if closed or unknown)
-sub get_service_availability
-{
-	my ( $self , $service ) = @_;
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $Config{'services'}{$service}{'activate'} );
+=head2 get_service_availability
+
+my $available = $conf->get_service_availability( $servicename );
+
+Get availability of a service (return 1 if open, 0 if closed or unknown). 
+
+=cut
+sub get_service_availability {
+	my ( $self, $service ) = @_;
+	return $self->{'services'}{$service}{'activate'};
 }
 
+=pod
+
 =head2 get_available_services
 
-Returns an hashref with one entry set to 1 if the associated
+my $services = $conf->get_available_services;
+
+Returns an hashref with each entry set to 1 if the associated
 service is available.
 
 =cut
+sub get_available_services {
+	my $self = shift;
 
-sub get_available_services
-{
-    my ($self) = @_;
-
-    my $result = {};
-    foreach(qw/web mysql pgsql cvs svn git mercurial bazaar dns repository mail mailinglist cron/) {
-        $result->{$_} = $self->get_service_availability($_);
-    }
-    return $result;
+	my $result = {};
+	foreach(qw/web mysql pgsql cvs svn git mercurial bazaar dns repository mail mailinglist cron/) {
+		$result->{$_} = $self->get_service_availability($_);
+	}
+	return $result;
 }
 
-sub get_listengine
-{
-	return $Config{'listengine'};
-}
+=pod
 
-sub get_robots
-{
-	return $Config{'robots'};
+=head2 get_listengine
+
+my $listengineconf = $conf->get_listengine;
+
+Returns Listengine configuration.
+
+=cut
+sub get_listengine {
+	my $self = shift;
+	return $self->{'listengine'};
 }
 
-sub get_irc
-{
-	return $Config{'irc'};
+=pod
+
+=head2 get_robots
+
+my $robotsconf = $conf->get_robots;
+
+Returns robots configuration.
+
+=cut
+sub get_robots {
+	my $self = shift;
+	return $self->{'robots'};
 }
 
+=pod
 
-# -- global parameters ---
+=head2 get_irc
 
-sub get_host_name
-{
-	return $Config{'global'}{'host_name'};
+my $ircconf = $conf->get_irc;
+
+Returns IRC configuration.
+
+=cut
+sub get_irc {
+	my $self = shift;
+	return $self->{'irc'};
 }
 
-sub get_host_website
-{
-	return $Config{'global'}{'host_website'};
+=pod
+=head1 GET GLOBAL PARAMETERS
+=cut
+
+=pod
+
+=head2 get_host_name
+
+my $hostname = $conf->get_host_name;
+
+Returns hosting service name.
+
+=cut
+sub get_host_name {
+	my $self = shift;
+	return $self->{'global'}{'host_name'};
 }
 
-sub get_datadir
-{
-	return $Config{'global'}{'datadir'};
+=pod
+
+=head2 get_host_website
+
+my $hostwebsite = $conf->get_host_website;
+
+Returns hosting main website URL.
+
+=cut
+sub get_host_website {
+	my $self = shift;
+	return $self->{'global'}{'host_website'};
 }
 
-sub get_templatedir
-{
-	return $Config{'global'}{'templatedir'};
+=pod
+
+=head2 get_datadir
+
+my $datadir = $conf->get_datadir;
+
+Returns datadir (such as '/data');
+
+=cut
+sub get_datadir {
+	my $self = shift;
+	return $self->{'global'}{'datadir'};
 }
 
-sub get_intldir
-{
-	return $Config{'global'}{'intldir'};
+=pod
+
+=head2 get_templatedir
+
+my $templatedir = $conf->get_templatedir;
+
+Returns templates directory (such as '/usr/share/vhffs/templates');
+
+=cut
+sub get_templatedir {
+	my $self = shift;
+	return $self->{'global'}{'templatedir'};
 }
 
-sub get_default_language
-{
-	return $Config{'global'}{'default_language'};
+=pod
+
+=head2 get_default_language
+
+my $defaultlang = $conf->get_default_language;
+
+Returns default language (such as 'en_US').
+
+=cut
+sub get_default_language {
+	my $self = shift;
+	return $self->{'global'}{'default_language'};
 }
 
-sub get_master_mail
-{
-	return $Config{'global'}{'vhffs_master'};
+=pod
+
+=head2 get_master_mail
+
+my $mastermail = $conf->get_master_mail;
+
+Returns value used as From: in emails sent to users.
+
+=cut
+sub get_master_mail {
+	my $self = shift;
+	return $self->{'global'}{'vhffs_master'};
 }
 
-sub get_moderator_mail
-{
-	return $Config{'global'}{'vhffs_moderator'};
+=pod
+
+=head2 get_moderator_mail
+
+my $modomail = $conf->get_moderator_mail;
+
+Returns value used as From: in emails sent to users about moderation.
+
+=cut
+sub get_moderator_mail {
+	my $self = shift;
+	return $self->{'global'}{'vhffs_moderator'};
 }
 
-sub get_mailtag
-{
-    	return $Config{'global'}{'mailtag'};
+=pod
+
+=head2 get_mailtag
+
+my $mailtag = $conf->get_mailtag;
+
+Returns tag used in subject mails sent by VHFFS.
+
+=cut
+sub get_mailtag {
+	my $self = shift;
+	return $self->{'global'}{'mailtag'};
 }
 
-sub get_allow_subscribe
-{
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $Config{'global'}{'allow_subscribe'} );
+=pod
+
+=head2 get_allow_subscribe
+
+my $allowsub = $conf->get_allow_subscribe;
+
+Returns 1 if users subscription are allowed, otherwise returns 0.
+
+=cut
+sub get_allow_subscribe {
+	my $self = shift;
+	return $self->{'global'}{'allow_subscribe'};
 }
 
-sub get_alert_mail
-{
-	return $Config{'global'}{'alert_mail'};
+=pod
+
+=head2 get_alert_mail
+
+my $alertmail = $conf->get_alert_mail;
+
+Returns value used as To: in mails sent through the panel contact page.
+
+=cut
+sub get_alert_mail {
+	my $self = shift;
+	return $self->{'global'}{'alert_mail'};
 }
 
-sub get_moderation
-{
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $Config{'global'}{'moderation'} );
+=pod
+
+=head2 get_moderation
+
+my $use_moderation = $conf->get_moderation;
+
+Returns 1 if objects should be moderated, otherwise returns 0.
+
+=cut
+sub get_moderation {
+	my $self = shift;	
+	return $self->{'global'}{'moderation'};
 }
 
-sub use_vhffsfs
-{
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $Config{'global'}{'use_vhffsfs'} );
+=pod
+
+=head2 use_vhffsfs
+
+my $use_vhffsfs = $conf->use_vhffsfs;
+
+Returns 1 if we are using vhffsfs, otherwise returns 0.
+
+=cut
+sub use_vhffsfs {
+	my $self = shift;
+	return $self->{'global'}{'use_vhffsfs'};
 }
 
-sub get_available_languages
-{
-    return split /\s/, $Config{'global'}{'available_languages'} if(defined $Config{'global'}{'available_languages'});
-    return ('en_US');
+=pod
+
+=head2 get_available_languages
+
+my @languages = $conf->get_available_languages;
+
+Returns an array of enabled languages.
+
+=cut
+sub get_available_languages {
+	my $self = shift;
+	return split /\s/, $self->{'global'}{'available_languages'};
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Constants.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Constants.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Constants.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -8,6 +8,8 @@
 {
     VHFFS_VERSION => '4.4-dev (Revision: %VHFFS_REVISION%)',
     VHFFS_RELEASE_NAME => undef,
+
+    CONF_PATH => '/etc/vhffs/vhffs.conf',
     
     WAITING_FOR_VALIDATION => 1,
     VALIDATION_REFUSED => 2,

Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -52,15 +52,6 @@
 
 srand(time ^ $$);
 
-# Return 1 if string is either 'yes', 'on', '1', 'y', else return 0
-sub strtobool
-{
-	my $str = shift;
-	return 0 unless defined $str;
-	return 1 if( $str eq 'yes'  ||  $str eq 'y'  ||  $str eq 'on'  ||  $str eq '1' );
-	return 0;
-}
-
 sub create_dir
 {
 	my $dir = shift;

Modified: trunk/vhffs-api/src/Vhffs/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Main.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Main.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -34,22 +34,18 @@
 use strict;
 use utf8;
 use DBI;
+use Vhffs::Constants;
 use Vhffs::Functions;
 use Vhffs::Conf;
 
-use constant {
-    VHFFSCONFPATH => "/etc/vhffs/vhffs.conf"
-};
-
 sub init {
 
 	my $class = ref( $_[0] ) || $_[0];
 	my $opt = $_[1];
  
 	# First, config stuff
-	my $config = new Vhffs::Conf( VHFFSCONFPATH );
+	my $config = new Vhffs::Conf( Vhffs::Constants::CONF_PATH );
 	return undef unless defined $config;
-	$config->parse;
 
 	# Next, create the object
 	my $self={};
@@ -57,8 +53,8 @@
 	$self->{'config'} = $config;
 
 	# Finally, backend stuff
-	$opt->{backend} = 'yes' unless defined $opt->{backend};
-	if( Vhffs::Functions::strtobool( $opt->{backend} ) and not defined $self->connect ) {
+	$opt->{backend} = 1 unless defined $opt->{backend};
+	if( $opt->{backend} and not defined $self->connect ) {
 		undef $self;
 		return undef;
 	}

Modified: trunk/vhffs-api/src/Vhffs/Panel/Auth.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Auth.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Auth.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -53,7 +53,7 @@
 	$vars->{subscription_allowed} = $vhffs->get_config->get_allow_subscribe;
 	$vars->{website} = $website;
 	$vars->{hostname} = $hostname;
-	if( $vhffs->get_config->get_panel->{'stats_on_home'} eq 'yes' ) {
+	if( $vhffs->get_config->get_panel->{'stats_on_home'} ) {
 		require Vhffs::Stats;
 		my $stats = new Vhffs::Stats( $vhffs );
 		$vars->{stats} = {

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -225,8 +225,8 @@
 	my $vars = {
 	  mail => $mail,
 	  catchall_type => $catchall_type,
-	  novirus => ($mail_config->{'use_novirus'} eq 'yes' ),
-	  nospam => ($mail_config->{'use_novirus'} eq 'yes' )
+	  novirus => $mail_config->{'use_novirus'},
+	  nospam => $mail_config->{'use_novirus'}
 	  };
 
 	my @sorted_boxes = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_boxes});
@@ -332,8 +332,8 @@
 	my $use_antivirus = $cgi->param('use_antivirus');
 	my $mail_config = $vhffs->get_config->get_service('mail');
         unless( defined $box and defined $passwd
-	  and ($mail_config->{'use_novirus'} eq 'no' or defined $use_antivirus)
-	  and ($mail_config->{'use_nospam'} eq 'no' or defined $use_antispam) ) {
+	  and (not $mail_config->{'use_novirus'} or defined $use_antivirus)
+	  and (not $mail_config->{'use_nospam'} or defined $use_antispam) ) {
 		$panel->add_error( gettext('CGI Error !') );
 		return;
 	}

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -47,16 +47,13 @@
 Checks that public area is available, if it's not the case show a message and returns.
 
 =cut
-
 sub check_public {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'use_public'} );
+	return $panel->{vhffs}->get_config->get_panel->{'use_public'};
 }
 
 =pod
 
-
 =head2 is_open
 
     $panel->is_open;
@@ -64,16 +61,13 @@
 Return 1 if panel is open, else return 0
 
 =cut
-
 sub is_open {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'open'} );
+	return $panel->{vhffs}->get_config->get_panel->{'open'};
 }
 
 =pod
 
-
 =head2 is_public
 
     $panel->is_public;
@@ -81,17 +75,13 @@
 Return 1 if public part is enabled, else return 0
 
 =cut
-
 sub is_public {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'use_public'} );
+	return $panel->{vhffs}->get_config->get_panel->{'use_public'};
 }
 
 =pod
 
-
 =head2 use_avatars
 
     $panel->use_avatars;
@@ -99,18 +89,13 @@
 Return 1 if either or both users or groups avatars are enabled, else return 0
 
 =cut
-
 sub use_avatars {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	use Vhffs::Functions;
-	return ( Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'users_avatars'} )
-	  or Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'groups_avatars'} ) );
+	return ( $panel->{vhffs}->get_config->get_panel->{'users_avatars'} or $panel->{vhffs}->get_config->get_panel->{'groups_avatars'} );
 }
 
 =pod
 
-
 =head2 use_users_avatars
 
     $panel->use_users_avatars;
@@ -118,17 +103,13 @@
 Return 1 if users avatars are enabled, else return 0
 
 =cut
-
 sub use_users_avatars {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'users_avatars'} );
+	return $panel->{vhffs}->get_config->get_panel->{'users_avatars'};
 }
 
 =pod
 
-
 =head2 use_groups_avatars
 
     $panel->use_groups_avatars;
@@ -136,12 +117,9 @@
 Return 1 if groups avatars are enabled, else return 0
 
 =cut
-
 sub use_groups_avatars {
 	my $panel = shift;
-	my $vhffs = $panel->{vhffs};
-	use Vhffs::Functions;
-	return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'groups_avatars'} );
+	return $panel->{vhffs}->get_config->get_panel->{'groups_avatars'};
 }
 
 =pod
@@ -271,7 +249,7 @@
 	# theme feature is more or less deprecated since we never had more than one theme working, let me force to the current theme
 	$self->{theme} = 'light-grey';
 
-	unless( $vhffs->reconnect() and $vhffs->get_config->get_panel->{'open'} eq 'yes' )  {
+	unless( $vhffs->reconnect() and $vhffs->get_config->get_panel->{'open'} )  {
 		$self->render('misc/closed.tt', undef, 'anonymous.tt');
 		undef $self;
 		return undef;

Modified: trunk/vhffs-api/src/Vhffs/Panel/Moderation.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Moderation.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Moderation.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -98,7 +98,7 @@
 	my $objects = Vhffs::Object::getall( $vhffs, undef, Vhffs::Constants::WAITING_FOR_VALIDATION );
 	my $vars = {
 		objects => [],
-		use_notation => ( $vhffs->get_config->get_users->{'use_notation'} eq 'yes' )
+		use_notation => $vhffs->get_config->get_users->{'use_notation'}
 	};
 	foreach my $o(@$objects) {
 		push @{$vars->{objects}}, Vhffs::ObjectFactory::fetch_object( $vhffs, $o->{object_id});

Modified: trunk/vhffs-api/src/Vhffs/Panel/Public.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Public.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Public.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -77,8 +77,8 @@
 	$vars->{right} = 'parts/tags-cloud.tt' unless(defined $vars->{right});
 	$vars->{top} = 'parts/top-menu.tt' unless(defined $vars->{top});
 	$vars->{help_url} = $conf->get_panel->{url_help};
-	$vars->{users_avatar} = Vhffs::Functions::strtobool( $conf->get_panel->{'users_avatars'} );
-	$vars->{groups_avatar} = Vhffs::Functions::strtobool( $conf->get_panel->{'groups_avatars'} );
+	$vars->{users_avatar} = $conf->get_panel->{'users_avatars'};
+	$vars->{groups_avatar} = $conf->get_panel->{'groups_avatars'};
 
 	# Handling ajax stuff
 	if( $vhffs->is_connected ) {
@@ -492,7 +492,7 @@
 
 	my $url = ( $vhffs->get_config->get_panel->{'url_public'} or '' );
 
-	unless( $vhffs->get_config->get_panel->{'rss_users'} eq 'yes' and $vhffs->get_config->get_panel->{'use_public'} eq 'yes' ) {
+	unless( $vhffs->get_config->get_panel->{'rss_users'} and $vhffs->get_config->get_panel->{'use_public'} ) {
 		$panel->render('misc/message.tt', {
 			message=> gettext( 'RSS infos are not published' )
 		});
@@ -550,7 +550,7 @@
 
 	my $url = ( $vhffs->get_config->get_panel->{'url_public'} or '' );
 
-	unless( $vhffs->get_config->get_panel->{'rss_groups'} eq 'yes' and $vhffs->get_config->get_panel->{'use_public'} eq 'yes' ) {
+	unless( $vhffs->get_config->get_panel->{'rss_groups'} and $vhffs->get_config->get_panel->{'use_public'} ) {
 		$panel->render('misc/message.tt', {
 			message=> gettext( 'RSS infos are not published' )
 		});

Modified: trunk/vhffs-api/src/Vhffs/Panel/Subscribe.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Subscribe.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/Subscribe.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -55,7 +55,7 @@
 	my $submitted = $cgi->param( 'create_submit' );
 	my $message;
 
-	my $usecaptcha = Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'use_captcha'} );
+	my $usecaptcha = $vhffs->get_config->get_panel->{'use_captcha'};
 	my $captcha_pubkey = $vhffs->get_config->get_panel->{'captcha_pubkey'};
 	my $captcha_privkey = $vhffs->get_config->get_panel->{'captcha_privkey'};
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -506,7 +506,7 @@
 									}
 
 									# We change the spam status. if the spam status changed
-									if( $vhffs->get_config->get_service('mail')->{'use_nospam'} eq 'yes' ) {
+									if( $vhffs->get_config->get_service('mail')->{'use_nospam'} ) {
 										if( $nospam != $mu->use_nospam ) {
 											if( $mu->change_spam_status == 1 ) {
 												$panel->add_info( gettext( 'Changed spam protection status for your account' ) );
@@ -517,7 +517,7 @@
 									}
 
 									# As spam, the virus status changes only if the user changed values
-									if( $vhffs->get_config->get_service('mail')->{'use_novirus'} eq 'yes' ) {
+									if( $vhffs->get_config->get_service('mail')->{'use_novirus'} ) {
 										if( $novirus != $mu->use_novirus ) {
 											if( $mu->change_virus_status == 1 ) {
 												$panel->add_info( gettext( 'Changed anti-virus status for your account' ) );
@@ -641,8 +641,8 @@
 		  service => $mu,
 		  domain => $mu_config->{domain},
 		  help_url => $mu_config->{url_doc},
-		  nospam => $mail_config->{use_nospam} eq 'yes',
-		  novirus => $mail_config->{use_novirus} eq 'yes'
+		  nospam => $mail_config->{use_nospam},
+		  novirus => $mail_config->{use_novirus}
 		};
 	}
 

Modified: trunk/vhffs-api/src/Vhffs/Robots.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots.pm	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/Vhffs/Robots.pm	2012-02-12 18:05:06 UTC (rev 2006)
@@ -147,7 +147,7 @@
 	return undef unless defined $object and defined $dir and -d $dir;
 
 	my $robotconf = $object->{main}->get_config->get_robots;
-	return undef unless defined $robotconf and Vhffs::Functions::strtobool( $robotconf->{'archive_deleted'} ) and defined $robotconf->{'archive_deleted_path'} and -d $robotconf->{'archive_deleted_path'};
+	return undef unless defined $robotconf and $robotconf->{'archive_deleted'} and defined $robotconf->{'archive_deleted_path'} and -d $robotconf->{'archive_deleted_path'};
 
 	my $oldcwd = getcwd();
 	return undef unless chdir($dir);

Modified: trunk/vhffs-api/src/examples/create_cvs.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_cvs.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_cvs.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -33,7 +33,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_dns.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_dns.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_dns.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_group.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_group.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_group.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -4,7 +4,6 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_list.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_list.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_list.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_mail.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_mail.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_mail.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_mysql.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_mysql.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_mysql.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_postgres.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_postgres.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_postgres.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_repository.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_repository.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_repository.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_user.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_user.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_user.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -4,7 +4,6 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/create_web.pl
===================================================================
--- trunk/vhffs-api/src/examples/create_web.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/create_web.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/delbox.pl
===================================================================
--- trunk/vhffs-api/src/examples/delbox.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/delbox.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -4,7 +4,6 @@
 use strict;
 use lib '%VHFFS_LIB_DIR%';
 
-use Vhffs::Conf;
 use Vhffs::Main;
 use Vhffs::Services::Mail;
 

Modified: trunk/vhffs-api/src/examples/delete_acl.pl
===================================================================
--- trunk/vhffs-api/src/examples/delete_acl.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/delete_acl.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/mailuser.pl
===================================================================
--- trunk/vhffs-api/src/examples/mailuser.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/mailuser.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/mailuser_add_box.pl
===================================================================
--- trunk/vhffs-api/src/examples/mailuser_add_box.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/mailuser_add_box.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/modify_user.pl
===================================================================
--- trunk/vhffs-api/src/examples/modify_user.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/modify_user.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -4,7 +4,6 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Main;
 

Modified: trunk/vhffs-api/src/examples/show_dumper_cvs.pl
===================================================================
--- trunk/vhffs-api/src/examples/show_dumper_cvs.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/show_dumper_cvs.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/show_dumper_object.pl
===================================================================
--- trunk/vhffs-api/src/examples/show_dumper_object.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/show_dumper_object.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -5,7 +5,6 @@
 
 use Data::Dumper;
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-api/src/examples/show_mail_conf.pl
===================================================================
--- trunk/vhffs-api/src/examples/show_mail_conf.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-api/src/examples/show_mail_conf.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -3,7 +3,6 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Conf;
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Main;

Modified: trunk/vhffs-cron/src/vhffscron.pl
===================================================================
--- trunk/vhffs-cron/src/vhffscron.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-cron/src/vhffscron.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -58,7 +58,7 @@
 #select(STDOUT);
 #$| = 1;
 
-my $vhffs = init Vhffs::Main( { backend => 'no' } );
+my $vhffs = init Vhffs::Main( { backend => 0 } );
 exit 1 unless defined $vhffs;
 
 $vhffs->connect;

Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-irc/modobot.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -40,14 +40,13 @@
 
 # Connections to servers
 
-my $vhffs = init Vhffs::Main( { backend => 'no' } );
+my $vhffs = init Vhffs::Main( { backend => 0 } );
 exit 1 unless defined $vhffs;
 
 $vhffs->connect;
 
 my $configirc = $vhffs->get_config->get_irc;
 my $chan = $configirc->{modobot_channel};
-$chan =~ s/^\\#/#/;
 
 my $conn=$irc->newconn(Nick     =>  $configirc->{modobot_name},
                        Server   =>  $configirc->{modobot_server},
@@ -84,7 +83,7 @@
 			my $duration = delay_modo($obj->get_date);
 
 			my $msg = '['.$duration.'] '.Vhffs::Functions::type_string_from_type_id( $obj->{type} ).':   '.$obj->get_oid.'   '.$user->get_username;
-			$msg .= ' ('.$user->get_note.')' if( $vhffs->get_config->get_users->{'use_notation'} eq 'yes' );
+			$msg .= ' ('.$user->get_note.')' if $vhffs->get_config->get_users->{'use_notation'};
 			$msg .= ' ['.$user->get_lang.']   '.$group->get_groupname.'   '.$object->get_label.'   '.$obj->get_description;
 			$msg .= "\n[".format_tags_list($group).']';
 			irc_msg( $msg );

Modified: trunk/vhffs-jabber/vhffspipe.pl
===================================================================
--- trunk/vhffs-jabber/vhffspipe.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-jabber/vhffspipe.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -9,7 +9,7 @@
 # Flush output immediately.
 $| = 1;
 
-my $vhffs = init Vhffs::Main( { backend => 'no' } );
+my $vhffs = init Vhffs::Main( { backend => 0 } );
 exit 1 unless defined $vhffs;
 
 $vhffs->connect;

Modified: trunk/vhffs-panel/index.pl
===================================================================
--- trunk/vhffs-panel/index.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-panel/index.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -46,7 +46,7 @@
 # -- prefork
 CGI->compile();
 
-my $vhffs = init Vhffs::Main( { backend => 'no' } );
+my $vhffs = init Vhffs::Main( { backend => 0 } );
 exit 1 unless defined $vhffs;
 
 $vhffs->connect;

Modified: trunk/vhffs-public/index.pl
===================================================================
--- trunk/vhffs-public/index.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-public/index.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -46,7 +46,7 @@
 # -- prefork
 CGI->compile();
 
-my $vhffs = init Vhffs::Main( { backend => 'no' } );
+my $vhffs = init Vhffs::Main( { backend => 0 } );
 exit 1 unless defined $vhffs;
 
 $vhffs->connect;

Modified: trunk/vhffs-robots/src/repository_stats.pl
===================================================================
--- trunk/vhffs-robots/src/repository_stats.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-robots/src/repository_stats.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -39,7 +39,6 @@
 use utf8;
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
-use Vhffs::Conf;
 use Vhffs::Functions;
 use Vhffs::Services::Repository;
 use Vhffs::Robots;
@@ -54,16 +53,15 @@
 my $repoconf = $vhffs->get_config->get_service('repository');
 die "ERROR: A full repository configuration is needed to generate stats\n" if ( ! defined $repoconf );
 
-my $conf_datadir = Vhffs::Conf::get_datadir;
 my $log_incoming_root = $repoconf->{"log_incoming_root"};
 my $log_incoming_rotations = $repoconf->{"log_incoming_rotations"};
-my $log_incoming_compress = ( $repoconf->{"log_incoming_compress"} eq 'yes' ) ? 1 : 0;
+my $log_incoming_compress = $repoconf->{"log_incoming_compress"};
 my $log_parsed_root = $repoconf->{"log_parsed_root"};
 my $log_parsed_rotation = $repoconf->{"log_parsed_rotation"};
-my $log_parsed_compress = ( $repoconf->{"log_parsed_compress"} eq 'yes' ) ? 1 : 0;
+my $log_parsed_compress = $repoconf->{"log_parsed_compress"};
 my $log_awstats = $repoconf->{"log_awstats"};
 my $awstats_sample = $repoconf->{"log_awstats_sample"};
-my $log_apachelocal = ( $repoconf->{"log_apachelocal"} eq 'yes' ) ? 1 : 0;
+my $log_apachelocal = $repoconf->{"log_apachelocal"};
 my $log_apachectl = $repoconf->{"log_apachectl"};
 
 die "ERROR: ".$log_incoming_root." is not a directory" if( ! -d $log_incoming_root );
@@ -132,7 +130,7 @@
 
 # Parse http logs
 my $prev = "";
-my $ddir = $conf_datadir."/repository/";
+my $ddir = $vhffs->get_config->get_datadir."/repository/";
 $ddir =~ s%[/]{2,}%/%g;
 
 open( MERGEDIN , "< ".$log_incoming_root."/mergedlog" );

Modified: trunk/vhffs-robots/src/web_stats.pl
===================================================================
--- trunk/vhffs-robots/src/web_stats.pl	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-robots/src/web_stats.pl	2012-02-12 18:05:06 UTC (rev 2006)
@@ -40,7 +40,6 @@
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
-use Vhffs::Conf;
 use Vhffs::Functions;
 use Vhffs::Services::Web;
 use Vhffs::Robots;
@@ -56,13 +55,13 @@
 
 my $log_incoming_root = $webconf->{"log_incoming_root"};
 my $log_incoming_rotations = $webconf->{"log_incoming_rotations"};
-my $log_incoming_compress = ( $webconf->{"log_incoming_compress"} eq 'yes' ) ? 1 : 0;
+my $log_incoming_compress = $webconf->{"log_incoming_compress"};
 my $log_parsed_root = $webconf->{"log_parsed_root"};
 my $log_parsed_rotation = $webconf->{"log_parsed_rotation"};
-my $log_parsed_compress = ( $webconf->{"log_parsed_compress"} eq 'yes' ) ? 1 : 0;
+my $log_parsed_compress = $webconf->{"log_parsed_compress"};
 my $log_awstats = $webconf->{"log_awstats"};
 my $awstats_sample = $webconf->{"log_awstats_sample"};
-my $log_apachelocal = ( $webconf->{"log_apachelocal"} eq 'yes' ) ? 1 : 0;
+my $log_apachelocal = $webconf->{"log_apachelocal"};
 my $log_apachectl = $webconf->{"log_apachectl"};
 
 die "ERROR: ".$log_incoming_root." is not a directory" if( ! -d $log_incoming_root );

Modified: trunk/vhffs-tools/src/vhffs-webstats
===================================================================
--- trunk/vhffs-tools/src/vhffs-webstats	2012-02-11 21:36:07 UTC (rev 2005)
+++ trunk/vhffs-tools/src/vhffs-webstats	2012-02-12 18:05:06 UTC (rev 2006)
@@ -10,7 +10,6 @@
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
-use Vhffs::Conf;
 use Vhffs::Functions;
 use Vhffs::Services::Web;
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/