]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15094 some forgotten conversions
authorskodak <skodak>
Thu, 5 Jun 2008 18:01:22 +0000 (18:01 +0000)
committerskodak <skodak>
Thu, 5 Jun 2008 18:01:22 +0000 (18:01 +0000)
admin/cliupgrade.php
auth/db/auth.php
backup/restorelib.php
lib/accesslib.php
lib/grade/grade_object.php
login/index.php

index 51bd76faeb783b507c8b63cdf3d4eaf5089c42f7..f54ed4a06bde740a66a42afbc0d955b2f40641ed 100644 (file)
@@ -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 !!!");
         }
index f2026df1709a129af0574a6ff1fd65e64dac3b22..702e2d40fa8f788531814dc9133bd2c5f9581b9d 100644 (file)
@@ -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') {
index faacab466a797824d696105fe70dc3a76cd56467..0b9fac102ddaf4b3853bdc8b0de61825205dc33d 100644 (file)
@@ -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 '<li>'.get_string('gradeletters','grades').'</li>';
             }
index 0c35c7c17a2e1e798455f102d9c1d739040aa214..ccd0ef378f119221948c82f8bbefba63a238e95e 100755 (executable)
@@ -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;
     }
index 3c2fe75b90253c631b0d626fb210eb99760e96f3..ab25af0e6bb681211f492b0d783d3068f5ba187e 100644 (file)
@@ -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);
index ca701c285f262afb5e1ad28ec1532399de811134..e1c59d39edfa4b1beaf3d63ece13e66feab369a4 100644 (file)
@@ -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 !!!');
         }