From f7c40d46bdf50704afcd8310b6af0d08dac0e8df Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 17 Sep 2010 12:41:00 +0000 Subject: [PATCH] initializing variables --- enrol/flatfile/lib.php | 2 ++ enrol/imsenterprise/lib.php | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/enrol/flatfile/lib.php b/enrol/flatfile/lib.php index 7971923584577..580a332fc5560 100644 --- a/enrol/flatfile/lib.php +++ b/enrol/flatfile/lib.php @@ -273,6 +273,7 @@ private function process_records($action, $roleid, $user, $course, $timestart, $ if (!empty($mailstudents)) { // Send mail to students + $a = new object(); $a->coursename = "$course->fullname"; $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id"; @@ -294,6 +295,7 @@ private function process_records($action, $roleid, $user, $course, $timestart, $ // Send mail to teachers foreach($teachers as $teacher) { + $a = new object(); $a->course = "$course->fullname"; $a->user = fullname($user); diff --git a/enrol/imsenterprise/lib.php b/enrol/imsenterprise/lib.php index 4ee19ce649362..1cdf2c2556def 100644 --- a/enrol/imsenterprise/lib.php +++ b/enrol/imsenterprise/lib.php @@ -311,7 +311,7 @@ function process_group_tag($tagcontents){ $createnewcategories = $this->get_config('createnewcategories'); // Process tag contents - unset($group); + $group = new object(); if(preg_match('{.*?(.+?).*?}is', $tagcontents, $matches)){ $group->coursecode = trim($matches[1]); } @@ -372,11 +372,12 @@ function process_group_tag($tagcontents){ $course->category = $catid; } elseif($createnewcategories) { // Else if we're allowed to create new categories, let's create this one + $newcat = new object(); $newcat->name = $group->category; - $newcat->visible = 0; - $catid = $DB->insert_record('course_categories', $newcat); - $course->category = $catid; - $this->log_line("Created new (hidden) category, #$catid: $newcat->name"); + $newcat->visible = 0; + $catid = $DB->insert_record('course_categories', $newcat); + $course->category = $catid; + $this->log_line("Created new (hidden) category, #$catid: $newcat->name"); }else{ // If not found and not allowed to create, stick with default $this->log_line('Category '.$group->category.' not found in Moodle database, so using default category instead.'); @@ -429,6 +430,7 @@ function process_person_tag($tagcontents){ $imsdeleteusers = $this->get_config('imsdeleteusers'); $createnewusers = $this->get_config('createnewusers'); + $person = new object(); if(preg_match('{.*?(.+?).*?}is', $tagcontents, $matches)){ $person->idnumber = trim($matches[1]); }