commit f60e58d6db9c5301bcdf6097eade823be80663b9 Author: David Mudrak Date: Thu Dec 9 10:14:27 2010 +0100 MDL-21554 MNet: fixed SQL usage to check a record existence The solution backported from 2.0 and independently suggested by Penny, too. diff --git a/mnet/xmlrpc/client.php b/mnet/xmlrpc/client.php index 0880a7b..4770565 100644 --- a/mnet/xmlrpc/client.php +++ b/mnet/xmlrpc/client.php @@ -149,7 +149,7 @@ class mnet_xmlrpc_client { // Find methods that we subscribe to on this host $sql = " SELECT - * + r.id FROM {$CFG->prefix}mnet_rpc r, {$CFG->prefix}mnet_service2rpc s2r, @@ -161,8 +161,7 @@ class mnet_xmlrpc_client { h2s.subscribe = '1' AND h2s.hostid in ({$id_list})"; - $permission = get_record_sql($sql); - if ($permission == false) { + if (!record_exists_sql($sql)) { global $USER; $this->error[] = '7:User with ID '. $USER->id . ' attempted to call unauthorised method '.