summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/Form.pm3
-rw-r--r--LedgerSMB/User.pm14
-rw-r--r--bin/admin.pl1
3 files changed, 8 insertions, 10 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 09278953..4be02825 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -75,8 +75,7 @@ sub new {
$self->{nextsub} = lc $self->{nextsub};
$self->{nextsub} =~ s/( |-|,|\#|\/|\.$)/_/g;
}
-
- $self->{login} =~ s/[^a-zA-Z0-9._+@'-]//g;
+ $self->{login} =~ s/[^a-zA-Z0-9._+\@'-]//g;
$self->{menubar} = 1 if $self->{path} =~ /lynx/i;
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index e9600deb..f38251a0 100644
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -212,7 +212,7 @@ sub login {
# no error check for employee table, ignore if it does not exist
my $login = $self->{login};
$login =~ s/@.*//;
- $query = qq|SELECT id FROM employees WHERE login = ?|;
+ $query = qq|SELECT id FROM employee WHERE login = ?|;
$sth = $dbh->prepare($query);
$sth->execute($login);
@@ -224,7 +224,7 @@ sub login {
$form->update_defaults( \%myconfig, "employeenumber", $dbh );
$query = qq|
- INSERT INTO employees
+ INSERT INTO employee
(login, employeenumber, name,
workphone, role)
VALUES (?, ?, ?, ?, ?)|;
@@ -858,7 +858,7 @@ sub save_member {
# add login to employees table if it does not exist
my $login = $self->{login};
$login =~ s/@.*//;
- my $sth = $dbh->prepare("SELECT id FROM employees WHERE login = ?;");
+ my $sth = $dbh->prepare("SELECT id FROM employee WHERE login = ?;");
$sth->execute($login);
my ($id) = $sth->fetchrow_array;
@@ -867,7 +867,7 @@ sub save_member {
my @values;
if ($id) {
- $query = qq|UPDATE employees SET
+ $query = qq|UPDATE employee SET
role = ?,
email = ?,
name = ?
@@ -881,7 +881,7 @@ sub save_member {
my ($employeenumber) =
Form::update_defaults( "", \%$self, "employeenumber", $dbh );
$query = qq|
- INSERT INTO employees
+ INSERT INTO employee
(login, employeenumber, name,
workphone, role, email, sales)
VALUES (?, ?, ?, ?, ?, ?, '1')|;
@@ -911,7 +911,7 @@ sub delete_login {
my $login = $form->{login};
$login =~ s/@.*//;
- my $query = qq|SELECT id FROM employees WHERE login = ?|;
+ my $query = qq|SELECT id FROM employee WHERE login = ?|;
my $sth = $dbh->prepare($query);
$sth->execute($login)
|| $form->dberror( __FILE__ . ':' . __LINE__ . ': ' . $query );
@@ -920,7 +920,7 @@ sub delete_login {
$sth->finish;
my $query = qq|
- UPDATE employees
+ UPDATE employee
SET login = NULL,
enddate = current_date
WHERE login = ?|;
diff --git a/bin/admin.pl b/bin/admin.pl
index 187235b3..b430d865 100644
--- a/bin/admin.pl
+++ b/bin/admin.pl
@@ -785,7 +785,6 @@ sub save {
# check for duplicates
if ( !$form->{edit} ) {
-
$temp = LedgerSMB::User->new( $form->{login} );
if ( $temp->{login} ) {