Skip to content

Commit 0cb90ea

Browse files
committed
Removed checks for if a printer/driver are approved due to removal of approval tables
1 parent 9fc0fa8 commit 0cb90ea

1 file changed

Lines changed: 0 additions & 62 deletions

File tree

lib/Foomatic/DB.pm

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -120,54 +120,6 @@ sub disconnect_from_sql_db {
120120
}
121121
}
122122

123-
sub printer_approved_in_sql_db {
124-
my ($this, $pid) = @_;
125-
if ($this->{'dbh'} && $this->{'dbtype'} eq 'mysql') {
126-
# Get list of approval state of printer
127-
my $unapprovedprinterquerystr =
128-
"SELECT id FROM printer_approval " .
129-
"WHERE id=\"$pid\" AND " .
130-
"(approved IS NULL OR approved=0 OR approved='' OR " .
131-
"(rejected IS NOT NULL AND rejected!=0 AND rejected!='') OR " .
132-
"(showentry IS NOT NULL AND showentry!='' AND showentry!=1 AND " .
133-
"showentry>CAST(NOW() AS DATE)));";
134-
my $sth = $this->{'dbh'}->prepare($unapprovedprinterquerystr);
135-
if ($sth->execute()) {
136-
my @row = $sth->fetchrow_array;
137-
return 0 if ($row[0]);
138-
return 1;
139-
} else {
140-
return 1;
141-
}
142-
} else {
143-
return 1;
144-
}
145-
}
146-
147-
sub driver_approved_in_sql_db {
148-
my ($this, $driver) = @_;
149-
if ($this->{'dbh'} && $this->{'dbtype'} eq 'mysql') {
150-
# Get list of approval state of driver
151-
my $unapproveddriverquerystr =
152-
"SELECT id FROM driver_approval " .
153-
"WHERE id=\"$driver\" AND " .
154-
"(approved IS NULL OR approved=0 OR approved='' OR " .
155-
"(rejected IS NOT NULL AND rejected!=0 AND rejected!='') OR " .
156-
"(showentry IS NOT NULL AND showentry!='' AND showentry!=1 AND " .
157-
"showentry>CAST(NOW() AS DATE)));";
158-
my $sth = $this->{'dbh'}->prepare($unapproveddriverquerystr);
159-
if ($sth->execute()) {
160-
my @row = $sth->fetchrow_array;
161-
return 0 if ($row[0]);
162-
return 1;
163-
} else {
164-
return 1;
165-
}
166-
} else {
167-
return 1;
168-
}
169-
}
170-
171123
sub get_translation_from_sql_db {
172124
my ($this, $table, $pkeys, $fields) = @_;
173125
if ($this->{'dbh'} &&
@@ -608,7 +560,6 @@ sub get_printer_from_sql_db {
608560
my ($this, $poid, $nodriverlist) = @_;
609561
my $pentry;
610562
if ($this->{'dbh'}) {
611-
return undef if !$this->printer_approved_in_sql_db($poid);
612563
# Get printer record
613564
my $printerquerystr =
614565
"SELECT * " .
@@ -821,7 +772,6 @@ sub get_driver_from_sql_db {
821772
my ($this, $driver, $noprinterlist) = @_;
822773
my $dentry;
823774
if ($this->{'dbh'}) {
824-
return undef if !$this->driver_approved_in_sql_db($driver);
825775
# Get driver record
826776
my $driverquerystr =
827777
"SELECT * " .
@@ -1044,7 +994,6 @@ sub printer_exists_in_sql_db {
1044994
my ($this, $poid) = @_;
1045995
# Check whether a printer entry exists in the database
1046996
if ($this->{'dbh'}) {
1047-
return undef if !$this->printer_approved_in_sql_db($poid);
1048997
# Get printer record
1049998
my $printerquerystr =
1050999
"SELECT id " .
@@ -1064,7 +1013,6 @@ sub driver_exists_in_sql_db {
10641013
my ($this, $drv) = @_;
10651014
# Check whether a driver entry exists in the database
10661015
if ($this->{'dbh'}) {
1067-
return undef if !$this->driver_approved_in_sql_db($drv);
10681016
# Get driver record
10691017
my $driverquerystr =
10701018
"SELECT id " .
@@ -1084,7 +1032,6 @@ sub get_printers_for_driver_from_sql_db {
10841032
my ($this, $drv) = @_;
10851033
my @printerlist = ();
10861034
if ($this->{'dbh'}) {
1087-
return () if !$this->driver_approved_in_sql_db($drv);
10881035
# Get printer IDs of printer/driver combos with the given driver
10891036
my $querystr =
10901037
"SELECT printer_id " .
@@ -1103,7 +1050,6 @@ sub get_drivers_for_printer_from_sql_db {
11031050
my ($this, $poid) = @_;
11041051
my @driverlist = ();
11051052
if ($this->{'dbh'}) {
1106-
return () if !$this->printer_approved_in_sql_db($poid);
11071053
# Get drivers of printer/driver combos with the given printer ID
11081054
my $querystr =
11091055
"SELECT driver_id " .
@@ -1123,14 +1069,6 @@ sub get_combo_data_from_sql_db {
11231069
my ($this, $drv, $poid) = @_;
11241070
my $dat = undef;
11251071
if ($this->{'dbh'}) {
1126-
#Do this printer and driver exist?
1127-
if ( !$this->printer_approved_in_sql_db($poid)
1128-
|| !$this->driver_approved_in_sql_db($drv) ) {
1129-
$this->{'log'} =
1130-
"Error: Either $poid or $drv does not exist in the sql db";
1131-
return undef;
1132-
}
1133-
11341072
# Is this printer/driver combo valid?
11351073
my $querystr =
11361074
"SELECT max_res_x, max_res_y, color, text, lineart, graphics, " .

0 commit comments

Comments
 (0)