Permalink
Browse files

Initial revision

  • Loading branch information...
0 parents commit f9903ed0a41ce4df0cb3628a06d6c0a9455ac75c martin committed Nov 22, 2001
Showing with 14,908 additions and 0 deletions.
  1. +1 −0 .htaccess
  2. +1 −0 README
  3. +48 −0 admin/cron.php
  4. +97 −0 admin/index.php
  5. +22 −0 admin/log.php
  6. +189 −0 admin/moodle-core.sql
  7. +28 −0 admin/site.html
  8. +84 −0 admin/site.php
  9. +108 −0 admin/teacher.php
  10. +82 −0 admin/user.html
  11. +211 −0 admin/user.php
  12. +46 −0 config.php
  13. +72 −0 course/edit.html
  14. +168 −0 course/edit.php
  15. +12 −0 course/editweek.html
  16. +50 −0 course/editweek.php
  17. +32 −0 course/email.html
  18. +48 −0 course/email.php
  19. +25 −0 course/index.php
  20. +131 −0 course/lib.php
  21. +65 −0 course/log.php
  22. +34 −0 course/login.html
  23. +93 −0 course/login.php
  24. +40 −0 course/loginas.php
  25. +29 −0 course/loglive.php
  26. +423 −0 course/mod.php
  27. +16 −0 course/mod_delete.html
  28. +44 −0 course/new.php
  29. +158 −0 course/noweeks.php
  30. +46 −0 course/user.php
  31. +102 −0 course/view.php
  32. +184 −0 course/weeks.php
  33. +8 −0 doc/CHANGES
  34. +20 −0 doc/COPYRIGHT
  35. +95 −0 doc/INSTALL
  36. +281 −0 doc/LICENCE
  37. +3 −0 doc/NOTES
  38. +15 −0 doc/ROADMAP
  39. +37 −0 error/index.php
  40. +43 −0 file.php
  41. +646 −0 files/index.php
  42. +37 −0 files/mimetypes.php
  43. BIN files/pix/audio.gif
  44. BIN files/pix/edit.gif
  45. BIN files/pix/env.gif
  46. BIN files/pix/excel.gif
  47. BIN files/pix/explore.gif
  48. BIN files/pix/files.gif
  49. BIN files/pix/folder.gif
  50. BIN files/pix/help.gif
  51. BIN files/pix/html.gif
  52. BIN files/pix/image.gif
  53. BIN files/pix/move.gif
  54. BIN files/pix/parent.gif
  55. BIN files/pix/pdf.gif
  56. BIN files/pix/text.gif
  57. BIN files/pix/unknown.gif
  58. BIN files/pix/word.gif
  59. BIN files/pix/zip.gif
  60. +50 −0 index.php
  61. +983 −0 lib/class.phpmailer.php
  62. +939 −0 lib/class.smtp.php
  63. BIN lib/fonts/arial.ttf
  64. BIN lib/fonts/vixar.ttf
  65. +1,704 −0 lib/graphlib.php
  66. +19 −0 lib/javascript.php
  67. +1,163 −0 lib/moodlelib.php
  68. +204 −0 lib/psxlsgen.php
  69. +66 −0 lib/setup.php
  70. +291 −0 lib/weblib.php
  71. +17 −0 lib/wordlist.txt
  72. +86 −0 login/change_password.php
  73. +33 −0 login/change_password_form.html
  74. +54 −0 login/confirm.php
  75. +256 −0 login/countries.php
  76. +102 −0 login/forgot_password.php
  77. +15 −0 login/forgot_password_change.html
  78. +34 −0 login/forgot_password_form.html
  79. +87 −0 login/index.php
  80. +20 −0 login/index_confirm.html
  81. +63 −0 login/index_form.html
  82. +11 −0 login/logout.php
  83. +129 −0 login/signup.php
  84. +19 −0 login/signup_confirm.html
  85. +77 −0 login/signup_form.php
  86. +6 −0 mod/assignment/README
  87. +10 −0 mod/assignment/module.php
  88. BIN mod/choice/icon.gif
  89. +62 −0 mod/choice/index.php
  90. +43 −0 mod/choice/install.sql
  91. +54 −0 mod/choice/mod.html
  92. +81 −0 mod/choice/mod.php
  93. +14 −0 mod/choice/module.php
  94. +94 −0 mod/choice/report.php
  95. +19 −0 mod/choice/view.html
  96. +92 −0 mod/choice/view.php
  97. +10 −0 mod/journal/edit.html
  98. +75 −0 mod/journal/edit.php
  99. BIN mod/journal/icon.gif
  100. +60 −0 mod/journal/index.php
  101. +45 −0 mod/journal/install.sql
  102. +11 −0 mod/journal/lib.php
  103. +46 −0 mod/journal/mod.html
  104. +83 −0 mod/journal/mod.php
  105. +14 −0 mod/journal/module.php
  106. +39 −0 mod/journal/new.php
  107. +151 −0 mod/journal/report.php
  108. +67 −0 mod/journal/user.php
  109. +141 −0 mod/journal/view.php
  110. +63 −0 mod/survey/details.php
  111. +214 −0 mod/survey/download.php
  112. +288 −0 mod/survey/edit.php
  113. +66 −0 mod/survey/edit_form.html
  114. +70 −0 mod/survey/edit_form.phtml
  115. +14 −0 mod/survey/edit_new.html
  116. +14 −0 mod/survey/edit_new.phtml
  117. +620 −0 mod/survey/graph.php
  118. BIN mod/survey/icon.gif
  119. BIN mod/survey/icon2.gif
  120. +40 −0 mod/survey/index.php
  121. +167 −0 mod/survey/install.sql
  122. +79 −0 mod/survey/lib.php
  123. +65 −0 mod/survey/login_form.html
  124. +34 −0 mod/survey/mod.html
  125. +91 −0 mod/survey/mod.php
  126. +14 −0 mod/survey/module.php
  127. +356 −0 mod/survey/report.php
  128. +82 −0 mod/survey/save.php
  129. +10 −0 mod/survey/test.php
  130. +245 −0 mod/survey/view.php
  131. BIN pix/b.gif
  132. 0 pix/i/ICONS-16x16
  133. BIN pix/i/email.gif
  134. BIN pix/i/log.gif
  135. BIN pix/i/new.gif
  136. BIN pix/i/news.gif
  137. BIN pix/i/settings.gif
  138. BIN pix/madewithmoodle.gif
  139. BIN pix/madewithmoodle1.gif
  140. BIN pix/madewithmoodle2.gif
  141. +252 −0 pix/poo.html
  142. 0 pix/s/SMILEYS
  143. BIN pix/s/biggrin.gif
  144. BIN pix/s/cool.gif
  145. BIN pix/s/cross.gif
  146. BIN pix/s/mixed.gif
  147. BIN pix/s/sad.gif
  148. BIN pix/s/smiley.gif
  149. BIN pix/s/surprise.gif
  150. BIN pix/s/tongueout.gif
  151. BIN pix/s/wideeyes.gif
  152. BIN pix/s/wink.gif
  153. BIN pix/spacer.gif
  154. 0 pix/t/TINY-ICONS
  155. BIN pix/t/delete.gif
  156. BIN pix/t/down.gif
  157. BIN pix/t/edit.gif
  158. BIN pix/t/search.gif
  159. BIN pix/t/up.gif
  160. BIN pix/webding.png
  161. +10 −0 theme/standard/config.php
  162. +18 −0 theme/standard/footer.html
  163. +26 −0 theme/standard/header.html
  164. +13 −0 theme/standard/styles.css
  165. BIN user/default/f1.jpg
  166. BIN user/default/f2.jpg
  167. +60 −0 user/edit.html
  168. +148 −0 user/edit.php
  169. +93 −0 user/index.php
  170. +51 −0 user/lib.php
  171. +41 −0 user/new.php
  172. +36 −0 user/pix.php
  173. BIN user/user.gif
  174. BIN user/users.gif
  175. +115 −0 user/view.php
@@ -0,0 +1 @@
+All the documention is in the "doc" subdirectory. :-)
@@ -0,0 +1 @@
+All the documention is in the "doc" subdirectory. :-)
@@ -0,0 +1,48 @@
+<?PHP // $Id$
+
+// This script looks through all the module directories for cron.php files
+// and runs them. These files can contain cleanup functions, email functions
+// or anything that needs to be run on a regular basis.
+//
+// This file is best run from cron on the host system (ie outside PHP).
+// The script can either be invoked via the web server or via a standalone
+// version of PHP compiled for CGI.
+//
+// The script does not require a valid Moodle login, but has it's own unique
+// password, set below. These are passed to this script as parameters.
+//
+// eg wget -q -O /dev/null 'http://moodle.dougiamas.net/admin/cron.php?p=password'
+// or php /web/moodle/admin/cron.php password
+
+ $PASSWORD = "fr0o6y";
+
+ require("../config.php");
+
+ echo "<PRE>\n";
+
+ if (!isset($p)) {
+ $p = $GLOBALS[argv][1];
+ }
+
+ if ($p <> $PASSWORD) {
+ add_to_log("Error: bad cron password!");
+ echo "Error: bad password.\n";
+ die;
+ }
+
+ $timenow = time();
+
+ if ($mods = get_records_sql("SELECT * FROM modules WHERE cron > 0 AND (($timenow - lastcron) > cron)")) {
+ foreach ($mods as $mod) {
+ $cronfile = "$CFG->dirroot/mod/$mod->name/cron.php";
+ if (file_exists($cronfile)) {
+ include($cronfile);
+ if (! set_field("modules", "lastcron", $timenow, "id", $mod->id)) {
+ echo "Error: could not update timestamp for $mod->fullname\n";
+ }
+ }
+ }
+ }
+ echo "Cron script completed correctly\n";
+
+?>
@@ -0,0 +1,97 @@
+<?PHP // $Id$
+
+ require("../config.php");
+
+
+ if (! $CFG->wwwroot == "http://example.com") {
+ error("Moodle has not been configured yet. You need to to edit config.php first.");
+ }
+
+ // Check databases and modules and install as needed.
+ if (! $db->Metatables() ) {
+ print_header("Setting up database", "Setting up database", "Setting up databases for the first time", "");
+ if (modify_database("$CFG->dirroot/admin/moodle-core.sql")) {
+ notify("Main databases set up successfully");
+ } else {
+ error("Error: Main databases NOT set up successfully");
+ }
+ print_heading("<A HREF=\"index.php\">Continue</A>");
+ die;
+ }
+
+ // Find and check all modules and load them up.
+ $dir = opendir("$CFG->dirroot/mod");
+ while ($mod = readdir($dir)) {
+ if ($mod == "." || $mod == "..") {
+ continue;
+ }
+
+ $fullmod = "$CFG->dirroot/mod/$mod";
+ if (filetype($fullmod) != "dir") {
+ continue;
+ }
+
+ unset($module);
+
+ include_once("$CFG->dirroot/mod/$mod/module.php"); # defines $module
+
+ 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) {
+ notify("$module->name module needs upgrading"); // XXX do the upgrade here
+ } else {
+ error("Version mismatch: $module->name can't downgrade $currmodule->version -> $module->version !");
+ }
+
+ } else { // module not installed yet, so install it
+ if (modify_database("$fullmod/install.sql")) {
+ if ($module->id = insert_record("modules", $module)) {
+ notify("$module->name tables have been set up correctly");
+ } else {
+ error("$module->name module could not be added to the module list!");
+ }
+ } else {
+ error("$module->name tables could NOT be set up successfully!");
+ }
+ }
+ }
+
+ // Set up the overall site name etc.
+ if (! $course = get_record("course", "category", 0)) {
+ redirect("site.php");
+ }
+
+ if (!isadmin()) {
+ if (record_exists_sql("SELECT * FROM user_admins")) {
+ require_login();
+ } else {
+ redirect("user.php");
+ }
+ }
+
+
+ // At this point, the databases exist, and the user is an admin
+
+ print_header("$course->fullname: Administration Page","$course->fullname: Administration Page", "Admin");
+
+ echo "<UL>";
+ echo "<LI><B><A HREF=\"site.php\">Site settings</A></B>";
+ echo "<LI><B><A HREF=\"../course/edit.php\">Create a new course</A></B>";
+ echo "<LI><B><A HREF=\"user.php\">Edit a user's account</A></B>";
+ echo "<LI><B>Assign teachers to courses</B>";
+ echo "<LI><B>Delete a course</B>";
+ echo "<LI><B>View Logs</B>";
+ echo "</UL>";
+
+
+ print_footer();
+?>
+
+
@@ -0,0 +1,22 @@
+<?PHP // $Id$
+
+ $logs = $db->Execute("SELECT l.*, u.firstname, u.lastname, u.email FROM log l, user u WHERE l.user = u.id ORDER BY l.time ASC");
+
+ echo "<TABLE>"
+ while (! $logs->EOF) {
+ $log = (object)$logs->fields;
+
+ echo "<TR>";
+ echo "<TD>".date("l, j F Y, g:i A T", $log->time);
+ echo "<TD><A HREF=\"mailto:$log->email\">$log->firstname $log->lastname</A>";
+ echo "<TD>$log->ip";
+ echo "<TD>$log->url";
+ echo "<TD>$log->message";
+ echo "</TR>";
+
+ $logs->MoveNext();
+ }
+
+ echo "</TABLE>";
+
+?>
@@ -0,0 +1,189 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.1
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Nov 14, 2001 at 05:04 PM
+# Server version: 3.23.36
+# PHP Version: 4.0.6
+# Database : `moodle`
+# --------------------------------------------------------
+
+#
+# Table structure for table `course`
+#
+
+CREATE TABLE course (
+ id int(10) unsigned NOT NULL auto_increment,
+ category int(10) unsigned NOT NULL default '0',
+ password varchar(50) NOT NULL default '',
+ fullname varchar(254) NOT NULL default '',
+ shortname varchar(15) NOT NULL default '',
+ summary text NOT NULL,
+ format tinyint(4) NOT NULL default '1',
+ teacher varchar(100) NOT NULL default 'Teacher',
+ startdate int(10) unsigned NOT NULL default '0',
+ enddate int(10) unsigned NOT NULL default '0',
+ timemodified int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `course_categories`
+#
+
+CREATE TABLE course_categories (
+ id int(10) unsigned NOT NULL auto_increment,
+ name varchar(255) NOT NULL default '',
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM COMMENT='Course categories';
+# --------------------------------------------------------
+
+#
+# Table structure for table `course_modules`
+#
+
+CREATE TABLE course_modules (
+ id int(10) unsigned NOT NULL auto_increment,
+ course int(10) unsigned NOT NULL default '0',
+ module int(10) unsigned NOT NULL default '0',
+ instance int(10) unsigned NOT NULL default '0',
+ week int(10) unsigned NOT NULL default '0',
+ added int(10) unsigned NOT NULL default '0',
+ deleted tinyint(1) unsigned NOT NULL default '0',
+ score tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `course_weeks`
+#
+
+CREATE TABLE course_weeks (
+ id int(10) unsigned NOT NULL auto_increment,
+ course int(10) unsigned NOT NULL default '0',
+ week int(10) unsigned NOT NULL default '0',
+ summary varchar(255) NOT NULL default '',
+ sequence varchar(255) NOT NULL default '',
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `logs`
+#
+
+CREATE TABLE logs (
+ id int(10) unsigned NOT NULL auto_increment,
+ time int(10) unsigned NOT NULL default '0',
+ user int(10) unsigned NOT NULL default '0',
+ course int(10) unsigned NOT NULL default '0',
+ ip varchar(15) NOT NULL default '',
+ url varchar(200) NOT NULL default '',
+ message varchar(255) NOT NULL default '',
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `modules`
+#
+
+CREATE TABLE modules (
+ id int(10) unsigned NOT NULL auto_increment,
+ name varchar(20) NOT NULL default '',
+ fullname varchar(255) NOT NULL default '',
+ version int(10) NOT NULL default '0',
+ cron int(10) unsigned NOT NULL default '0',
+ lastcron int(10) unsigned NOT NULL default '0',
+ search varchar(255) NOT NULL default '',
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `user`
+#
+
+CREATE TABLE user (
+ id int(10) unsigned NOT NULL auto_increment,
+ confirmed tinyint(1) NOT NULL default '0',
+ username varchar(100) NOT NULL default '',
+ password varchar(32) NOT NULL default '',
+ idnumber varchar(12) default NULL,
+ firstname varchar(20) NOT NULL default '',
+ lastname varchar(20) NOT NULL default '',
+ email varchar(100) NOT NULL default '',
+ icq varchar(15) default NULL,
+ phone1 varchar(20) default NULL,
+ phone2 varchar(20) default NULL,
+ institution varchar(40) default NULL,
+ department varchar(30) default NULL,
+ address varchar(70) default NULL,
+ city varchar(20) default NULL,
+ country char(2) default NULL,
+ firstaccess int(10) unsigned NOT NULL default '0',
+ lastaccess int(10) unsigned NOT NULL default '0',
+ lastlogin int(10) unsigned NOT NULL default '0',
+ currentlogin int(10) unsigned NOT NULL default '0',
+ lastIP varchar(15) default NULL,
+ personality varchar(5) default NULL,
+ picture tinyint(1) default NULL,
+ url varchar(255) default NULL,
+ description text,
+ research tinyint(1) unsigned NOT NULL default '0',
+ forwardmail tinyint(1) unsigned NOT NULL default '0',
+ timemodified int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (id),
+ UNIQUE KEY username (username),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM COMMENT='One record for each person';
+# --------------------------------------------------------
+
+#
+# Table structure for table `user_admins`
+#
+
+CREATE TABLE user_admins (
+ id int(10) unsigned NOT NULL auto_increment,
+ user int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM COMMENT='One record per administrator user';
+# --------------------------------------------------------
+
+#
+# Table structure for table `user_students`
+#
+
+CREATE TABLE user_students (
+ id int(10) unsigned NOT NULL auto_increment,
+ user int(10) unsigned NOT NULL default '0',
+ course int(10) unsigned NOT NULL default '0',
+ start int(10) unsigned NOT NULL default '0',
+ end int(10) unsigned NOT NULL default '0',
+ time int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `user_teachers`
+#
+
+CREATE TABLE user_teachers (
+ id int(10) unsigned NOT NULL auto_increment,
+ user int(10) unsigned NOT NULL default '0',
+ course int(10) unsigned NOT NULL default '0',
+ authority varchar(10) default NULL,
+ PRIMARY KEY (id),
+ UNIQUE KEY id (id)
+) TYPE=MyISAM COMMENT='One record per teacher per course';
+
@@ -0,0 +1,28 @@
+<FORM METHOD="post" action="site.php" NAME="form">
+<TABLE cellpadding=9 cellspacing=0 >
+<tr valign=top>
+ <td><P>Full site name:</td>
+ <td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
+ <? formerr($err["fullname"]) ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>Short name for site (eg single word):</td>
+ <td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
+ <? formerr($err["shortname"]) ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>Front page description:</td>
+ <td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
+ <? formerr($err["summary"]) ?>
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td><input type="submit" value="Update the site"></td>
+</tr>
+</TABLE>
+<INPUT type="hidden" name="id" value="<?=$form->id ?>">
+<INPUT type="hidden" name="category" value="<?=$form->category ?>">
+</FORM>
Oops, something went wrong.

0 comments on commit f9903ed

Please sign in to comment.