]> git.mjollnir.org Git - moodle.git/commitdiff
Several changes related to the front page, so that it now works OK.
authormartin <martin>
Sun, 25 Nov 2001 15:48:24 +0000 (15:48 +0000)
committermartin <martin>
Sun, 25 Nov 2001 15:48:24 +0000 (15:48 +0000)
config.php
course/view.php
file.php
lib/moodlelib.php
theme/standard/footer.html

index 77b4a79d8112aa4ebe2adf9ff9c7412293454711..e9dfee8743f1f00ab398bbacd050afccb58344c4 100644 (file)
 $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 @@ $CFG->theme     = "standard";
 // 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
index 3044a7b4c0d9e3b47946963c90a0f901e4ddfd63..f7fc1988521f3c5c879b854dc0f120e9b07a92af 100644 (file)
         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] ) {
         $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") ) {
index bd787620d72167669439d73622b2385c0950bed8..fa1bd9cf93049759c3a9420ddbf8a833c51e7815 100644 (file)
--- a/file.php
+++ b/file.php
 
     $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;
index a8c181a28e06ac969bd75705f0ff515c70b832e3..bd109174bbf76af03d920006624ec32826740581 100644 (file)
@@ -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);
index 49045eb18e6ac989005de8c0a26b123b39d3103c..5645faa7d1573361b097d427894c9de7ae82cc31 100644 (file)
@@ -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>