mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-16286 - replace get_records_sql with more generic get_records
Author: Peter Bulmer <peter.bulmer@catalyst.net.nz>
This commit is contained in:
parent
a01ee3136f
commit
1c85006caf
@ -1084,14 +1084,8 @@ class auth_plugin_mnet extends auth_plugin_base {
|
|||||||
$userid = $DB->get_field('user', 'id', array('mnethostid'=>$CFG->mnet_localhost_id, 'username'=>$username));
|
$userid = $DB->get_field('user', 'id', array('mnethostid'=>$CFG->mnet_localhost_id, 'username'=>$username));
|
||||||
|
|
||||||
$returnstring = '';
|
$returnstring = '';
|
||||||
$sql = "
|
|
||||||
select
|
$mnetsessions = $DB->get_records('mnet_session', array('userid' => $userid, 'useragent' => $useragent));
|
||||||
*
|
|
||||||
from
|
|
||||||
{mnet_session} s
|
|
||||||
where
|
|
||||||
s.userid = ? AND
|
|
||||||
s.useragent = ?";
|
|
||||||
|
|
||||||
// If we are being executed from a remote machine (client) we don't have
|
// If we are being executed from a remote machine (client) we don't have
|
||||||
// to kill the moodle session on that machine.
|
// to kill the moodle session on that machine.
|
||||||
@ -1101,8 +1095,6 @@ class auth_plugin_mnet extends auth_plugin_base {
|
|||||||
$excludeid = -1;
|
$excludeid = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mnetsessions = $DB->get_records_sql($sql, array($userid, $useragent));
|
|
||||||
|
|
||||||
if (false == $mnetsessions) {
|
if (false == $mnetsessions) {
|
||||||
$returnstring .= "Could find no remote sessions\n$sql\n";
|
$returnstring .= "Could find no remote sessions\n$sql\n";
|
||||||
$mnetsessions = array();
|
$mnetsessions = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user