From f67cab32ec863467b12f94ecdd671a602b0f6641 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 5 Jun 2008 18:01:22 +0000 Subject: [PATCH] MDL-15094 some forgotten conversions --- admin/cliupgrade.php | 2 +- auth/db/auth.php | 2 +- backup/restorelib.php | 2 +- lib/accesslib.php | 2 +- lib/grade/grade_object.php | 2 +- login/index.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/cliupgrade.php b/admin/cliupgrade.php index 51bd76faeb..f54ed4a06b 100644 --- a/admin/cliupgrade.php +++ b/admin/cliupgrade.php @@ -1233,7 +1233,7 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) { } /// Check if the guest user exists. If not, create one. - if (! record_exists("user", "username", "guest")) { + if (!$DB->record_exists("user", array("username"=>"guest"))) { if (! $guest = create_guest_record()) { notify("Could not create guest user record !!!"); } diff --git a/auth/db/auth.php b/auth/db/auth.php index f2026df170..702e2d40fa 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -363,7 +363,7 @@ class auth_plugin_db extends auth_plugin_base { $user->id = $old_user->id; $DB->set_field('user', 'deleted', 0, array('username'=>$user->username)); echo "\t"; print_string('auth_dbreviveuser', 'auth', array($user->username, $user->id)); echo "\n"; - } elseif ($id = insert_record ('user',$user)) { // it is truly a new user + } elseif ($id = $DB->insert_record ('user',$user)) { // it is truly a new user echo "\t"; print_string('auth_dbinsertuser','auth',array($user->username, $id)); echo "\n"; // if relevant, tag for password generation if ($this->config->passtype === 'internal') { diff --git a/backup/restorelib.php b/backup/restorelib.php index faacab466a..0b9fac102d 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1568,7 +1568,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3); /// Process letters $context = get_context_instance(CONTEXT_COURSE, $restore->course_id); // respect current grade letters if defined - if ($status and $restoreall and !record_exists('grade_letters', 'contextid', $context->id)) { + if ($status and $restoreall and !$DB->record_exists('grade_letters', array('contextid'=>$context->id))) { if (!defined('RESTORE_SILENTLY')) { echo '
  • '.get_string('gradeletters','grades').'
  • '; } diff --git a/lib/accesslib.php b/lib/accesslib.php index 0c35c7c17a..ccd0ef378f 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2659,7 +2659,7 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time return false; } - if ($userid && !record_exists('user', 'id', $userid)) { + if ($userid && !$DB->record_exists('user', array('id'=>$userid))) { debugging('User ID '.intval($userid).' does not exist!'); return false; } diff --git a/lib/grade/grade_object.php b/lib/grade/grade_object.php index 3c2fe75b90..ab25af0e6b 100644 --- a/lib/grade/grade_object.php +++ b/lib/grade/grade_object.php @@ -233,7 +233,7 @@ abstract class grade_object { $data = $this->get_record_data(); - if (delete_records($this->table, 'id', $this->id)) { + if ($DB->delete_records($this->table, array('id'=>$this->id))) { if (empty($CFG->disablegradehistory)) { unset($data->id); unset($data->timecreated); diff --git a/login/index.php b/login/index.php index ca701c285f..e1c59d39ed 100644 --- a/login/index.php +++ b/login/index.php @@ -25,7 +25,7 @@ } /// Check if the guest user exists. If not, create one. - if (! record_exists('user', 'username', 'guest', 'mnethostid', $CFG->mnet_localhost_id)) { + if (!$DB->record_exists('user', array('username'=>'guest', 'mnethostid'=>$CFG->mnet_localhost_id))) { if (! $guest = create_guest_record()) { notify('Could not create guest user record !!!'); } -- 2.39.5