[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
raeburn
raeburn at source.lon-capa.org
Mon Oct 16 12:33:55 EDT 2017
raeburn Mon Oct 16 16:33:55 2017 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- User search by e-mail address requires 2.12 for search in both LON-CAPA
alluser MySQL table, and in institutional directory.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1356 loncom/lonnet/perl/lonnet.pm:1.1357
--- loncom/lonnet/perl/lonnet.pm:1.1356 Sat Oct 7 00:50:52 2017
+++ loncom/lonnet/perl/lonnet.pm Mon Oct 16 16:33:54 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1356 2017/10/07 00:50:52 raeburn Exp $
+# $Id: lonnet.pm,v 1.1357 2017/10/16 16:33:54 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2094,6 +2094,16 @@
my $homeserver = &domain($udom,'primary');
my $outcome;
if ($homeserver ne '') {
+ unless ($homeserver eq $perlvar{'lonHostID'}) {
+ if ($srch->{'srchby'} eq 'email') {
+ my $lcrev = &get_server_loncaparev(undef,$homeserver);
+ my ($major,$minor) = ($lcrev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/);
+ if (($major eq '' && $minor eq '') || ($major < 2) ||
+ (($major == 2) && ($minor < 12))) {
+ return;
+ }
+ }
+ }
my $queryid=&reply("querysend:instdirsearch:".
&escape($srch->{'srchby'}).':'.
&escape($srch->{'srchterm'}).':'.
@@ -2135,6 +2145,14 @@
my $query = 'usersearch';
foreach my $tryserver (keys(%libserv)) {
if (&host_domain($tryserver) eq $dom) {
+ unless ($tryserver eq $perlvar{'lonHostID'}) {
+ if ($srch->{'srchby'} eq 'email') {
+ my $lcrev = &get_server_loncaparev(undef,$tryserver);
+ my ($major,$minor) = ($lcrev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/);
+ next if (($major eq '' && $minor eq '') || ($major < 2) ||
+ (($major == 2) && ($minor < 12)));
+ }
+ }
my $host=&hostname($tryserver);
my $queryid=
&reply("querysend:".&escape($query).':'.
More information about the LON-CAPA-cvs
mailing list