version 1.84, 2007/08/08 22:24:36
|
version 1.87, 2007/08/31 12:33:25
|
Line 457 sub make_new_child {
|
Line 457 sub make_new_child {
|
$query = "SELECT $fieldlist FROM allusers WHERE (domain = $quoted_dom AND "; |
$query = "SELECT $fieldlist FROM allusers WHERE (domain = $quoted_dom AND "; |
if ($srchby eq 'lastfirst') { |
if ($srchby eq 'lastfirst') { |
my ($fraglast,$fragfirst) = split(/,/,$srchterm); |
my ($fraglast,$fragfirst) = split(/,/,$srchterm); |
|
$fragfirst =~ s/^\s+//; |
|
$fraglast =~ s/\s+$//; |
if ($srchtype eq 'exact') { |
if ($srchtype eq 'exact') { |
$query .= 'lastname = '.$dbh->quote($fraglast). |
$query .= 'lastname = '.$dbh->quote($fraglast). |
' AND firstname = '.$dbh->quote($fragfirst); |
' AND firstname = '.$dbh->quote($fragfirst); |
|
} elsif ($srchtype eq 'begins') { |
|
$query .= 'lastname LIKE '.$dbh->quote($fraglast.'%').' AND firstname LIKE '.$dbh->quote($fragfirst.'%'); |
} else { |
} else { |
$query .= 'lastname LIKE '.$dbh->quote('%'.$fraglast.'%').' AND firstname LIKE '.$dbh->quote('%'.$fragfirst.'%'); |
$query .= 'lastname LIKE '.$dbh->quote('%'.$fraglast.'%').' AND firstname LIKE '.$dbh->quote('%'.$fragfirst.'%'); |
} |
} |
Line 470 sub make_new_child {
|
Line 474 sub make_new_child {
|
); |
); |
if ($srchtype eq 'exact') { |
if ($srchtype eq 'exact') { |
$query .= $srchfield{$srchby}.' = '.$dbh->quote($srchterm); |
$query .= $srchfield{$srchby}.' = '.$dbh->quote($srchterm); |
|
} elsif ($srchtype eq 'begins') { |
|
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote($srchterm.'%'); |
} else { |
} else { |
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote('%'.$srchterm.'%'); |
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote('%'.$srchterm.'%'); |
} |
} |
Line 565 sub do_inst_dir_search {
|
Line 571 sub do_inst_dir_search {
|
} |
} |
} |
} |
$response=~s/\&$//; |
$response=~s/\&$//; |
|
} else { |
|
$response = 'unavailable'; |
} |
} |
return $response; |
return $response; |
} |
} |