From: moodler Date: Thu, 12 Aug 2004 07:52:44 +0000 (+0000) Subject: Avoiding a notice X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ffbe59b8d02b6e47026849765a0f36f95f6fff12;p=moodle.git Avoiding a notice --- diff --git a/course/edit.php b/course/edit.php index 4a8b2cc4dd..1210f67ace 100644 --- a/course/edit.php +++ b/course/edit.php @@ -38,7 +38,11 @@ if ($form = data_submitted()) { - check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id"); + if (empty($course)) { + check_for_restricted_user($USER->username, "$CFG->wwwroot"); + } else { + check_for_restricted_user($USER->username, "$CFG->wwwroot/course/view.php?id=$course->id"); + } $form->startdate = make_timestamp($form->startyear, $form->startmonth, $form->startday);