Fixed up use of isteacher (removed isadmin check because it's done in isteacher now)

This commit is contained in:
martin 2002-04-03 06:36:04 +00:00
parent d115a57f12
commit 0d97d1e35f
7 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@
require_login($course->id);
if (!isteacher($course->id) && ! isadmin()) {
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
} else { // Admin is creating a new course

View File

@ -11,7 +11,7 @@
error("That's an invalid course id");
}
if ( ! isteacher($course->id) && ! isadmin()) {
if ( ! isteacher($course->id)) {
error("Only teachers can view logs");
}

View File

@ -11,7 +11,7 @@
error("That's an invalid course id");
}
if ( ! isteacher($course->id) && ! isadmin()) {
if (! isteacher($course->id)) {
error("Only teachers can view logs");
}

View File

@ -9,7 +9,7 @@
require_login($mod->course);
if (!isteacher($mod->course) && !isadmin()) {
if (!isteacher($mod->course)) {
error("You can't modify this course!");
}
@ -93,7 +93,7 @@
require_login($course->id);
if (!isteacher($course->id) && !isadmin()) {
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
@ -177,7 +177,7 @@
require_login($course->id);
if (!isteacher($course->id) && !isadmin()) {
if (!isteacher($course->id)) {
error("You can't modify this course!");
}

View File

@ -78,13 +78,13 @@
} else {
$subtext = "Subscribe me by mail";
}
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>Discussion Topics<TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/discuss/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>Social Forum - Current Topics<TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/discuss/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
<IMG HEIGHT=7 SRC="../pix/spacer.gif"><BR>
<?
if ($social = get_course_social_forum($course->id)) {
forum_latest_topics($social->id, 5, "plain", "DESC", false);
forum_latest_topics($social->id, 10, "plain", "DESC", false);
} else {
error("Could not find or create a social forum here");
}

View File

@ -14,7 +14,7 @@
add_to_log("View course: $course->shortname", $id);
if ( isteacher($course->id) || isadmin() ) {
if ( isteacher($course->id) ) {
if ($edit == "on") {
$USER->editing = true;
} else if ($edit == "off") {

View File

@ -46,7 +46,7 @@
// Admin links and controls
if ($USER->teacher[$course->id] || isadmin()) {
if (isteacher($course->id)) {
$adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"Edit\">";
if ($USER->editing) {
$admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";