require_once("../config.php");
require_once("lib.php");
+ require_login();
+
if (!isadmin()) {
error("Only administrators can use this course!");
}
optional_variable($id, 0); // course id
+ require_login();
+
if ($id) {
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
- require_login($course->id);
-
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
} else { // Admin is creating a new course
- require_login();
if (!iscreator()) {
error("Only administrators and teachers can use this page");
require_variable($id); // Week ID
+ require_login();
+
if (! $section = get_record("course_sections", "id", $id)) {
error("Course section is incorrect");
}
error("Could not find the course!");
}
- require_login($course->id);
-
if (!isteacher($course->id)) {
error("Only teachers can edit this!");
}
require_once("../config.php");
require_once("lib.php");
- require_login();
require_variable($id);
+ require_login();
+
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
require_variable($id); // course id
optional_variable($download, ""); // to download data
+ require_login();
+
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
- require_login($course->id);
-
if (!isteacher($course->id)) {
error("Only teachers can use this page!");
}
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
- require_login($id);
+ require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
require_once("../config.php");
require_once("lib.php");
- require_login($id);
+ require_variable($id);
+
+ require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
-<? // $Id$
+<?php // $Id$
// social.php - course format featuring social forum
// included from view.php
$leftwidth = 210;
?>
-<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
- <TR>
- <TD WIDTH="<?=$leftwidth?>" VALIGN="TOP">
- <?
+<table width="100%" border="0" cellspacing="5" cellpadding="5">
+ <tr>
+ <td width="<?php echo $leftwidth?>" valign="top">
+ <?php
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".
} else {
$subtext = get_string("subscribe", "forum");
}
- $headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".get_string("socialheadline")."</td><td align=right><font size=1><a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td></tr></table>";
+ $headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".
+ get_string("socialheadline").
+ "</td><td align=right><font size=1>".
+ "<a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td>".
+ "</tr></table>";
print_heading_block($headertext);
echo "<img alt=\"\" height=7 src=\"../pix/spacer.gif\"><br>";
notify("Could not find or create a social forum here");
}
?>
- </TD>
- </TR>
-</TABLE>
+ </td>
+ </tr>
+</table>
require_variable($id); // course id
+ require_login();
+
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
- require_login($course->id);
-
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
}
}
- require_login($id);
+ require_login($course->id);
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");