version 1.94, 2015/08/05 18:47:12
|
version 1.96, 2017/10/13 20:37:46
|
Line 490 sub make_new_child {
|
Line 490 sub make_new_child {
|
$userdata{'domain'} = $udom; |
$userdata{'domain'} = $udom; |
$result = &allusers_table_update($query,$uname,$udom,\%userdata); |
$result = &allusers_table_update($query,$uname,$udom,\%userdata); |
} else { |
} else { |
|
# Sanity checking of $query needed. |
# Do an sql query |
# Do an sql query |
$result = &do_sql_query($query,$arg1,$arg2,$arg3,$searchdomain); |
$result = &do_sql_query($query,$arg1,$arg2,$arg3,$searchdomain); |
} |
} |
Line 541 sub do_user_search {
|
Line 542 sub do_user_search {
|
my %srchfield = ( |
my %srchfield = ( |
uname => 'username', |
uname => 'username', |
lastname => 'lastname', |
lastname => 'lastname', |
|
email => 'permanentemail', |
); |
); |
if ($srchtype eq 'exact') { |
if (exists($srchfield{$srchby})) { |
$query .= $srchfield{$srchby}.' = '.$dbh->quote($srchterm); |
if ($srchtype eq 'exact') { |
} elsif ($srchtype eq 'begins') { |
$query .= $srchfield{$srchby}.' = '.$dbh->quote($srchterm); |
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote($srchterm.'%'); |
} elsif ($srchtype eq 'begins') { |
|
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote($srchterm.'%'); |
|
} else { |
|
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote('%'.$srchterm.'%'); |
|
} |
} else { |
} else { |
$query .= $srchfield{$srchby}.' LIKE '.$dbh->quote('%'.$srchterm.'%'); |
&logthis('<font color="blue">'. |
|
'WARNING: Invalid srchby: '.$srchby.'</font>'); |
|
return $result; |
} |
} |
} |
} |
$query .= ") ORDER BY username "; |
$query .= ") ORDER BY username "; |
Line 637 sub get_multiple_instusers {
|
Line 645 sub get_multiple_instusers {
|
if ($@) { |
if ($@) { |
$response = 'error'; |
$response = 'error'; |
} elsif ($result eq 'ok') { |
} elsif ($result eq 'ok') { |
|
$response = $result; |
if (keys(%instusers)) { |
if (keys(%instusers)) { |
$response = $result.':'.&Apache::lonnet::freeze_escape(\%instusers); |
$response .= '='.&Apache::lonnet::freeze_escape(\%instusers); |
} |
} |
} else { |
} elsif ($result eq 'unavailable') { |
$response = 'unavailable'; |
$response = $result; |
} |
} |
} else { |
} else { |
$response = 'invalid'; |
$response = 'invalid'; |