2001-11-22 06:23:56 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
2003-01-13 14:05:29 +00:00
|
|
|
/// Check that config.php exists
|
|
|
|
if (!file_exists("../config.php")) {
|
|
|
|
echo "<H2 align=center>You need to create a config.php.<BR>
|
|
|
|
See the <A HREF=\"http://moodle.com/doc/?frame=install.html\">installation instructions</A>.</H2>";
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2003-01-05 14:19:20 +00:00
|
|
|
require_once("../config.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Check that PHP is of a sufficient version
|
|
|
|
|
2003-01-13 14:05:29 +00:00
|
|
|
if (!check_php_version("4.1.0")) {
|
2002-09-19 12:01:55 +00:00
|
|
|
$version = phpversion();
|
|
|
|
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2003-01-28 02:52:13 +00:00
|
|
|
/// Check some PHP server settings
|
|
|
|
|
|
|
|
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
|
|
|
|
|
|
|
|
|
2003-05-17 02:05:10 +00:00
|
|
|
if (ini_get_bool('session.auto_start')) {
|
|
|
|
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
|
2003-01-28 02:52:13 +00:00
|
|
|
}
|
2003-05-17 02:05:10 +00:00
|
|
|
|
|
|
|
if (ini_get_bool('magic_quotes_runtime')) {
|
2003-01-28 02:52:13 +00:00
|
|
|
error("The PHP server variable 'magic_quotes_runtime' should be Off - $documentationlink");
|
|
|
|
}
|
|
|
|
|
2003-05-17 02:05:10 +00:00
|
|
|
if (!ini_get_bool('magic_quotes_gpc')) {
|
|
|
|
error("The PHP server variable 'magic_quotes_gpc' is not turned On - $documentationlink");
|
2003-01-28 02:52:13 +00:00
|
|
|
}
|
|
|
|
|
2003-05-17 02:05:10 +00:00
|
|
|
if (!ini_get_bool('file_uploads')) {
|
|
|
|
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
|
2003-01-28 02:52:13 +00:00
|
|
|
}
|
|
|
|
|
2003-05-17 02:05:10 +00:00
|
|
|
if (!ini_get_bool('short_open_tag')) {
|
|
|
|
error("The PHP server variable 'short_open_tag' is not turned On - $documentationlink");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-28 02:52:13 +00:00
|
|
|
|
2003-01-10 07:33:26 +00:00
|
|
|
/// Check that sessions are supported
|
|
|
|
|
2003-05-17 02:05:10 +00:00
|
|
|
if (!is_readable(ini_get('session.save_path')) and !ini_get_bool('safe_mode')) {
|
2003-01-10 07:33:26 +00:00
|
|
|
$sessionpath = ini_get('session.save_path');
|
|
|
|
notify("Warning: It appears your server does not support sessions (session.save_path = '$sessionpath')");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Check that config.php has been edited
|
|
|
|
|
2002-05-27 13:02:48 +00:00
|
|
|
if ($CFG->wwwroot == "http://example.com/moodle") {
|
2001-11-22 06:23:56 +00:00
|
|
|
error("Moodle has not been configured yet. You need to to edit config.php first.");
|
|
|
|
}
|
|
|
|
|
2003-01-13 14:05:29 +00:00
|
|
|
|
|
|
|
/// Check settings in config.php
|
|
|
|
|
|
|
|
$dirroot = dirname(realpath("../config.php"));
|
|
|
|
if ($dirroot != $CFG->dirroot) {
|
|
|
|
error("Please fix your settings in config.php:
|
|
|
|
<P>You have:
|
2003-01-18 14:24:40 +00:00
|
|
|
<P>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
|
2003-01-13 14:05:29 +00:00
|
|
|
<P>but it should be:
|
2003-01-18 14:24:40 +00:00
|
|
|
<P>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
|
|
|
|
"./");
|
2003-01-13 14:05:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-12-24 05:39:45 +00:00
|
|
|
/// Check if the main tables have been installed yet or not.
|
|
|
|
|
|
|
|
if (! $tables = $db->Metatables() ) { // No tables yet at all.
|
|
|
|
$maintables = false;
|
|
|
|
|
|
|
|
} else { // Check for missing main tables
|
|
|
|
$maintables = true;
|
|
|
|
$mtables = array("config", "course", "course_categories", "course_modules",
|
|
|
|
"course_sections", "log", "log_display", "modules",
|
|
|
|
"user", "user_admins", "user_students", "user_teachers");
|
|
|
|
foreach ($mtables as $mtable) {
|
|
|
|
if (!in_array($CFG->prefix.$mtable, $tables)) {
|
|
|
|
$maintables = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-08-17 08:38:43 +00:00
|
|
|
|
2002-12-24 05:39:45 +00:00
|
|
|
if (! $maintables) {
|
2002-08-17 08:38:43 +00:00
|
|
|
if (!$agreelicence) {
|
|
|
|
$strlicense = get_string("license");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strlicense, $strlicense, $strlicense, "", "", false, " ", " ");
|
2003-05-06 15:58:20 +00:00
|
|
|
print_heading("<A HREF=\"http://moodle.org\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
|
2002-08-17 08:38:43 +00:00
|
|
|
print_heading(get_string("copyrightnotice"));
|
2003-05-06 15:58:20 +00:00
|
|
|
print_simple_box_start("center");
|
2002-08-17 08:38:43 +00:00
|
|
|
echo text_to_html(get_string("gpl"));
|
|
|
|
print_simple_box_end();
|
|
|
|
echo "<BR>";
|
|
|
|
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
|
|
|
|
"http://www.gnu.org/copyleft/gpl.html");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2002-08-15 05:44:37 +00:00
|
|
|
$strdatabasesetup = get_string("databasesetup");
|
|
|
|
$strdatabasesuccess = get_string("databasesuccess");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, "", "", false, " ", " ");
|
2002-05-27 13:02:48 +00:00
|
|
|
if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug = true;
|
2002-12-14 18:33:37 +00:00
|
|
|
set_time_limit(0); // To allow slow databases to complete the long SQL
|
2002-05-27 13:02:48 +00:00
|
|
|
if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug = false;
|
2002-12-23 14:19:45 +00:00
|
|
|
notify($strdatabasesuccess, "green");
|
2002-05-27 13:02:48 +00:00
|
|
|
} else {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug = false;
|
2002-05-27 13:02:48 +00:00
|
|
|
error("Error: Main databases NOT set up successfully");
|
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
} else {
|
2002-08-15 05:44:37 +00:00
|
|
|
error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle. See the lib/db directory.");
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2002-08-15 05:44:37 +00:00
|
|
|
print_continue("index.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Check version of Moodle code on disk compared with database
|
|
|
|
/// and upgrade if possible.
|
2002-07-27 13:09:08 +00:00
|
|
|
|
2002-10-05 17:09:31 +00:00
|
|
|
include_once("$CFG->dirroot/version.php"); # defines $version
|
|
|
|
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines upgrades
|
2002-07-27 13:09:08 +00:00
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
if ($CFG->version) {
|
|
|
|
if ($version > $CFG->version) { // upgrade
|
|
|
|
$a->oldversion = $CFG->version;
|
2002-08-15 05:44:37 +00:00
|
|
|
$a->newversion = $version;
|
|
|
|
$strdatabasechecking = get_string("databasechecking", "", $a);
|
|
|
|
$strdatabasesuccess = get_string("databasesuccess");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking,
|
|
|
|
"", "", false, " ", " ");
|
2002-12-23 14:19:45 +00:00
|
|
|
print_heading($strdatabasechecking);
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=true;
|
2002-10-23 04:10:10 +00:00
|
|
|
if (main_upgrade($CFG->version)) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=false;
|
2002-09-27 06:13:59 +00:00
|
|
|
if (set_config("version", $version)) {
|
2002-12-23 14:19:45 +00:00
|
|
|
notify($strdatabasesuccess, "green");
|
2002-09-26 13:05:18 +00:00
|
|
|
print_continue("index.php");
|
2002-07-27 13:09:08 +00:00
|
|
|
die;
|
|
|
|
} else {
|
|
|
|
notify("Upgrade failed! (Could not update version in config table)");
|
|
|
|
}
|
|
|
|
} else {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=false;
|
2002-07-27 13:09:08 +00:00
|
|
|
notify("Upgrade failed! See /version.php");
|
|
|
|
}
|
2002-09-19 12:01:55 +00:00
|
|
|
} else if ($version < $CFG->version) {
|
2002-07-27 13:09:08 +00:00
|
|
|
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2003-05-06 15:58:20 +00:00
|
|
|
$strcurrentversion = get_string("currentversion");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strcurrentversion, $strcurrentversion, $strcurrentversion,
|
|
|
|
"", "", false, " ", " ");
|
2002-09-27 06:13:59 +00:00
|
|
|
|
|
|
|
if (set_config("version", $version)) {
|
2002-12-23 14:19:45 +00:00
|
|
|
print_heading("You are currently using Moodle version $version (Release $release)");
|
2002-08-15 05:44:37 +00:00
|
|
|
print_continue("index.php");
|
2002-07-27 13:09:08 +00:00
|
|
|
die;
|
|
|
|
} else {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=true;
|
2002-10-23 04:10:10 +00:00
|
|
|
if (main_upgrade(0)) {
|
2002-08-15 05:44:37 +00:00
|
|
|
print_continue("index.php");
|
2002-07-29 15:09:16 +00:00
|
|
|
} else {
|
|
|
|
error("A problem occurred inserting current version into databases");
|
|
|
|
}
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=false;
|
2002-07-27 13:09:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Updated human-readable release version if necessary
|
2002-09-06 14:06:48 +00:00
|
|
|
|
2002-09-27 06:13:59 +00:00
|
|
|
if ($release <> $CFG->release) { // Update the release version
|
2003-05-06 15:58:20 +00:00
|
|
|
$strcurrentrelease = get_string("currentrelease");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " ");
|
2002-09-27 06:13:59 +00:00
|
|
|
print_heading($release);
|
|
|
|
if (!set_config("release", $release)) {
|
|
|
|
notify("ERROR: Could not update release version in database!!");
|
2002-09-06 14:06:48 +00:00
|
|
|
}
|
2002-09-27 06:13:59 +00:00
|
|
|
print_continue("index.php");
|
|
|
|
print_simple_box_start("CENTER");
|
2002-12-29 17:32:32 +00:00
|
|
|
include("$CFG->dirroot/lang/en/docs/release.html");
|
2002-09-27 06:13:59 +00:00
|
|
|
print_simple_box_end();
|
|
|
|
print_continue("index.php");
|
|
|
|
exit;
|
2002-09-06 14:06:48 +00:00
|
|
|
}
|
|
|
|
|
2002-07-31 14:19:35 +00:00
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Find and check all modules and load them up or upgrade them if necessary
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-08-17 13:01:06 +00:00
|
|
|
if (!$mods = get_list_of_plugins("mod") ) {
|
2002-08-09 02:45:15 +00:00
|
|
|
error("No modules installed!");
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($mods as $mod) {
|
2002-12-12 13:35:10 +00:00
|
|
|
|
|
|
|
if ($mod == "NEWMODULE") { // Someone has unzipped the template, ignore it
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
$fullmod = "$CFG->dirroot/mod/$mod";
|
|
|
|
|
|
|
|
unset($module);
|
|
|
|
|
2003-01-08 09:07:07 +00:00
|
|
|
if ( is_readable("$fullmod/version.php")) {
|
|
|
|
include_once("$fullmod/version.php"); # defines $module with version etc
|
|
|
|
} else {
|
|
|
|
notify("Module $mod: $fullmod/version.php was not readable");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( is_readable("$fullmod/db/$CFG->dbtype.php")) {
|
|
|
|
include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
|
|
|
|
} else {
|
|
|
|
notify("Module $mod: $fullmod/db/$CFG->dbtype.php was not readable");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
if (!isset($module)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$module->name = $mod; // The name MUST match the directory
|
|
|
|
|
|
|
|
if ($currmodule = get_record("modules", "name", $module->name)) {
|
|
|
|
if ($currmodule->version == $module->version) {
|
|
|
|
// do nothing
|
|
|
|
} else if ($currmodule->version < $module->version) {
|
2002-12-23 14:19:45 +00:00
|
|
|
print_heading("$module->name module needs upgrading");
|
2002-07-27 06:08:29 +00:00
|
|
|
$upgrade_function = $module->name."_upgrade";
|
|
|
|
if (function_exists($upgrade_function)) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=true;
|
2002-07-27 06:08:29 +00:00
|
|
|
if ($upgrade_function($currmodule->version, $module)) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=false;
|
2002-07-27 06:08:29 +00:00
|
|
|
// OK so far, now update the modules record
|
|
|
|
$module->id = $currmodule->id;
|
|
|
|
if (! update_record("modules", $module)) {
|
|
|
|
error("Could not update $module->name record in modules table!");
|
|
|
|
}
|
2002-12-23 14:19:45 +00:00
|
|
|
notify(get_string("modulesuccess", "", $module->name), "green");
|
|
|
|
echo "<HR>";
|
2002-07-27 06:08:29 +00:00
|
|
|
} else {
|
2002-07-31 14:19:35 +00:00
|
|
|
$db->debug=false;
|
2002-07-27 06:08:29 +00:00
|
|
|
notify("Upgrading $module->name from $currmodule->version to $module->version FAILED!");
|
|
|
|
}
|
|
|
|
}
|
2001-12-04 14:02:36 +00:00
|
|
|
$updated_modules = true;
|
2001-11-22 06:23:56 +00:00
|
|
|
} else {
|
|
|
|
error("Version mismatch: $module->name can't downgrade $currmodule->version -> $module->version !");
|
|
|
|
}
|
|
|
|
|
|
|
|
} else { // module not installed yet, so install it
|
2003-01-03 16:35:51 +00:00
|
|
|
if (empty($updated_modules)) {
|
2002-08-15 05:44:37 +00:00
|
|
|
$strmodulesetup = get_string("modulesetup");
|
2003-05-19 13:12:27 +00:00
|
|
|
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, "", "", false, " ", " ");
|
2001-12-04 14:02:36 +00:00
|
|
|
}
|
2002-12-23 14:19:45 +00:00
|
|
|
print_heading($module->name);
|
2001-12-04 14:02:36 +00:00
|
|
|
$updated_modules = true;
|
2002-08-01 15:48:27 +00:00
|
|
|
$db->debug = true;
|
2002-12-14 18:33:37 +00:00
|
|
|
set_time_limit(0); // To allow slow databases to complete the long SQL
|
2002-05-31 13:20:01 +00:00
|
|
|
if (modify_database("$fullmod/db/$CFG->dbtype.sql")) {
|
2002-08-01 15:48:27 +00:00
|
|
|
$db->debug = false;
|
2001-11-22 06:23:56 +00:00
|
|
|
if ($module->id = insert_record("modules", $module)) {
|
2002-12-23 14:19:45 +00:00
|
|
|
notify(get_string("modulesuccess", "", $module->name), "green");
|
|
|
|
echo "<HR>";
|
2001-11-22 06:23:56 +00:00
|
|
|
} else {
|
|
|
|
error("$module->name module could not be added to the module list!");
|
|
|
|
}
|
2002-07-27 06:08:29 +00:00
|
|
|
} else {
|
2001-11-22 06:23:56 +00:00
|
|
|
error("$module->name tables could NOT be set up successfully!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-29 17:32:32 +00:00
|
|
|
if (!empty($updated_modules)) {
|
2002-08-15 05:44:37 +00:00
|
|
|
print_continue("index.php");
|
2001-12-04 14:02:36 +00:00
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
|
|
|
|
/// Insert default values for any important configuration variables
|
|
|
|
|
|
|
|
include_once("$CFG->dirroot/lib/defaults.php");
|
|
|
|
|
|
|
|
foreach ($defaults as $name => $value) {
|
2002-12-20 14:44:14 +00:00
|
|
|
if (!isset($CFG->$name)) {
|
|
|
|
$CFG->$name = $value;
|
|
|
|
set_config($name, $value);
|
2002-09-19 12:01:55 +00:00
|
|
|
$configchange = true;
|
|
|
|
}
|
|
|
|
}
|
2002-12-20 14:44:14 +00:00
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
|
|
|
|
/// If any new configurations were found then send to the config page to check
|
|
|
|
|
2002-12-29 17:32:32 +00:00
|
|
|
if (!empty($configchange)) {
|
2002-10-25 02:02:02 +00:00
|
|
|
redirect("config.php");
|
2002-09-19 12:01:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Set up the overall site name etc.
|
2002-07-11 05:30:10 +00:00
|
|
|
if (! $site = get_site()) {
|
2002-10-25 02:02:02 +00:00
|
|
|
redirect("site.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// Set up the admin user
|
2002-12-20 14:44:14 +00:00
|
|
|
if (! record_exists("user_admins")) { // No admin user yet
|
2002-10-25 02:02:02 +00:00
|
|
|
redirect("user.php");
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Check for valid admin user
|
2003-02-24 18:48:55 +00:00
|
|
|
if (!iscreator()) {
|
|
|
|
error("You need to be an admin user or teacher to use this page.", "$CFG->wwwroot/login/index.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-19 12:01:55 +00:00
|
|
|
/// At this point everything is set up and the user is an admin, so print menu
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-08-03 08:16:31 +00:00
|
|
|
$stradministration = get_string("administration");
|
2002-09-27 14:26:02 +00:00
|
|
|
print_header("$site->shortname: $stradministration","$site->fullname: $stradministration", "$stradministration");
|
2003-02-24 18:48:55 +00:00
|
|
|
if (isadmin()) {
|
|
|
|
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
|
|
|
|
$table->align = array ("CENTER", "CENTER", "CENTER");
|
2003-05-09 17:24:17 +00:00
|
|
|
$table->data[0][0] = "<p><a href=\"config.php\">".get_string("configvariables")."</a></p>".
|
|
|
|
"<p><a href=\"site.php\">".get_string("sitesettings")."</a></p>".
|
|
|
|
"<p><a href=\"../course/log.php?id=$site->id\">".get_string("sitelogs")."</a></p>".
|
|
|
|
"<p><a href=\"../theme/index.php\">".get_string("choosetheme")."</a></p>".
|
|
|
|
"<p><a href=\"lang.php\">".get_string("checklanguage")."</a></p>".
|
|
|
|
"<p><a href=\"modules.php\">".get_string("managemodules")."</a></p>";
|
2003-02-24 18:48:55 +00:00
|
|
|
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
|
2003-05-09 17:24:17 +00:00
|
|
|
$table->data[0][0] .= "<p><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></p>";
|
2003-02-24 18:48:55 +00:00
|
|
|
}
|
2003-05-09 17:24:17 +00:00
|
|
|
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
|
2003-05-14 15:58:48 +00:00
|
|
|
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
|
2003-05-09 17:24:17 +00:00
|
|
|
"<p><a href=\"../course/delete.php\">".get_string("deletecourse")."</a></p>".
|
|
|
|
"<p><a href=\"../course/categories.php\">".get_string("categories")."</a></p>";
|
|
|
|
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
|
|
|
|
$table->data[0][2] = "<p><a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a></p>";
|
2003-04-25 17:18:40 +00:00
|
|
|
}
|
2003-05-09 17:24:17 +00:00
|
|
|
$table->data[0][2] .= "<p><a href=\"user.php\">".get_string("edituser")."</a></p>".
|
|
|
|
"<p><a href=\"admin.php\">".get_string("assignadmins")."</a></p>".
|
|
|
|
"<p><a href=\"creators.php\">".get_string("assigncreators")."</a></p>".
|
|
|
|
"<p><a href=\"auth.php\">".get_string("authentication")."</a></p>";
|
2003-02-24 18:48:55 +00:00
|
|
|
} else { /// user is coursecreator
|
|
|
|
$table->head = array (get_string("courses"));
|
|
|
|
$table->align = array ("CENTER");
|
2003-05-09 17:24:17 +00:00
|
|
|
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
|
2003-05-14 15:58:48 +00:00
|
|
|
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>";
|
2003-02-24 18:48:55 +00:00
|
|
|
}
|
|
|
|
|
2002-08-03 04:44:35 +00:00
|
|
|
print_table($table);
|
2003-05-12 11:30:19 +00:00
|
|
|
|
2003-05-09 17:24:17 +00:00
|
|
|
echo "<br><div align=center>";
|
2003-01-06 08:23:13 +00:00
|
|
|
print_single_button("$CFG->wwwroot/doc", NULL, get_string("documentation"));
|
2003-05-09 17:24:17 +00:00
|
|
|
echo "</div>";
|
2003-01-06 08:23:13 +00:00
|
|
|
|
2003-05-12 11:30:19 +00:00
|
|
|
echo "<br><div align=center>";
|
|
|
|
print_single_button("register.php", NULL, get_string("registration"));
|
|
|
|
echo "</div>";
|
|
|
|
|
2002-09-27 06:19:18 +00:00
|
|
|
print_heading("Moodle $CFG->release ($CFG->version)", "CENTER", 1);
|
|
|
|
|
2002-10-10 07:26:10 +00:00
|
|
|
print_footer($site);
|
2002-09-19 12:01:55 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
|