Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Several changes related to the front page, so that it now works OK.

  • Loading branch information...
commit 21ddaf605c84d56f33394443917ea31f13c13f8b 1 parent 3054741
martin authored
View
12 config.php
@@ -14,15 +14,15 @@
$CFG->dbtype = "mysql"; // eg mysql, postgres, oracle, access etc
$CFG->dbhost = "localhost"; // eg localhost
$CFG->dbname = "moodle"; // eg moodle
-$CFG->dbuser = "muser";
-$CFG->dbpass = "mpassword";
+$CFG->dbuser = "moodle";
+$CFG->dbpass = "moodle";
// Next you need to tell Moodle where it is, and where it can save files.
-$CFG->wwwroot = "http://example.com/moodle";
-$CFG->dirroot = "/home/httpd/moodle";
-$CFG->dataroot = "/home/moodledata"; // Web-server writeable
+$CFG->wwwroot = "http://server.dougiamas.net/moodle";
+$CFG->dirroot = "/web/server/moodle";
+$CFG->dataroot = "/web/moodledata"; // Web-server writeable
// Choose a theme from the "themes" folder. Default theme is "standard".
@@ -33,7 +33,7 @@
// Give the full name (eg mail.example.com) of an SMTP server that the
// web server machine has access to (to send mail). Default: "localhost".
-$CFG->smtphost = "mail.example.com";
+$CFG->smtphost = "dougiamas.com";
// You should not need to change anything below this line
View
8 course/view.php
@@ -12,10 +12,6 @@
error("That's an invalid course id");
}
- if (! $course->category) { // This course is not a real course.
- redirect("$CFG->wwwroot");
- }
-
add_to_log("View course: $course->shortname", $id);
if ( $USER->teacher[$course->id] ) {
@@ -31,6 +27,10 @@
$USER->help = false;
}
+ if (! $course->category) { // This course is not a real course.
+ redirect("$CFG->wwwroot");
+ }
+
print_header("Course: $course->fullname", "$course->fullname", "$course->shortname", "");
if (! $modtypes = get_records_sql_menu("SELECT name,fullname FROM modules ORDER BY fullname") ) {
View
9 file.php
@@ -13,13 +13,16 @@
$args = get_slash_arguments();
$numargs = count($args);
-
$courseid = (integer)$args[0];
- if ($courseid > 0) {
+ $course = get_record("course", "id", $courseid);
+
+ if ($course->category) {
require_login($courseid);
}
+ // it's OK to get here if no course was specified
+
$pathname = "$CFG->dataroot$PATH_INFO";
$filename = $args[$numargs-1];
@@ -36,7 +39,7 @@
header("Content-type: $mimetype");
readfile("$pathname");
} else {
- error("Sorry, but the file you are looking for was not found", "/course/view.php?id=$courseid");
+ error("Sorry, but the file you are looking for was not found", "course/view.php?id=$courseid");
}
exit;
View
12 lib/moodlelib.php
@@ -156,6 +156,18 @@ function print_table($table) {
return true;
}
+function print_editing_switch($courseid) {
+ global $CFG, $USER;
+
+ if (isadmin() || isteacher($courseid)) {
+ if ($USER->editing) {
+ echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=off\">Turn editing off</A>";
+ } else {
+ echo "<A HREF=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=on\">Turn editing on</A>";
+ }
+ }
+}
+
function moodledate($date) {
return date("l, j F Y, g:i A T", $date);
View
19 theme/standard/footer.html
@@ -1,18 +1,15 @@
<!-- START OF FOOTER -->
<CENTER>
<HR SIZE=1 NOSHADE>
-<FONT SIZE=1><P>
+<FONT SIZE=1>
+<P>
<? if ($USER->id) {
- echo "You are logged in as $USER->firstname $USER->lastname. ";
- if ($USER->survey) {
- echo " (Student)<BR>To log out you need to quit the browser.";
- } else {
- echo " (<A HREF=$CFG->wwwroot/login/logout.php>Logout</A>)";
- }
- } else {
- echo "You are not logged in. <A HREF=$CFG->wwwroot/login/>Log in here</A>.";
- }
+ echo "You are logged in as $USER->firstname $USER->lastname.";
+ echo "(<A HREF=\"$CFG->wwwroot/login/logout.php\">Logout</A>)";
+ } else {
+ echo "You are not logged in. <A HREF=\"$CFG->wwwroot/login/\">Log in here</A>.";
+ }
?>
</P>
<P><?=$homelink ?></P>
-</BODY>
+</FONT>
Please sign in to comment.
Something went wrong with that request. Please try again.