summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 22:18:22 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 22:18:22 +0000
commit4de76bf567a88296a96401168516f6fc2e90996e (patch)
tree6acc8e322e15d7b29024f19e9829b7dce98c7f3f
parent9e097216a8e00e16a97a89040a4ffc33df1b4862 (diff)
Fixing 1750802
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1359 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xbin/admin.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/admin.pl b/bin/admin.pl
index ea0eebd4..42022d36 100755
--- a/bin/admin.pl
+++ b/bin/admin.pl
@@ -918,14 +918,16 @@ sub delete {
( $form->{templates} )
? "${LedgerSMB::Sysconfig::templates}/$form->{templates}"
: "$templates/$form->{login}";
+
+ my $dbh = ${LedgerSMB::Sysconfig::GLOBALDBH};
- # scan %user for $templatedir
- foreach $login ( keys %user ) {
- last if ( $found = ( $form->{templates} eq $user{$login} ) );
- }
+ my $found = $dbh->selectall_arrayref(qq|SELECT c.templates
+ FROM users_conf c INNER JOIN users u ON (c.id = u.id)
+ WHERE c.templates = ? AND u.username <> ?|,
+ undef, $form->{templates}, $form->{login});
# if found keep directory otherwise delete
- if ( !$found ) {
+ if ( !@$found ) {
# delete it if there is a template directory
$dir = "$form->{templates}";
@@ -935,8 +937,6 @@ sub delete {
}
}
- my $dbh = ${LedgerSMB::Sysconfig::GLOBALDBH};
-
#users_conf
my $deleteUser =
$dbh->prepare(