version 1.95, 2015/08/09 21:43:11
|
version 1.97, 2018/10/29 02:57:30
|
Line 231 unless ($dbh = DBI->connect("DBI:mysql:l
|
Line 231 unless ($dbh = DBI->connect("DBI:mysql:l
|
my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
my $subj="LON: $perlvar{'lonHostID'} Cannot connect to database!"; |
my $subj="LON: $perlvar{'lonHostID'} Cannot connect to database!"; |
system("echo 'Cannot connect to MySQL database!' |". |
system("echo 'Cannot connect to MySQL database!' |". |
" mailto $emailto -s '$subj' > /dev/null"); |
" mail -s '$subj' $emailto > /dev/null"); |
|
|
open(SMP,">$perlvar{'lonDocRoot'}/lon-status/mysql.txt"); |
open(SMP,">$perlvar{'lonDocRoot'}/lon-status/mysql.txt"); |
print SMP 'time='.time.'&mysql=defunct'."\n"; |
print SMP 'time='.time.'&mysql=defunct'."\n"; |
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 "; |