Skip to content

Commit

Permalink
initializing variables
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 17, 2010
1 parent ac86edd commit f7c40d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions enrol/flatfile/lib.php
Expand Up @@ -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";

Expand All @@ -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);

Expand Down
12 changes: 7 additions & 5 deletions enrol/imsenterprise/lib.php
Expand Up @@ -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('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $tagcontents, $matches)){
$group->coursecode = trim($matches[1]);
}
Expand Down Expand Up @@ -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.');
Expand Down Expand Up @@ -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('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $tagcontents, $matches)){
$person->idnumber = trim($matches[1]);
}
Expand Down

0 comments on commit f7c40d4

Please sign in to comment.