my $self = {};
if ($login ne "") {
+ local *MEMBER;
+
+ $login =~ s|.*/||;
+
&error("", "$memfile locked!") if (-f "${memfile}.LCK");
open(MEMBER, "$memfile") or &error("", "$memfile : $!");
while (<MEMBER>) {
if (/^\[$login\]/) {
while (<MEMBER>) {
- last if /^\[/;
- next if /^(#|\s)/;
+ last if m/^\[/;
+ next if m/^(#|\s)/;
# remove comments
s/\s#.*//g;
sub country_codes {
$main::lxdebug->enter_sub();
+ local *DIR;
+
my %cc = ();
my @language = ();
my ($self, $form, $userspath) = @_;
+ local *FH;
+
my $rc = -3;
if ($self->{login}) {
}
unless (-e "$userspath/$self->{login}.conf") {
- $self->create_config("$userspath/$self->{login}.conf");
+ $self->create_config();
}
do "$userspath/$self->{login}.conf";
$self->dbupdate($form);
$self->dbupdate2($form, $controls);
+ close(FH);
+
# remove lock file
unlink("$userspath/nologin");
my ($self, $form, $memfile) = @_;
+ local *FH;
+
my @dbexcl = ();
my @dbsources = ();
sub update_available {
my ($dbdriver, $cur_version) = @_;
+ local *SQLDIR;
+
opendir(SQLDIR, "sql/${dbdriver}-upgrade")
or &error("", "sql/${dbdriver}-upgrade: $!");
my @upgradescripts =
my ($self, $form) = @_;
+ local *SQLDIR;
+
$form->{sid} = $form->{dbdefault};
my @upgradescripts = ();
sub create_config {
$main::lxdebug->enter_sub();
- my ($self, $filename) = @_;
+ my ($self) = @_;
+
+ local *CONF;
- @config = &config_vars;
+ @config = config_vars();
- open(CONF, ">$filename") or $self->error("$filename : $!");
+ open(CONF, ">", "$userspath/$self->{login}.conf") || $self->error("$userspath/$self->{login}.conf : $!");
# create the config file
print CONF qq|# configuration file for $self->{login}
\%myconfig = (
|;
- foreach $key (sort @config) {
+ foreach my $key (sort @config) {
$self->{$key} =~ s/\'/\\\'/g;
print CONF qq| $key => '$self->{$key}',\n|;
}
my ($self, $memberfile, $userspath) = @_;
+ local (*FH, *CONF);
+
my $newmember = 1;
# format dbconnect and dboptions string
unlink "${memberfile}.LCK";
# create conf file
- $self->create_config("$userspath/$self->{login}.conf")
- unless $self->{'root login'};
+ $self->create_config() unless $self->{'root login'};
$main::lxdebug->leave_sub();
}