version 1.533, 2017/03/13 18:30:02
|
version 1.534, 2017/03/20 03:19:37
|
Line 3973 sub send_query_handler {
|
Line 3973 sub send_query_handler {
|
|
|
my ($query,$arg1,$arg2,$arg3)=split(/\:/,$tail); |
my ($query,$arg1,$arg2,$arg3)=split(/\:/,$tail); |
$query=~s/\n*$//g; |
$query=~s/\n*$//g; |
|
if (($query eq 'usersearch') || ($query eq 'instdirsearch')) { |
|
my $usersearchconf = &get_usersearch_config($currentdomainid,'directorysrch'); |
|
my $earlyout; |
|
if (ref($usersearchconf) eq 'HASH') { |
|
if ($currentdomainid eq $clienthomedom) { |
|
if ($query eq 'usersearch') { |
|
if ($usersearchconf->{'lcavailable'} eq '0') { |
|
$earlyout = 1; |
|
} |
|
} else { |
|
if ($usersearchconf->{'available'} eq '0') { |
|
$earlyout = 1; |
|
} |
|
} |
|
} else { |
|
if ($query eq 'usersearch') { |
|
if ($usersearchconf->{'lclocalonly'}) { |
|
$earlyout = 1; |
|
} |
|
} else { |
|
if ($usersearchconf->{'localonly'}) { |
|
$earlyout = 1; |
|
} |
|
} |
|
} |
|
} |
|
if ($earlyout) { |
|
&Reply($client, "query_not_authorized\n"); |
|
return 1; |
|
} |
|
} |
&Reply($client, "". &sql_reply("$clientname\&$query". |
&Reply($client, "". &sql_reply("$clientname\&$query". |
"\&$arg1"."\&$arg2"."\&$arg3")."\n", |
"\&$arg1"."\&$arg2"."\&$arg3")."\n", |
$userinput); |
$userinput); |
Line 8266 sub get_usersession_config {
|
Line 8297 sub get_usersession_config {
|
} |
} |
return; |
return; |
} |
} |
|
|
|
sub get_usersearch_config { |
|
my ($dom,$name) = @_; |
|
my ($usersearchconf,$cached)=&Apache::lonnet::is_cached_new($name,$dom); |
|
if (defined($cached)) { |
|
return $usersearchconf; |
|
} else { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['directorysrch'],$dom); |
|
&Apache::lonnet::do_cache_new($name,$dom,$domconfig{'directorysrch'},600); |
|
return $domconfig{'directorysrch'}; |
|
} |
|
return; |
|
} |
|
|
sub get_prohibited { |
sub get_prohibited { |
my ($dom) = @_; |
my ($dom) = @_; |