mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Several changes related to the front page, so that it now works OK.
This commit is contained in:
parent
3054741af6
commit
21ddaf605c
12
config.php
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 @@ $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
|
||||
|
@ -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") ) {
|
||||
|
9
file.php
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;
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user