Compare commits

...

1900 Commits

Author SHA1 Message Date
moodler 81716d0d33 I'm going to start packaging the release this evening (in about 7 hours).
Any last-minute little bug fixes are very welcome!
2003-05-29 03:22:56 +00:00
moodler 658bf42b26 One new string! :-/ 2003-05-29 03:20:33 +00:00
moodler 3ee8f1715f Added a button on the language page that takes you to the moodle.org
page to download new language packs
2003-05-29 03:20:11 +00:00
moodler 2334e9083c Minor bug fixes 2003-05-29 03:09:37 +00:00
moodler 4a6a574f2a Robustness on finding country name 2003-05-29 03:06:10 +00:00
moodler a205123f06 Fixed page title 2003-05-29 03:02:10 +00:00
moodler a6ee2f5e7d Some minor fixes 2003-05-29 02:36:25 +00:00
moodler 8590fd913d French Canadian translation, based on French, by Jean-Fran?ois Nadeau <JFNadeau@coll-outao.qc.ca> 2003-05-29 02:33:38 +00:00
moodler e7f72d1658 Removed a typo 2003-05-29 02:27:04 +00:00
stronk7 64eed73fa2 Changed bahabior when restoring into a existing course
(don't create sections and assign to section 0 if original
section doesn't exist). Everything is saved in backup_ids
to use it when restoring modules.
2003-05-28 23:41:56 +00:00
stronk7 381ae36075 User files and course files are now working !! 2003-05-28 19:48:10 +00:00
stronk7 1bdeb2ca8e Implemented copying course_files and user_files. 2003-05-28 19:43:11 +00:00
stronk7 8af2a809fb Little modification to show course's full name and short name too. 2003-05-28 18:18:45 +00:00
coolbit 5d224d17b6 Added workshop help files. 2003-05-28 14:37:34 +00:00
coolbit f001154b33 *** empty log message *** 2003-05-28 14:21:10 +00:00
koenr bca7452938 Translated by Koen Roggemans 2003-05-28 12:42:58 +00:00
moodler b366308091 Just about there ... 2003-05-28 08:01:15 +00:00
moodler f38485140c Fixed a bug 2003-05-28 07:43:51 +00:00
moodler 258be26525 Updated translation from Stig Bjarne Haugen (Stig.B.Haugen@hinesna.no) 2003-05-28 07:42:54 +00:00
moodler 5f4c712ea8 Updated translation for 1.0.9 from Emmanuelle Gutierrez y Restrepo (emmanuelle@sidar.org) 2003-05-28 07:16:41 +00:00
moodler 6d9aa82c99 New file 2003-05-28 06:43:25 +00:00
moodler 4c5686d97f Complete 1.0.9, from Claudio Tavares (claudio@enlaceacademico.com) 2003-05-28 06:42:26 +00:00
stronk7 d688c342ad Begin restoring user files. 2003-05-27 22:37:05 +00:00
stronk7 3f676beac0 Finished restoring users.
Now, if selected, restore user files (in progress).
2003-05-27 22:34:29 +00:00
mits 978962c8bb Broken character fixed. 2003-05-27 21:41:41 +00:00
mits 87cc153beb New translation added. 2003-05-27 21:36:05 +00:00
moodler 7647e09126 Fix the version in case I forget later 2003-05-27 16:53:16 +00:00
moodler 0fcd21c3bc Updated the year 2003-05-27 15:21:14 +00:00
moodler b09069a4c7 Various updates, rewrites etc
Overall I'm trying to remove the Martin focus and make it more neutral.

More to go.
2003-05-27 15:18:20 +00:00
mits 576fd161a0 Mod 2003-05-27 14:57:05 +00:00
moodler 16cba4cf88 Latest changes from Howard Miller 2003-05-27 14:25:15 +00:00
moodler fc55b4e900 Latest changes from Howard 2003-05-27 14:24:06 +00:00
moodler ab8c78b03a Getting close now 2003-05-27 03:39:03 +00:00
moodler ba6c4a8701 Fixed a typo (thanks Mits!) 2003-05-27 02:14:44 +00:00
moodler 6337086aca New file 2003-05-27 01:53:52 +00:00
moodler 111bfff48a Latest files from Wim! 2003-05-27 01:52:48 +00:00
koenr 31d7714a84 More strings translated, based on the job by Hans De Zwart. Changed upgeload by ge?pload 2003-05-26 21:54:24 +00:00
koenr 68225f50b4 no message 2003-05-26 21:52:09 +00:00
mits b9f0af5fb0 Polished 2003-05-26 17:49:37 +00:00
mits 7fe2220fc0 New translation. 2003-05-26 17:42:50 +00:00
mits a26d994d2b New translation and Polish 2003-05-26 17:24:37 +00:00
mits e7d1f700d9 New translation. 2003-05-26 16:45:28 +00:00
mits 9fc3e0ebef Polished. 2003-05-26 16:37:12 +00:00
mits cee7b95a10 Polished. 2003-05-26 16:29:06 +00:00
minkowski f933b27c32 revised and rephrased for 1.09 2003-05-26 16:28:05 +00:00
moodler 16ba73512e Slight improvements to import of global variables
- don't globalise cookies
  - better checking of lang variables
2003-05-26 15:38:52 +00:00
mits 84a8415baf *** empty log message *** 2003-05-26 15:32:16 +00:00
mits f6590fb484 Polished 2003-05-26 15:28:57 +00:00
moodler 3662bce5b4 A few tweaks for robustness. 2003-05-26 14:43:19 +00:00
moodler 1dd2451954 Some minor cleanups and debugging of initial setup 2003-05-26 14:38:41 +00:00
moodler 8d2accb64c More robust check of argument 2003-05-26 07:54:53 +00:00
moodler 02e44e7cf4 Print better loggedin info at the top of the page 2003-05-26 07:54:34 +00:00
moodler 8df45f47bd FIxed all moodle.com links 2003-05-26 07:07:53 +00:00
moodler 399266ce40 Removed the non-breaking space &nbsp; from the section summaries because
it would cause problems when the summary ended in a URL
2003-05-26 06:58:10 +00:00
koenr 03fa434bb3 New strings translated, based on the translation by Hans De Zwart 2003-05-26 06:14:42 +00:00
moodler 644f6213f1 Removed funny line feeds? Hope so. 2003-05-26 02:44:29 +00:00
moodler 8fad496688 Still trying to get this retun situation sorted out 2003-05-26 02:42:49 +00:00
moodler c451c1f6bd Removed mystery character? 2003-05-26 02:40:26 +00:00
moodler c8ddb345b9 DOS format 2003-05-26 02:32:11 +00:00
moodler 05c7ec6f2b Trying to force DOS format 2003-05-26 02:20:39 +00:00
moodler f7a6049e57 Checking in the include error code in again, with improvements
The problems I thought were happening were in fact another problem
on someone's installation (missing files).  This code now checks
for that too.
2003-05-26 01:54:11 +00:00
mits ff27a09eca Polished. 2003-05-26 01:39:21 +00:00
mits a166e72e43 New translation. 2003-05-26 01:38:29 +00:00
stronk7 4848d55a9e Few changes to gather info to show in restore progress
(various user counts (existing, new,...)
2003-05-26 00:07:56 +00:00
stronk7 0be7c25ebe Minor bug creating newid when restorinf users 2003-05-25 23:37:07 +00:00
stronk7 2f6c832d5c Included User restore. Hard work !!! 2003-05-25 23:02:09 +00:00
stronk7 a2c7397c42 Restore into new course and existing course implemented.
Restore sections and mod implemented.
Restore users (all, course and none) implemented
2003-05-25 22:58:13 +00:00
mits 4565e9cc0a New translation. 2003-05-25 22:02:50 +00:00
mits b1106eb5ba Polished 2003-05-25 21:58:22 +00:00
koenr 5f6604b578 no message 2003-05-25 21:52:13 +00:00
koenr 018dcb996d Thanks to Kris Gonnissen and Gerd Cornelissen for help and review 2003-05-25 21:49:49 +00:00
mits 131f438648 Polished. 2003-05-25 21:45:19 +00:00
mits bbc2e4226a Polished and New translation added. 2003-05-25 21:32:09 +00:00
palojacko ab34a057ed improved menu translation 2003-05-25 19:53:40 +00:00
mits 092c819e68 Character breaking fixed. 2003-05-25 18:37:57 +00:00
mits 20598e0da3 New translation. 2003-05-25 18:34:25 +00:00
mits 06e9af99e7 New translation 2003-05-25 18:19:54 +00:00
mits df415fbf08 *** empty log message *** 2003-05-25 17:45:41 +00:00
mits 8bcabc74e2 New translation file. 2003-05-25 17:43:53 +00:00
mits 57bcdda9f5 New translation 2003-05-25 16:58:09 +00:00
mits d03e4db1b8 New translation. 2003-05-25 16:02:48 +00:00
mits 8a600d7d1d New translation. 2003-05-25 15:24:30 +00:00
moodler 3926deafe1 Removed three lines - this fixes the path problems occurring when
extracting files in Moodle on Windows platforms.

This should not affect normal use within Moodle on other platforms.
2003-05-25 12:46:17 +00:00
moodler c4ad9158e3 More robust check for $CFG->backup_version 2003-05-25 12:14:15 +00:00
moodler aa140aabfd Going back to old method, as the new one seems to have problems on some
platforms.
2003-05-25 12:11:10 +00:00
stronk7 0535cadae5 Included new "autosubscribe" fiel in users backup 2003-05-25 09:31:17 +00:00
coolbit a5eb9f335f *** empty log message *** 2003-05-25 01:26:48 +00:00
coolbit b391b14bda *** empty log message *** 2003-05-24 16:55:18 +00:00
coolbit 09026b19d9 add forum helps 2003-05-24 16:49:36 +00:00
coolbit 893e0c5c0b add shufflequestions.html 2003-05-24 15:52:02 +00:00
coolbit eefa6d6e06 add some help files. 2003-05-24 15:39:58 +00:00
mits 3c382acc28 New translation 2003-05-24 11:51:01 +00:00
mits bf442dc9d6 Polished 2003-05-24 11:40:23 +00:00
mits 0c59a23c67 text-decoration: underline problem fixed.
copy theme->standard->styles.php to theme->oceanblue->styles.php and
changed a:link, a:visited, a:hover
2003-05-24 11:30:58 +00:00
mits 7a6112792c Polished and New translation added. 2003-05-24 11:06:19 +00:00
stronk7 6a602d47e0 hanged info field in backp_ids to store text data
(used when restoring long portions of data)
2003-05-24 09:23:41 +00:00
stronk7 5881bb7e3c Changed info field in backp_ids to store text data
(used when restoring long portions of data9
2003-05-24 09:23:05 +00:00
moodler 40343df7fd Users were able to see their own user activity reports. This was a hang-over
from long time ago.  As there is no GUI for this, I'm removing it for now so
that students are not able to see their own activity reports.

This issue probably needs to be discussed, and a GUI developed for it.
2003-05-24 07:33:22 +00:00
moodler 783da26290 A bit of an audit and a clean up of require_login to add consistency.
No major problems found, just some code tidy-up
2003-05-24 07:29:17 +00:00
moodler 73fafc3886 Bad bug fixed. Non-teachers could hide/show whole sections. 2003-05-24 06:59:36 +00:00
moodler 522f608d02 Important bug fixed! Non-teachers could modify course! 2003-05-24 06:53:47 +00:00
moodler 12c55f3cd4 Fixed a few obviouos errors and excess blank lines in the language packs 2003-05-24 05:22:05 +00:00
moodler bb515027b5 The single quotes caused problem on the rare occasions that these
unset strings were being written to the database
2003-05-24 02:34:29 +00:00
moodler fe3b0f3a2f New string 2003-05-24 02:32:26 +00:00
moodler 5c0567b4cd Don't allow password changing if the user isn't confirmed yet 2003-05-24 02:25:57 +00:00
stronk7 8fdd5ab2b3 Advance a bit more.
Course, course_sections and course_modules finished.
We have to update instance (in course_modules) and modinfo
(in course) at the end of the restore. We haven't the necessary
info now.
2003-05-24 00:34:27 +00:00
stronk7 7ba7461530 Finished restoring course, course_sections and course_modules.
When ending the restore process, we've to update the instance
field of course_modules and the modinfo field of course. Now
we haven´t the necessary info to do that.
2003-05-24 00:27:45 +00:00
stronk7 47e9035598 In course_modules export the field ADDED too. 2003-05-24 00:23:35 +00:00
mits 7134ebc80b *** empty log message *** 2003-05-23 23:04:04 +00:00
mits feffd1dffe New translation 2003-05-23 22:58:24 +00:00
mits 0aa35815c4 Polished. 2003-05-23 22:47:35 +00:00
mits f897f346a3 New translation. 2003-05-23 22:18:11 +00:00
mits ac722cc42b *** empty log message *** 2003-05-23 21:58:30 +00:00
moodler 219633ea2b organised --> organized 2003-05-23 15:21:32 +00:00
moodler 5325f8b8cf A little more guidance on the quiz page. 2003-05-23 15:20:41 +00:00
moodler b39cadbfe7 Formatting fixes from Windows editor 2003-05-23 14:41:22 +00:00
moodler 020181047d Some hacks to stop the addition of blank lines on Windows machines during editing in the web forms. 2003-05-23 14:25:55 +00:00
moodler a3152e449d Fixed excess blanks using new admin/lang.php 2003-05-23 14:24:48 +00:00
coolbit 02997ce175 complete workshop.php 2003-05-23 13:37:03 +00:00
uermelin 499c23e8fc fullname changed from nachname to Bezeichnung 2003-05-23 09:09:51 +00:00
moodler d8e2e28044 Added a check to make sure CFG->dirroot is correct. 2003-05-23 08:54:36 +00:00
moodler 1cb2266ef7 Tweaking subscribe strings 2003-05-23 05:46:07 +00:00
moodler 40e5eb1b33 Slight rewording 2003-05-23 05:42:46 +00:00
moodler 7f2a3e678e New field for user: autosubscribe
This sets the default value for on-the-fly forum subscription.
Defaults to on = subscribe.

(Also fixed a bug in postgres7.sql - a missing field for htmleditor!)
2003-05-23 05:32:40 +00:00
moodler 4b2b7a7110 Full formatting looks bad (too much whitespace) but smilies are OK 2003-05-23 05:05:49 +00:00
moodler 6687be174a Improvements to the wordings for subscription 2003-05-23 05:00:58 +00:00
moodler f5ca7ebe1a Display forum intros as formatted text 2003-05-23 04:51:28 +00:00
stronk7 f698f3f394 Finished restore frontend. 2003-05-22 22:59:21 +00:00
stronk7 6157b82c7b none 2003-05-22 22:12:32 +00:00
stronk7 7c934d06ed Finished the check phase.
Tomorrow I'll start recovering course info !!
2003-05-22 22:11:17 +00:00
koenr b088919164 New strings translated. Workshop.php = new file => not complete yet 2003-05-22 20:45:12 +00:00
koenr 849f614bd1 no message 2003-05-22 19:57:56 +00:00
thepurpleblob dec96d4f2c Added question/answer formatting to wiki help 2003-05-22 10:52:26 +00:00
thepurpleblob b2878fc5ae Fixed problem with list lines not being formatted
Added CVS hooks for <hr> and Question/Answer (Q. and A.) lines
2003-05-22 10:41:40 +00:00
coolbit ab48c1bb53 *** empty log message *** 2003-05-21 17:07:57 +00:00
bobopinna ec3db5a310 New updates from Roberto Pinna 2003-05-21 15:26:28 +00:00
bobopinna 31861ff29c *** empty log message *** 2003-05-21 15:08:45 +00:00
moodler 7a1205eea9 Changed instructions for Windows to Tortoise CVS 2003-05-21 13:52:07 +00:00
moodler 70d9c95acf New updates from Roberto Pinna 2003-05-21 12:56:34 +00:00
moodler 0e3e960a33 New file for debugging purposes, simply shows phpinfo() 2003-05-21 09:50:17 +00:00
moodler d805c3462e Removed the remote debugging functions.
I used to find these quite useful for helping people debug
configuration problems. I don't think they present a security
problem, but I can see there is the possibility that it can
be PERCEIVED as an issue, and I don't want to be responsible
for that, nor blamed for any break-ins (warranty or not).

So I'll find another way to do remote debugging.
2003-05-21 09:39:51 +00:00
moodler c3219da409 Much improved favicons (transparent and more consistent)
submitted by jdell (bug 442).
2003-05-21 08:48:18 +00:00
moodler c7ba7904cb Ray prefers icon3.gif 2003-05-21 08:13:08 +00:00
moodler be23a53ca9 Some fixes, after some testing 2003-05-21 06:10:43 +00:00
moodler 79da6d8717 Change to parsing to allow answers in any order - needs testing 2003-05-21 05:00:44 +00:00
mits 931ade40e3 New translation 2003-05-20 21:43:15 +00:00
paca70 f64fb7b192 Updates from Teemu Sumi. Thanks again! 2003-05-20 17:27:25 +00:00
moodler 353d033843 get_course_users now calls get_site_users if the course is a site.
There is something wrong with this SQL still though ... it mostly works
but I'm still getting wierd behaviour with small numbers of users.

Need some help here ...  for example just look at get_site_users()
on your test site.

It's supposed to return a list of users who are admins, creators,
teachers or students
2003-05-20 09:33:30 +00:00
moodler 35d606e6fa Just incrementing 2003-05-20 08:17:45 +00:00
moodler 11697b48ea Minor code cleanups
- lowercasing
  - removing short php tags
  - adding some emoticon help here and there
2003-05-20 08:03:12 +00:00
moodler 60ffb53a7d Minor code cleanup 2003-05-20 08:01:40 +00:00
moodler b5987b0f49 Added missing style - .forumpostheadertopic 2003-05-20 06:17:06 +00:00
moodler b1f505771e Fixed the bug I introduced in the last checkin (it was related to the
re-introduction of text fields in surveys)   See bug 441
2003-05-20 04:26:57 +00:00
stronk7 91d7f813e5 Initial checks. More to do !! 2003-05-19 22:34:12 +00:00
stronk7 304d7785ca Now all the required variables are set to call restore_check.html 2003-05-19 22:33:45 +00:00
stronk7 7e092fdaed Now call restore_check.html too. 2003-05-19 22:28:39 +00:00
stronk7 3f50cab58d Checks everything is OK before lanunch the process. It allows to
select the destination course.
Initial version, it doesn't work !!
2003-05-19 19:29:51 +00:00
stronk7 8d5b052f35 Now, one more step. Call to restore_check.html 2003-05-19 19:28:14 +00:00
paca70 844bad05a9 Updates. Thanks to Teemu Sumi. 2003-05-19 17:32:45 +00:00
moodler ad03ae446e Many corrections ... more needed 2003-05-19 15:34:27 +00:00
moodler 043b94f66d Glossary file from John Captain 2003-05-19 15:08:42 +00:00
moodler b95c3ab896 Add slashes to data when setting up guest account 2003-05-19 13:14:29 +00:00
moodler 779a4a8da4 Fixed up some of the headers during installation (remove logout links). 2003-05-19 13:12:27 +00:00
moodler 54242af0d6 Changed default strings to use single-quotes and avoid possible slash problems 2003-05-19 07:41:12 +00:00
moodler e9564a5a80 Fixed previous over-zealous lowercasing 2003-05-19 06:11:56 +00:00
moodler 240aca4b34 missing closing php tag 2003-05-19 04:55:11 +00:00
moodler 5d0f5a599b Removing strings make no worky worky 2003-05-19 03:34:57 +00:00
moodler 3ee236820a Some fixes for check_gd_version -- please test this for me on every server you have! 2003-05-19 03:27:13 +00:00
moodler 17ec8eb684 Remove unnecessary check (from a lazy copy/paste) 2003-05-19 03:03:34 +00:00
moodler 8c5b0c41bb Updated docs to use php_flag instead of php_value for booleans 2003-05-19 02:31:14 +00:00
moodler 730cb6bac3 Updated docs about using php_flag settings instead of php_value 2003-05-19 02:28:47 +00:00
moodler 6a6681294a Should use php_flag, not php_value, for boolean settings!!
See bug 429
2003-05-19 02:25:11 +00:00
stronk7 96376e9a4f Finalized. Form data is displayed dinamically, depending of
every mod features and the backup file-contents.
2003-05-18 22:57:23 +00:00
stronk7 96112b5224 Initial version. Does nothing !!, but needed to show info in
restore_form.php
2003-05-18 22:55:54 +00:00
stronk7 f2deadb30c Control when cancel has been selected. Inform and finalize. 2003-05-18 22:53:11 +00:00
stronk7 87d8623181 One more string to restore. Forget it in previous commit. ;-) 2003-05-18 22:51:52 +00:00
stronk7 4c94c21b11 Some restore strings... 2003-05-18 21:43:55 +00:00
stronk7 fd2f02d4cd Initial version. Form to select where and what to restore. 2003-05-18 21:41:08 +00:00
paca70 775f689b0f Some additions for postgresql 2003-05-18 18:23:07 +00:00
stronk7 c563a9a0d1 added check login, check admin and check site to every page.
If not, it was possible to execute them...!!
2003-05-18 17:15:05 +00:00
stronk7 cc7fa0dc05 Added a 4th OPTIONAL (default "get") parameter to
"print_single_button" function. Now can make "post"
forms too.
2003-05-18 16:41:23 +00:00
stronk7 729035fdaa Advance a bit more... 2003-05-18 15:54:01 +00:00
stronk7 76bf541df8 Course Header and Backup info is showed now !!
I'll start using sessions to mange all this data.
2003-05-18 15:51:20 +00:00
moodler 41a03b45f0 Added a stub for workshop_get_submission to stop errors on activity reports 2003-05-18 14:38:12 +00:00
moodler d41947c6be Some alternative icons for the workshop module!
Any comments, votes?
2003-05-18 09:28:42 +00:00
moodler c525b27592 Strip tags from page title, and some minor code cleanups 2003-05-18 06:05:23 +00:00
moodler 713386aadb Left out a field! mailformat 2003-05-18 02:36:02 +00:00
stronk7 fd43f7d026 Now course header is retrieved too !! 2003-05-17 17:34:30 +00:00
stronk7 48cbf566bb XML generation. Included the main course data under a HEADER tag.
Needed for recover.
2003-05-17 15:58:24 +00:00
moodler cd86c938b2 Some updates from Koen Roggemans 2003-05-17 12:44:28 +00:00
stronk7 ca2129424f Reading more info... 2003-05-17 11:40:27 +00:00
stronk7 a4ad03f175 Debug a bit 2003-05-17 08:56:53 +00:00
moodler 8b50d2a76e Some fixes to make choice reports work better when used at site level.
PLus some HTML lowercasing
2003-05-17 06:17:10 +00:00
moodler 06cffaf0bb No need to get all the user data for forum_subscribed_users 2003-05-17 06:13:38 +00:00
moodler bbf9b1624d Improved get_site_users a bit for efficiency 2003-05-17 06:10:20 +00:00
moodler 2563c5ef7b Improvements to trustworthiness of the registry form (for suspicious admins!)
Hashed password is no longer sent as a key, "secret" field is used instead.

HTML code is now more readable for the View Source crowd.  :-)
2003-05-17 05:34:49 +00:00
moodler 6879123761 This seems to help too. 2003-05-17 05:06:08 +00:00
moodler eab79dc13d Hopefully this will fix the logout problems - it now specifically
checks for PHP 4.3.0 or later, and also does the unset anyway.

Sessions are not consistent in PHP versions.
2003-05-17 04:45:52 +00:00
moodler 958facf055 Better cleanup of site description meta tag 2003-05-17 03:46:31 +00:00
moodler 14159d0960 Post beta 1 stage 2003-05-17 03:16:30 +00:00
moodler 07b586eaa3 Use global variable for phpinfo debugging info 2003-05-17 03:10:22 +00:00
moodler 7170501293 Better detection of register_globals 2003-05-17 03:05:39 +00:00
moodler 4d01ada343 More on Bug 427_ on second thoughts it's better this way, now at least
the true/false entries get updated every time the question is updated.
2003-05-17 03:02:59 +00:00
moodler a6ccb416f1 This should fix the non-translatability of true/false questions bug 427 2003-05-17 02:54:20 +00:00
moodler fcb12a1e0c Every line had three blank lines after it - please be careful Ursula 2003-05-17 02:31:31 +00:00
moodler c39c66a5e8 Using new ini_get_bool function to work around a bug with ini_get where
the result is different for items set in htaccess
2003-05-17 02:05:10 +00:00
stronk7 785ae439eb Begin parsing xml data.
Info tags.
2003-05-16 23:57:35 +00:00
stronk7 d348c53f1f Simple advance. None to do in DB. 2003-05-16 22:05:50 +00:00
stronk7 880fd2146c Updated. Some preliminary steps about restoring done. 2003-05-16 22:04:06 +00:00
stronk7 b9846a9b9e Copy, expand and do preliminary checks from backup file 2003-05-16 21:52:49 +00:00
stronk7 7641819df0 Moved the check_version code to lib.php
Formatted portions of code
2003-05-16 21:51:07 +00:00
stronk7 740aa005dc Interchange delete old data and create temp structures. The first time
an error ocurred, because we were trying to access an no-existent dir.
2003-05-16 17:36:47 +00:00
mits c061b8d2a5 New translation added. 2003-05-16 12:01:41 +00:00
mits 9ba291e88d Polished and New translation added. 2003-05-16 11:19:26 +00:00
uermelin 67d5ab6dc1 Licenz changed to Lizenz 2003-05-16 11:07:58 +00:00
uermelin 05c1cfba93 changed filloutthreequestions, savemyAnswers, marks 2003-05-16 11:06:32 +00:00
uermelin 71f64e123b bug in emailpasswordsent removed 2003-05-16 09:57:21 +00:00
moodler bf2919bf84 Some stuff about workshop 2003-05-16 08:53:22 +00:00
moodler 30739c3daf Added registration info 2003-05-16 08:51:10 +00:00
moodler bfe42924da Latest tags for vi etc 2003-05-16 07:04:09 +00:00
moodler 67fb6d3aaf Added a missing string 2003-05-16 06:40:46 +00:00
moodler 69ec0a8b1d Moved info about automatic unenrolling to the top where it makes more sense
I think.
2003-05-16 06:27:23 +00:00
moodler 5c219ea46d Added hyphen (-) to the list of allowed characters in a filename 2003-05-16 06:08:42 +00:00
moodler 60a60432a1 Explicit casting to (bool) may help 4.2.3 2003-05-16 04:47:40 +00:00
moodler 3a4c2fd089 I knew there was something else I'd forgotten!
Added a check to all modules (well view.php anyway) to check whether a
module is hidden or not.  If it is, then students get a message.
2003-05-15 18:03:22 +00:00
moodler 610603be4d More tweaks 2003-05-15 17:31:56 +00:00
moodler 7adf67875d Some notices to remind people about things they need to do. 2003-05-15 17:26:59 +00:00
moodler cf565fd7cf OK, this is pretty much time to call it 1.0.9 Beta 1 ... I'm going to
do a few last checks then tag it as "Moodle_109_B1" and package it all up.
2003-05-15 17:16:15 +00:00
moodler 33de9f7bdc FIxed bug where questions weren't being shown in reviews. 2003-05-15 17:01:35 +00:00
moodler 17df1ae4bd Obsolete 2003-05-15 16:17:37 +00:00
moodler 455d308f5d Some updates 2003-05-15 16:16:53 +00:00
moodler ae384ef160 New configuration variable: secureforms (defaults to 'true')
Replaces the old $CFG->buggy_referer (reverses it, in fact) and can
now be set in the configuration page (no need for it in config.php).
2003-05-15 15:59:52 +00:00
moodler 6bebcf8d72 Some minor cleanups, nothing functional, just code-level niceness mostly.
- xhtml cleanups, mostly from Peter Bazira
   - removed all short php tags
2003-05-15 14:34:48 +00:00
moodler c6a0f9d5bf Minor touch-ups to the front page HTML 2003-05-15 14:02:13 +00:00
moodler e48feed988 Many little clean-ups for themes.
- Got rid of obvious non-XHTML code in headers and footers.
  - Got rid of all the PHP short tags
  - Added new styles for the headers
2003-05-15 13:55:22 +00:00
mits 3e54b808bc Polished. 2003-05-15 13:15:44 +00:00
mits 0817d5cac0 New translation. 2003-05-15 13:14:40 +00:00
moodler ce729f49c8 New override for Apache's LimitRequestBody parameter which may limit files. 2003-05-15 11:15:55 +00:00
stronk7 0f192e2cd6 Initial version of restore. Simply, a copy from backup.php 2003-05-14 23:25:00 +00:00
stronk7 01a16f7e5e Lib to include all backup particulary functions (came from lib.php), but
desglosed now
2003-05-14 23:24:00 +00:00
stronk7 5aca97a20a Reset to empty lib before start developing 2003-05-14 23:22:50 +00:00
stronk7 476fd9c716 Minor changes to support the "restore" option with zip files. Only
showed if the backup utility is installed ($CFG->backup_version exists)
and the user is an admin. Sent email to Martin to say him this !!
2003-05-14 23:09:34 +00:00
stronk7 52376d940f Now backuplib.php includes all the functions needed in backup, restorelib.php all
the functions needed in restore and lib.php the rest of common functions.
2003-05-14 22:09:30 +00:00
moodler d288fa5255 Better code to deal with shuffleorder.
Now feedback is always in the same order as the quiz, and
reports are always in the natural order.
2003-05-14 16:52:25 +00:00
moodler a53cef7e80 Removed obsolete get_users_search function 2003-05-14 16:29:26 +00:00
moodler d8eece23c9 Revamped "Assign Creators" page with the same code as admins and teachers 2003-05-14 16:27:27 +00:00
moodler 46a244605d Some little fixes (can only see them on a server with lots of users!) 2003-05-14 16:05:21 +00:00
moodler e808d25f56 Fixed up "Assign teacher" page, and moved it to admin directory. 2003-05-14 15:58:48 +00:00
moodler ada728e24d Fix the order of questions when shuffle is NOT being used.
See bug 423 for details: http://moodle.org/bugs/bug.php?op=show&bugid=423
2003-05-14 15:23:54 +00:00
moodler 5a74165523 FIxed up function get_user() which now takes lots of parameters and
can be used all over the place.

Also, related fixes to "add admin" (MUCH better performance) and the user listings

More to come for "add teacher" and "add creator"
2003-05-14 15:19:04 +00:00
moodler 9a2efc9fb0 Don't be so pushy about subscription 2003-05-14 07:47:04 +00:00
moodler 76c1650d02 Changed home page link to moodle.org (from moodle.com)
I did some heavy thinking about this, and I think this is
best for the community.  I had wanted to drive some traffic
past moodle.com (the moodle.com will feature very prominent
links to moodle.org).  What I'll do now, I think, is put a
advertisements on http://moodle.org pointing to moodle.com.

Also some lowercasing of HTML.
2003-05-14 05:01:01 +00:00
moodler b086c2b527 Fixed variable name 2003-05-14 03:37:47 +00:00
moodler edea91f37b Fixed links in emails 2003-05-14 03:23:01 +00:00
moodler b13f7b84ec New Taiwanese (Traditional Chinese) version by Fu-Kwun Hwang (hwang@phy.ntnu.edu.tw)!
Strings mostly done, and about half the help files.
2003-05-14 02:43:27 +00:00
adamtpaw ce3b1d1f7d small corrections 2003-05-13 21:14:28 +00:00
stronk7 4f446b2e36 Minor changes in course_files_check_backup to avoid the backup
of files under get_string("backupdir")
2003-05-13 19:53:17 +00:00
mits 21951923a5 New translation. 2003-05-13 17:00:00 +00:00
rkingdon 16a0e6f05c Addition of teacher admin features 2003-05-13 16:37:47 +00:00
moodler e9d3eca323 Re-order list for consistency 2003-05-13 16:37:34 +00:00
rkingdon 72a2547d05 Some missing strings added; plus strings for admin 2003-05-13 16:33:34 +00:00
rkingdon daec2fede2 Minor change to wording 2003-05-13 16:29:54 +00:00
moodler ae078a9809 Mail-outs for assignment and journal module are now translatable. 2003-05-13 16:02:08 +00:00
moodler 0a9f61b55f When posting a forum, users can unsubscribe/subscribe on the fly.
The flag has a memory, but it keeps pushing you to subscribe.  :-)
(so that by default it behaves like it did before)

Hopefully now subscription is a bit easier to understand.
2003-05-13 13:53:36 +00:00
moodler ac4f6d455f Images are not put in a frame, but embedded in a normal page 2003-05-13 07:51:26 +00:00
moodler fa6a30b75c Added release and version information to registration 2003-05-13 07:35:18 +00:00
moodler 4bcc7ebfd6 Slight update to a string 2003-05-13 01:18:54 +00:00
rkingdon 56a800aac5 Correcting bugs in agreement of assessment and for self assessed
submissions
2003-05-12 21:18:21 +00:00
coolbit 6cdbd5d52a some modification 2003-05-12 15:53:08 +00:00
moodler 64900c048e If you can see this - please try the new admin registration interface! 2003-05-12 15:40:11 +00:00
moodler fe930cf3ca New feature - registration page. Registration should be working,
but I'm still working on the server-side stuff.

Look for the new button on the admin page.
2003-05-12 11:30:19 +00:00
moodler a0deb5db60 Add a backdoor for match_referer ... if the referer is "nomatch" then
it always returns true.
2003-05-12 09:22:00 +00:00
moodler 6a7ce0c1ab Some new strings for the registration function 2003-05-12 09:05:43 +00:00
moodler 170a9c4612 Force subscription on a teacher's forum only includes teachers! 2003-05-12 09:01:23 +00:00
moodler 393c9b4ff4 Fixes for detect_munged_arguments() and default values for p() s() etc 2003-05-12 06:35:32 +00:00
moodler 3551966092 Added new FAQ and fixed the TOC a bit 2003-05-12 05:49:06 +00:00
stronk7 f11d6df519 Survey backup included. 2003-05-11 22:44:40 +00:00
stronk7 af478c0b2b Avoid counting files under get_string("backupdir") as course files 2003-05-11 22:17:56 +00:00
stronk7 9025fec405 Choices are now backupables 2003-05-11 21:14:50 +00:00
stronk7 05b2871dfa Change in comment 2003-05-11 21:13:45 +00:00
stronk7 d06863d95f No it's backupable too 2003-05-11 21:12:28 +00:00
stronk7 df52003fb1 Little bug ending submission tag 2003-05-11 19:47:12 +00:00
stronk7 14014fb7e1 Some backup words... 2003-05-11 17:46:55 +00:00
stronk7 4784696533 Backup finished.
Limitations:
   - Only assignment and resource mods are exported.
Little problems persit:
   - PCLZIP/UNZIP incompatibility
   - Do not count backup files in course_files_check_backup
2003-05-11 17:45:56 +00:00
stronk7 b294bc4b1d Zipping files.
Ok under command line. Bad under pcl lib
2003-05-11 11:06:23 +00:00
stronk7 543009a54d Updated. User and course files copied to backup dir 2003-05-11 00:16:32 +00:00
stronk7 667d2f2a86 User files and course files are saved selectively to backup directory 2003-05-11 00:14:11 +00:00
stronk7 23e3e468aa no comments 2003-05-10 17:49:56 +00:00
stronk7 d0ef834745 Preparing the user_files and course_files copy 2003-05-10 17:44:08 +00:00
stronk7 4f6ae69e0e Bug returning status 2003-05-10 17:31:33 +00:00
stronk7 efead3b909 Now generate mod info about assignments (with file copy to temp/backup)
and resources.
2003-05-10 17:25:20 +00:00
moodler 2f518143de Tidy up of a code - took out all the short PHP tags 2003-05-10 09:36:57 +00:00
moodler be912538fa Tidy up of code, including removal of short php tags 2003-05-10 09:29:53 +00:00
moodler 232d36dffa Some minor cleanups to this page, including removal of short php tags 2003-05-10 09:21:02 +00:00
moodler 215e628dcf Removed some debug statements I'd left in by mistake 2003-05-10 03:02:19 +00:00
stronk7 32ad57746b Avoid undefined backupable mods to be exported 2003-05-09 23:21:55 +00:00
adamtpaw 54157606e0 Few mistakes rem?ved. 2003-05-09 22:37:08 +00:00
rkingdon a3a4cd3ed6 Corrected bug in SQL for workshop_comments table 2003-05-09 22:13:03 +00:00
stronk7 537718f85a Included log generation to XML 2003-05-09 20:05:15 +00:00
moodler 9d85990f62 Some additions 2003-05-09 17:48:31 +00:00
moodler 6d3566f8d5 Black M 2003-05-09 17:43:46 +00:00
moodler 5867bfb50e New feature to manage installed code modules!
You can now hide/show individual activity modules and even delete them completely!

For example, if you hide the "choice" module, then all choice activities
will be hidden throughout the whole site, and "Choice" will not
appear on any "Add..." menu.

Deleting a module is a complete deletion of all data from the database.

If you want to try out the deletion on a real module, I suggest the
pgassignment module, since it will soon be deleted from CVS anyway
(because it's being replaced with workshop).

Look for "Manage modules" on the admin menu.
2003-05-09 17:24:17 +00:00
stronk7 cfb9c52577 User accounts are now included in XML generation 2003-05-09 14:57:41 +00:00
moodler 7e6b0b3b6e Added new 'visible' field for module management. 2003-05-09 13:32:27 +00:00
moodler 767141c19e Latest updates from Hans De Zwart 2003-05-09 12:47:56 +00:00
moodler 92ce3481fc Please don't put English docs in non-English packs ... they are changing
rapidly so these just go out of date for no reason.

Cheers,
Martin
2003-05-09 12:41:20 +00:00
compuproggy de1a5345cb Who is interested working in a free general open source translating network? Mails to
HS@interS4S,net
2003-05-09 07:18:14 +00:00
compuproggy d6be31eeed *** empty log message *** 2003-05-09 07:10:26 +00:00
moodler 6afe855886 Better tooltip help on post attachments 2003-05-09 06:03:47 +00:00
compuproggy 98a792faaf *** empty log message *** 2003-05-09 05:58:22 +00:00
moodler bbc0d9abbf IMPORTANT SECURITY FIX: prevents external PHP code from being run 2003-05-09 02:32:43 +00:00
moodler 9f71c9e713 Use the new $CFG->dbpersist variable in config.php to determine whether
to use persistent connections or not.  The default is to use them (for
speed/efficiency) but now they can be switched off with:

$CFG->dbpersist = false;
2003-05-09 02:20:03 +00:00
moodler 6c8e8b5ed4 IMPORTANT SECURITY FIX: this prevents bad characters being passed to help.php 2003-05-09 02:05:16 +00:00
moodler 3d9f0f81d6 IMPORTANT SECURITY FIX - this makes sure $CFG can not be overridden 2003-05-09 02:02:27 +00:00
rkingdon 9b09f7d0cd workshop: addition of peer agreement 2003-05-08 20:31:05 +00:00
rkingdon 319b375ecc workshop: add peer agreement 2003-05-08 20:26:51 +00:00
rkingdon 5c2ba38c45 version 1.1 with peer agreement 2003-05-08 20:24:41 +00:00
moodler 5f94c13b6b New version of Wiki stuff from Howard Miller.
Some cool new features, including linking to Moodle activities!
2003-05-08 16:20:38 +00:00
moodler e825f27967 New pop-up help page about smileys - clicking on the smiley inserts it
into the form using Javascript!

Also rationalised and patched some of the other help about text formats.

LANGUAGE EDITORS MAY WANT TO RE-CHECK:

   lang/en/help/textformat.html
2003-05-08 16:09:30 +00:00
moodler a9c2c8fd8f New "special" help file with javascript :-) 2003-05-08 16:03:57 +00:00
moodler eb7ec77d68 FIxed bug 406 - richtext setting resets! 2003-05-08 13:34:42 +00:00
compuproggy ac6e435422 *** empty log message *** 2003-05-08 06:55:32 +00:00
compuproggy a414246dc9 *** empty log message *** 2003-05-08 06:28:24 +00:00
compuproggy 729fbeee94 *** empty log message *** 2003-05-08 05:16:07 +00:00
coolbit 1f49a7b780 *** empty log message *** 2003-05-07 23:07:50 +00:00
stronk7 0915679c36 Updated. Sections included !!! 2003-05-07 22:18:05 +00:00
stronk7 52b538621e Changes to support xml sections generation.
And convert htmlentities an utf8
2003-05-07 22:15:14 +00:00
gregb_cc ea6e952d88 fix for bug 324. we are now checking to see if there is a conflict caused by
multiple teachers gradign simultaneously.
2003-05-07 20:53:24 +00:00
stronk7 95f6c01b03 Only admins can execute me !! 2003-05-07 16:09:34 +00:00
moodler e51de1e846 Fixed a typo 2003-05-07 15:08:50 +00:00
moodler ab74168b2d FIxed typo in favicon 2003-05-07 14:12:45 +00:00
moodler d94dc588ab Slightly better favicons 2003-05-07 13:04:52 +00:00
moodler d6513bbb0c Seemed like a good idea. 2003-05-07 11:57:10 +00:00
moodler 0f4f911059 Added .jpe as a JPEG (some people do it I notice! :-( ) 2003-05-07 11:43:08 +00:00
moodler e865ded4ba Don't treat Flash files (.swf) like other images. 2003-05-07 11:41:27 +00:00
moodler 0cb29cc411 Turn off PHP error reporting while connecting to database 2003-05-07 08:07:48 +00:00
moodler 4f5dbd132c Try persistent connection first, but if that fails for some reason then
automatically fall back to a non-persistent connection.
2003-05-07 08:03:43 +00:00
moodler f5fb84cee7 Small bug fixed where last question of a file wasn't detected if it
wasn't followed by a blank line
2003-05-07 05:46:01 +00:00
moodler 7aab220e4b Fixed typo 2003-05-07 02:13:24 +00:00
stronk7 fdcdc04730 Updated. XML generation (header & info only) 2003-05-06 23:01:53 +00:00
stronk7 3b8bad6ff0 Included support to clean /temp/backup automatically and to write
the xml file (header and info only)
2003-05-06 22:48:25 +00:00
stronk7 000969becd Included to get Moodle's version into xml file 2003-05-06 22:47:06 +00:00
moodler 2fb7c49f17 Undoing an accidental check-in. These were some experiments trying to
solve a Windows problem (not successful yet).
2003-05-06 16:06:56 +00:00
moodler 1f33691c86 Cleaned up the initial setup process. It looks a bit smoother now.
Hopefully this is also the end of the occasional errors we keep
hearing about to do with never getting to setup the admin user.
(I think admin/site.php had a redirect that didn't always work).

The setup process is now much better at "trapping" you until it's all done.
2003-05-06 15:58:20 +00:00
moodler 49543158f7 Upgraded to latest code, and add lots of new languages 2003-05-06 11:14:31 +00:00
moodler 851a89ff1b Minor fixes for re-inclusion and also links in email 2003-05-06 03:33:55 +00:00
moodler 813ec7ad65 Prevent guests from taking surveys 2003-05-06 03:06:06 +00:00
moodler fce1ce13c8 Hide admin links (eg grades) from guest accounts 2003-05-06 03:02:58 +00:00
moodler 266fbe1a8a Changes to improve hide/show of individual activities when the last
action was to hide/show a topic
2003-05-06 02:51:38 +00:00
moodler 5f350e8f6d Improvements for PLAIN FORMAT (links) plus some efficiency I think 2003-05-05 16:40:46 +00:00
moodler 01d799665d Better detection of URLs in brackets etc ... plus some tweaks 2003-05-05 16:28:40 +00:00
moodler b879effb4a Fixed bug that was not listing discussions that had identical subjects! 2003-05-05 16:21:45 +00:00
paca70 a918234e91 Postgres limit fix 2003-05-05 16:13:45 +00:00
moodler 11a876e1b6 Minor touches to notice() padding 2003-05-05 12:25:08 +00:00
moodler 4105fe9dd2 Added two styles: .noticebox and .noticeboxcontent 2003-05-05 12:17:34 +00:00
moodler 581d7b4959 Fixes for isadmin() 2003-05-05 11:38:54 +00:00
moodler bb19372c0f Some additions 2003-05-05 09:02:17 +00:00
moodler 068be67d83 Formatting fixes only 2003-05-05 08:31:04 +00:00
moodler 1e2fedeef0 Some additions etc 2003-05-05 08:25:53 +00:00
moodler ea23100a02 Style cleanups. Some consistency, converted all to Unix format, and
added manual setting of the MIME type.
2003-05-05 08:12:28 +00:00
moodler 2bc269fd7b Typo in javascript .... selectedindex should selectedIndex ! 2003-05-05 07:44:53 +00:00
stronk7 be4c89b86a Updated and new entries. Don't forget them !!! 2003-05-04 23:39:24 +00:00
stronk7 674b30f5f7 Begin the execute process. Created temporary structures (dir) 2003-05-04 23:24:48 +00:00
stronk7 39c4f15a40 Removed from CVS. Changed to backup_check.html and backup_form.html 2003-05-04 21:33:05 +00:00
stronk7 b0778a76c3 Changed to link with new files (backup_form.html, backup_check.html
and backup_execute.html)
2003-05-04 21:32:11 +00:00
stronk7 a615cc7bb6 Renamed from check.html, execute.html and backup.html to avoid
problems when doing restore.
Old files deleted from CVS
2003-05-04 21:29:27 +00:00
stronk7 3868b9c666 Finished the check phase. Ready to begin the execute phase. 2003-05-04 21:01:47 +00:00
paca70 465fd00e04 Lang column was missing from postgresql-files (?) 2003-05-04 16:05:59 +00:00
paca70 8a230a7d96 Better postgresql support for column creation 2003-05-04 16:03:45 +00:00
moodler 1215e52299 CVS is acting up 2003-05-04 15:18:25 +00:00
moodler d15cbab76f Remove dashes 2003-05-04 15:17:20 +00:00
moodler 93d64ea469 Get rid of dashes 2003-05-04 15:16:17 +00:00
moodler 1ea7c62794 Weeks now do show/hide too ... and some cleanups all round 2003-05-04 15:10:25 +00:00
moodler b37eb1bf00 Theme updates to suit new course formatting 2003-05-04 15:09:13 +00:00
moodler f50f74f6e4 Missed some pixels 2003-05-04 13:48:39 +00:00
moodler ff82802366 Slightly better logic 2003-05-04 13:44:56 +00:00
moodler 3bb49201b1 Some image spacing issues 2003-05-04 12:56:05 +00:00
moodler 2fe2985a53 Nicer eye :-) 2003-05-04 12:49:35 +00:00
moodler 8140c67e45 More tweaks to the topic interface ... nice light globes! 2003-05-04 12:34:43 +00:00
moodler a6d71a2199 Upgraded ADOdb to version 3.40
Works OK for me in tests under MySQL on my server
2003-05-04 11:59:49 +00:00
paca70 c0ba103ca7 Added transaction around table creation 2003-05-04 10:45:57 +00:00
mits cda45e5506 New translation added. 2003-05-04 10:28:13 +00:00
paca70 5ade559e8e updates 2003-05-04 09:56:35 +00:00
moodler 4fc61176b9 Some tweaks to some strings (hide/show) 2003-05-04 09:44:40 +00:00
moodler dfec7b013f Some clean ups - various things to do with Topics view 2003-05-04 09:43:03 +00:00
paca70 592188b42c First versions for postgres7 2003-05-04 08:56:30 +00:00
mits ffb71387cb no message 2003-05-04 08:36:53 +00:00
moodler 59345eb4ec Removed unused function 2003-05-04 08:36:32 +00:00
mits b2a47e2052 New translation added. 2003-05-04 08:31:16 +00:00
moodler 228b823898 Topic strings etc 2003-05-04 08:14:48 +00:00
moodler 59cd767a99 Beta workshop icon 2003-05-04 08:04:22 +00:00
moodler 46772d8c60 These icons are just temporary - they don't look great 2003-05-04 08:02:07 +00:00
moodler 7d99d6959e New feature: hide/show topics! 2003-05-04 07:59:46 +00:00
moodler 81ed361792 Added new style for hidden topics as well as some docs about
all the changes in this version
2003-05-04 07:58:15 +00:00
moodler 2627a658f8 Latest tags 2003-05-04 04:14:14 +00:00
moodler d342c76370 Added Wiki format as a system-wide format (forums, journals, etc)
Also, added better formatting to plain-text emails via a new function
in weblib.php  -  format_text_email
2003-05-04 04:07:36 +00:00
moodler d7c8a46bc5 Don't throw errors when deleting old logs and unsent mail 2003-05-04 03:46:15 +00:00
moodler 9f0b8269ac Fixed bug where text format of a new discussion was not being saved 2003-05-04 03:43:46 +00:00
moodler eb347b6b68 Fixes to improve the password recovery process. There is now a
confirmation step required before the password is changed and sent.

Also, many of the email texts have been cleaned up.

TRANSLATORS:  check your texts in moodle.php starting with "email.."
2003-05-04 03:00:52 +00:00
stronk7 1b502431a8 Commented the "needed users" option (too complex for this initial release).
Check all and course users.
2003-05-04 01:10:20 +00:00
stronk7 dfe5f88b3b Check mods and check users done 2003-05-04 01:05:58 +00:00
stronk7 b4bee933da Added some entries to the backup/restore utility 2003-05-04 00:01:43 +00:00
stronk7 afbe3de8cf Library to every functions related with the backup/restore matter 2003-05-03 23:20:38 +00:00
stronk7 04aa5b2de1 To mantain updated the db with the auto-update feature.
This file is for mysql installations. Every DB must have
its own file.
2003-05-03 23:19:07 +00:00
stronk7 c4c8f73c4a File that contains currect backup/restore version. To use with the
auto-update feature (copied from moodle main code).
2003-05-03 23:17:40 +00:00
stronk7 8cc242516e Changed to support the backup_ids table in all modules (to store and
convert ids in backup/restore.
Added a check_version (copied from main moodle auto-update) to mantain
changes in backup/restore system.
2003-05-03 23:15:43 +00:00
moodler 8980a4e8db Trying to unregister sessions properly and hopefully avoid the "compat"
warnings on some setups
2003-05-03 11:45:41 +00:00
adamtpaw 24a39b1761 Few corrections to inital translation. 2003-05-03 09:30:22 +00:00
moodler 984a8bf349 Two new language variables implemented.
langmenu  - turns the language menu on and off
langlist  - allows the admin to restrict and/or re-order the available language choices
2003-05-03 06:50:29 +00:00
moodler 107b010b43 Some random lowercasing 2003-05-03 06:49:37 +00:00
paca70 ea563f8f99 Postgres needs full longnames for indexes to prevent overlapping names. 2003-05-03 06:44:03 +00:00
moodler 3565715c76 Moved the "turn editing on" button and tidied some other things up a bit 2003-05-03 05:57:29 +00:00
moodler 005103e0bc Changed some function names, making room for export functions later 2003-05-03 04:31:49 +00:00
stronk7 141097ff80 Finalized every mod check 2003-05-02 23:32:02 +00:00
stronk7 d6545aefbc Check page finished (all mods except quiz). 2003-05-02 17:22:18 +00:00
moodler c6bcd06aba Tidied up the quiz imports a bit, and added AON as a format choice
Also added Scott Elliott's Blackboard module!
2003-05-02 15:31:24 +00:00
stronk7 02fee14e28 Changed the name of the backup 2003-05-02 14:48:11 +00:00
stronk7 82e8e7f569 Two new strings to backup function 2003-05-02 14:40:32 +00:00
stronk7 75da62deee changed backupnameformat 2003-05-02 14:39:54 +00:00
stronk7 519bd9342a Completed the module_check_backup_mods function (used in check.html) 2003-05-02 14:38:16 +00:00
stronk7 61ae5d36ca Modified the userdate() function. No changes needed when invoking it.
Added a new parameter (fixday->default true->old behavior) to avoid
formatting days when invoked with false value.
2003-05-02 09:37:41 +00:00
moodler b1834f2dde More tweaks 2003-05-02 08:42:31 +00:00
moodler 6f40f198d2 Tweaks 2003-05-02 08:35:02 +00:00
moodler e6622eda6a Simplified intro a bit 2003-05-02 08:29:35 +00:00
moodler c45855e551 Added FAQ about quotes 2003-05-02 01:24:27 +00:00
stronk7 7db29e6783 More strings to the backup utility 2003-05-02 00:58:34 +00:00
stronk7 10332943ca Add more things !! 2003-05-02 00:57:57 +00:00
stronk7 d67257815d Completed the module_check_backup_mods function (used in check.html) 2003-05-02 00:54:51 +00:00
stronk7 c53987bbb8 This file shows all the info gathered before launch the backup
process itself.
2003-05-02 00:53:40 +00:00
gregb_cc aa0959690c fixed isadmin so that it checks once on each page view if the user is an admin
fixed check_gd_version to properly identify bundled gd versions (old
check_gd_version was returning 0 instead of 2 for bundled gd).
2003-05-01 23:12:05 +00:00
mits 890a2cfeea New translation added. 2003-05-01 17:50:05 +00:00
stronk7 c5be7d8e8e Included Schema of evey mod (comments) and complete
assignments
2003-05-01 17:43:03 +00:00
stronk7 737c4885be Simplified a lot (I discover the variable variables in php !!) 2003-05-01 17:42:08 +00:00
stronk7 3fe1c56cdd Changed 2003-05-01 17:41:16 +00:00
moodler b3afe8244a Useful function for XML ... currently used only in Blackboard quiz importing 2003-05-01 13:57:35 +00:00
moodler 52ff6a7f44 Updates (removed Peer-graded module) 2003-05-01 13:46:11 +00:00
moodler d22d31c659 Workshop module from Ray Kingdon
This version is still beta!
2003-05-01 13:16:58 +00:00
moodler edffca1558 Changes to make forum mailouts a little more robust, and avoid duplicates
I hope, at least the ones caused by overlapping cron jobs.
2003-05-01 12:56:03 +00:00
stronk7 28408ed2ac Two more strings to backup utility 2003-05-01 12:47:52 +00:00
stronk7 d4ccfc2a2b Now all the variables are correctly transfered
Changer error to notice
2003-05-01 12:41:11 +00:00
stronk7 5f5ea8cc4c Include some entries to use in the backup utility. 2003-05-01 12:06:38 +00:00
stronk7 a36175db4c Now checks dinamically if "backuplib.php" and function "module_backup_mods"
exists !!
2003-05-01 11:19:33 +00:00
moodler 6db95aa730 new help file from Howard Miller (needs a little editing still) 2003-05-01 03:44:30 +00:00
moodler 3e9ca9fbc5 Added new Wiki code to allow Resource web pages to be created/edited using Wiki format
This code contributed by Howard Miller.  Thanks!
2003-05-01 03:43:16 +00:00
stronk7 bf32194357 Initial version. Do nothing. Just exist !! 2003-05-01 00:48:58 +00:00
stronk7 3b777608ac Continue 2003-05-01 00:46:39 +00:00
stronk7 3920667ee3 First Version. Do nothing but I saved it from accidental remove !! 2003-05-01 00:45:40 +00:00
stronk7 ea914a66ae Included possible feature
Restore into new course or existing course
2003-04-29 23:22:34 +00:00
stronk7 d565341a2f Frontend started. 2003-04-29 21:23:20 +00:00
stronk7 ea65b07cdd Included ID info. Simple. 2003-04-29 21:09:27 +00:00
stronk7 6b14fdcb1d Initial version of STATUS.txt
Used to show the detailed status of every part of the backup/restore.
2003-04-29 20:21:27 +00:00
stronk7 482fa9f6c6 Initial version of README.txt
Used for general comments about the backup/restore feature
2003-04-29 20:19:51 +00:00
moodler ca16eaeb31 Make sure all these links break out of subframes and go to mainframe 2003-04-29 13:54:53 +00:00
moodler f855f6062b Some tidying up - too much thesis wool in the head 2003-04-29 13:51:28 +00:00
moodler 5d0d5d5ac5 Images, when displayed as resources, are now centered and controlled
by a new style resourceimage
2003-04-29 13:31:47 +00:00
moodler 31d6331615 Don't go through enrolment procedure if they are already enrolled. 2003-04-29 13:04:22 +00:00
moodler dc95f4a11b Always print full number of student at the top 2003-04-29 12:51:21 +00:00
moodler 9d6f5d42eb Only retrieve records that are needed (eg description never is used) 2003-04-29 03:16:32 +00:00
stronk7 6d41991acc Little spell in word "Recursos" 2003-04-28 21:35:03 +00:00
minkowski 46956de552 no message 2003-04-28 18:08:23 +00:00
moodler a273084d7a Strange no-one has noticed this so far ... ! 2003-04-28 16:56:57 +00:00
moodler 81f186b47a I'm getting wierd numbers of records returned on moodle.org.
This fix makes the page a bit more robust even if this is
happening.
2003-04-28 16:13:46 +00:00
moodler df48be741a Minor fixes 2003-04-28 15:52:51 +00:00
moodler 8de14dc72b Print some nice feedback when a discussion has been moved, to help
prevent accidents.
2003-04-28 15:27:44 +00:00
paca70 28ba0d55cc ...And now it works 2003-04-28 15:24:13 +00:00
paca70 8809fee944 updates 2003-04-28 14:59:28 +00:00
moodler b86fc0e2a6 New feature replacing the old zoom function.
Now these are saved in a new table called course_display,
each user and each course can have independent settings.

I'm intending to expand this table later for all the other
course display stuff (like hidden topics etc)
2003-04-28 13:29:26 +00:00
paca70 9655b654a5 Now postgres works as it should, returned primarykeys are correct. 2003-04-28 12:51:19 +00:00
paca70 6492992616 I did't test previous change well, have take changes back. 2003-04-28 12:02:29 +00:00
paca70 9a652ddb2b Don't give fatal error when questions were not found. 2003-04-28 06:36:14 +00:00
moodler f343161392 Some random tidy-ups 2003-04-28 06:07:02 +00:00
moodler b72c80db7e New info 2003-04-28 05:29:26 +00:00
moodler 95abee03e6 Fixed user images 2003-04-28 04:55:31 +00:00
moodler 028677d7b2 Forgot one 2003-04-28 04:45:44 +00:00
moodler 9d2dda0f85 Added new custompix parameter 2003-04-28 04:45:15 +00:00
moodler e313ef4476 The rest of the images 2003-04-28 04:43:51 +00:00
moodler d14c1e0687 Added example of how "custompix" is to be used 2003-04-28 04:41:21 +00:00
moodler dc0dc7d5dd Tidying up the way pix images are used.
It's now also possible to override the standard pix with a set of new ones
in a theme.
2003-04-28 04:32:55 +00:00
moodler 2b83b7f98b Moving some images around - cleaning up organisation 2003-04-28 03:09:27 +00:00
moodler f0eec3b641 Whoops ... left and old line in there during the last fix 2003-04-28 02:43:18 +00:00
paca70 e8a0fc9a4f Corrected typo 2003-04-27 17:35:54 +00:00
paca70 e9ececbb1e $db->Insert_ID seems to work with postgresql too 2003-04-27 16:03:01 +00:00
paca70 5352ceba67 quiz_match was missing... 2003-04-27 15:33:31 +00:00
moodler dc2590e587 Don't process $usernew->username if it doesn't exist (prevents normal users from editing profile). 2003-04-27 14:50:03 +00:00
moodler e13d05801c Fixed rogue spaces 2003-04-27 12:45:51 +00:00
moodler 16aefd75fb New and very complete translation in Russian, from
Yakov Alperin and http://elearning.microtest.ru
2003-04-27 12:10:27 +00:00
mits 667e2e0293 New translation added. 2003-04-27 11:32:42 +00:00
mits 7716babeb2 New translation added and polished some.
I'm keeping my head above water, Martin :-)
2003-04-27 11:31:45 +00:00
moodler 6d21fd37f2 Added new format to this file ... heads up for translators! 2003-04-27 10:58:20 +00:00
moodler 6901fa7955 New plain text format.
Translates smileys and carriage returns, but prints all other tags and code
as plain text
2003-04-27 10:46:16 +00:00
paca70 e209e0b09e indexes for postgres 2003-04-27 09:54:03 +00:00
moodler f5e82bc7f4 Moved microtime_diff() to moodlelib 2003-04-27 08:13:45 +00:00
moodler 026bcf8ce1 Fixed typo 2003-04-27 06:51:44 +00:00
moodler 7aaedff8de Changed my mind about the default setting for loglifetime 2003-04-27 06:50:19 +00:00
moodler 2656b1351f Some rewording about loglifetime 2003-04-27 06:48:13 +00:00
moodler 81a383ca7a New string - saveall 2003-04-27 06:42:28 +00:00
moodler f8bccb148a iNew configuration variable delete old logs - loglifetime 2003-04-27 06:41:53 +00:00
moodler 540bab47d4 Delete old logs is required 2003-04-27 06:21:15 +00:00
moodler 30f89d6833 New delete_records_select() function 2003-04-27 06:18:03 +00:00
moodler f9d5fd3b3c Added a LIMIT to the SQL query for a bit more efficiency 2003-04-27 03:32:45 +00:00
moodler f9ce68ee7f Using multiple indexes for slightly increased performance 2003-04-27 02:58:26 +00:00
stronk7 c0605295bd Changed to dimm non-visible grades (mods). Bug #378.
Done a bit more:
  - Show dimmed entire column.
  - Difference html (for web) and text (for .xls and .txt export) in
    many variables.
  - Using the dimmed_text style to dimm.
2003-04-26 19:35:27 +00:00
stronk7 85093cf4f9 Added the dimmed_text css style to show normal text dimmed (gray #AAAAAA) 2003-04-26 18:54:37 +00:00
stronk7 0830bae4d7 Changed to hide non-visible grades (mods). Bug #378. 2003-04-26 18:16:36 +00:00
moodler 1ba3960285 Working much better with indexes - update the schema 2003-04-26 15:26:51 +00:00
moodler 6459f225b8 Update to add new indexes to MySQL tables. Speeds up the log access. 2003-04-26 15:24:04 +00:00
moodler 1b5910c4a5 Trying a different tack for recent_activity since the old way was
still producing too much data and overflowing PHP memory on busier
sites (eg moodle.org).

Now, there are more database queries, which is unfortunate, but the
data is much more specific, and no sorting needs to be done, so
this is a performance boost.

I don't know how these will cancel out ... my guess is that very
small sites may be very slightly slower on the course page, but
that large sites will be much faster.

Let's see.
2003-04-26 15:08:34 +00:00
moodler a54b8dd3af Need course module stuff 2003-04-26 14:21:42 +00:00
moodler 667ab3252b Get less logs from the database 2003-04-26 14:12:12 +00:00
moodler b1992e65cf Trying an experiment on moodle.org 2003-04-26 13:49:13 +00:00
moodler 10a95b432c Fix for use of COURSE_MAX_RECENT_PERIOD 2003-04-26 13:41:31 +00:00
moodler ad08fdc277 Performance improvements
- better checking of data before processing
  - used logs are removed to avoid re-processing by other modules
2003-04-26 12:59:41 +00:00
moodler 38e5dbf319 No changes, just rearranges 2003-04-26 12:38:53 +00:00
moodler ec2a28a607 Extended number of select fields allowed for get_field() and set_field() from 1 to 3 2003-04-26 12:38:04 +00:00
moodler 278a229c25 Slight fix to teacheronly coloring 2003-04-26 12:22:52 +00:00
moodler 3d89198946 Cleaned up definition of constant COURSE_* values in course/lib.php
Moved COURSE_TEACHER_COLOR out to style sheets where it belongs (.teacheronly)

Added some efficiency when printing recent activity

 - don't print more than one weeks worth of updates
  - don't keep re-parsing logs once they've been used
2003-04-26 12:17:30 +00:00
moodler 78e0146055 Argh! Excess quotes in CSS 2003-04-26 12:12:30 +00:00
moodler 6eb6cd8753 New style for teacher-only colour (eg when showing teacher posts in recent activity) 2003-04-26 12:07:14 +00:00
stronk7 fbca88e692 Show activity log only from visible surveys. Bug #367. 2003-04-26 11:04:46 +00:00
stronk7 2953d5e865 Show activity log only from visible journals. Bug #367. 2003-04-26 10:14:54 +00:00
stronk7 86e6076b3b Modified the instance_is_visible function. It has a bug, having
the "forum" table harcoded. Simplify a bit. Now seems to work
fine with every mod.
2003-04-26 09:34:11 +00:00
moodler c3357723de FAQ in full is too long - offends my eye :-) 2003-04-26 06:05:24 +00:00
moodler 09368e3938 Moved most-asked question to the top 2003-04-26 06:02:58 +00:00
moodler a95ae47bdf Imprved intro 2003-04-26 05:55:39 +00:00
moodler 50d673157b Long form of FAQ 2003-04-26 05:44:42 +00:00
moodler 65eed52ded Style for question links 2003-04-26 05:42:51 +00:00
moodler d1db7bee92 More cleanup 2003-04-26 05:40:24 +00:00
moodler 39b5b3fa2a more clean up 2003-04-26 05:30:00 +00:00
moodler e317d04919 Cleaned up, with additions 2003-04-26 05:24:07 +00:00
stronk7 dff0db9ad5 Show activity log only from visible forums. Bug #367. 2003-04-26 00:17:42 +00:00
stronk7 746546a8f8 Show activity log only from visible assignments. Bug #367. 2003-04-25 23:49:35 +00:00
stronk7 b3cc742cf9 Avoid showing course updates (add, update, delete) about hidden mods. Bug #367 2003-04-25 23:17:53 +00:00
paca70 c4c575979e Allow caseinsensitive search for postgesql 2003-04-25 19:32:38 +00:00
paca70 3399a22c9f Show adduser only when adding new user from moodle is posible. 2003-04-25 17:18:40 +00:00
paca70 4dd0497164 Dont allow edit username when external authentication is active. 2003-04-25 16:42:07 +00:00
moodler 826293c75b Allowed - and . during signup by email 2003-04-25 12:35:17 +00:00
moodler 5a9126f75a Renamed signup_form.php to signup_form.html (this part of the code is really old) 2003-04-25 12:32:26 +00:00
moodler a2f1ef3067 Some default values for variables 2003-04-25 12:29:52 +00:00
moodler 266cc04fe7 Footers use new styles for links 2003-04-25 09:25:25 +00:00
moodler b328523cc1 Style for "You are logged in as xxx" and the link to the course home page. 2003-04-25 09:23:08 +00:00
moodler a5c411d4c2 Smaller font 2003-04-25 09:01:01 +00:00
moodler 583a7283e9 Edit my profile link goes straight to the edit screen 2003-04-25 08:59:10 +00:00
moodler fc613dff69 Directories are now made using make_upload_directory from moodlelib 2003-04-25 08:39:11 +00:00
moodler 4d4267739c Some minor visual improvements - firstname/lastname separated, initialised some variables 2003-04-25 07:15:12 +00:00
moodler a282d0ffda Adding user's name at the top of the course page.
Just experimenting with it there for a while ... feedback welcome
2003-04-25 06:40:30 +00:00
paca70 87b490dfc6 Hide password field when password change is not supported by auth-module. 2003-04-25 06:01:59 +00:00
moodler 580f2fbc07 New function to detect visibility of a single module, and
use of this function when displaying list of forums
2003-04-25 05:24:29 +00:00
moodler 047d30d1eb MySQL code (etc) to convert all usernames to lowercase ... does a lot more
checking than it really needs to, since MySQL is not case sensitive
2003-04-25 03:54:21 +00:00
paca70 1e22bc9c04 Conver usernames to lowercase for internal use. This prevent duplicate users
when using external authentication and posgresql.
2003-04-24 20:06:40 +00:00
paca70 e40488f80c routines to convert postgeruser to lowercase. 2003-04-24 18:48:09 +00:00
stronk7 c37053ea2f Changed to show the hidden surveys dimmed (bug #364) 2003-04-24 18:28:30 +00:00
stronk7 e6c136e1bf Changed to show the hidden quizzes dimmed (bug #364) 2003-04-24 18:19:23 +00:00
paca70 1dea7ebb04 global $CFG was missing...? 2003-04-24 17:38:20 +00:00
stronk7 f99d236832 Little update to select the forum info (avoid duplicates). 2003-04-24 17:35:34 +00:00
paca70 dbe0be0059 Added missing $ 2003-04-24 17:21:54 +00:00
stronk7 3b0fb381ea Changed to show the hidden forums dimmed (bug #364) 2003-04-24 17:15:59 +00:00
moodler 61367e6417 More robust variable checking 2003-04-24 17:13:52 +00:00
moodler 719e7b04f8 Default value for alltext variable 2003-04-24 17:05:54 +00:00
stronk7 5094d166b7 Changed to show the hidden choices dimmed (bug #364) 2003-04-24 16:47:06 +00:00
stronk7 dd8d521d91 Changed to show the hidden assignments dimmed (bug #364) 2003-04-24 16:38:49 +00:00
stronk7 81cdaada93 Changed to show the hidden resources dimmed (bug #364) 2003-04-24 15:25:21 +00:00
stronk7 7cfb83477c Modified to obtain the visible property too. To use it when showing the list
of instances of every mod (bug #364)
2003-04-24 15:17:43 +00:00
moodler 638f95b1ff Latest things 2003-04-24 15:03:42 +00:00
moodler 88478a664f New authentication method - a very simple one called "manual".
Accounts have to exist in the internal database, and there is
no way to create an account on the site - admins have to do it.
2003-04-24 15:01:15 +00:00
moodler 67b0821af9 Fixed a typo, see bug 361 2003-04-24 14:37:22 +00:00
moodler e1c4617441 Added recent stuff 2003-04-24 14:28:24 +00:00
moodler 3395f2d67e Forum posts are now not allowed to have blank subjects or messages,
if a message is entered with one of these blank then the user gets
an error message and a chance to re-edit the message.
2003-04-24 14:05:47 +00:00
moodler 41ab15fba5 Added Polish info 2003-04-24 08:46:44 +00:00
moodler 1fc49f0019 New feature to allow teachers to move a discussion from one forum
to another.

A simple popup menu now appears when teachers view any discussion.

Includes a new log entry to log when a discussion is moved.
2003-04-24 08:45:27 +00:00
moodler 2a40936834 Mark the hidden ones for teachers 2003-04-23 17:25:20 +00:00
moodler 13df5aeef3 Rebuild course modinfo caches to include the visible variable 2003-04-23 17:02:24 +00:00
moodler 7acaa63d09 Tidy up a bit 2003-04-23 16:57:35 +00:00
moodler feffa4e695 chmod after mkdir (just in case) 2003-04-23 16:51:26 +00:00
stronk7 fec5a6a63f Changed the get_array_of_activities function to return the visible property too 2003-04-23 16:37:37 +00:00
stronk7 cf055081ef Changed the navmenu function to show only visible-mods on the
jumpmenu. Everything is showed when the user is a teacher.
2003-04-23 16:32:11 +00:00
stronk7 00d26a208b Changed the get_course_mods function to obtain the visible property too. 2003-04-23 16:09:56 +00:00
mits d4269e95c0 fix again. 2003-04-23 15:43:56 +00:00
mits 91162b4688 fixed :-) 2003-04-23 15:39:54 +00:00
moodler a7eedb343c Sorry, Mits, I think I broke it :-( ... can you check this file? 2003-04-23 15:34:12 +00:00
moodler f861185a4a Added dynamic display of post delay time as currently defined for the server 2003-04-23 15:30:22 +00:00
moodler b7637a30d4 Dynamic value of minutes displayed in help file 2003-04-23 15:25:27 +00:00
moodler c032b59db9 Help button about subscription on forum page 2003-04-23 15:19:01 +00:00
moodler 312447111c Got a bit slash-happy 2003-04-23 15:01:37 +00:00
moodler 3af4a3653c some HTML tags made a bit more XHTMLish 2003-04-23 14:50:44 +00:00
mits 847179dc91 New translation added and polished some. 2003-04-23 14:22:19 +00:00
moodler bc3df42048 Initial, partial translation from Adam Pawelczak <adamp@wsb.poznan.pl> 2003-04-23 11:30:14 +00:00
stronk7 c7da6f7a8f Bug #363. When everyting is hidden at main-menu, error occurs. Changed the get_all_mods function to check this. 2003-04-22 20:46:12 +00:00
stronk7 e6cf424727 Bug #261 closed. Appended course short-name to distinguish courses
when assigning teacher.
2003-04-22 19:27:11 +00:00
paca70 e05566015e More updates. Thanks to Teemu! 2003-04-22 14:38:37 +00:00
paca70 3c7f99a447 Updates 2003-04-22 14:18:03 +00:00
paca70 7d6cac54f3 New string conversion function to help with multibyte-locales 2003-04-21 16:39:43 +00:00
moodler 3ba2985594 Robustness fixes 2003-04-21 08:08:33 +00:00
moodler b369ff55fe Whoops, chmod not chown 2003-04-21 07:26:23 +00:00
moodler 718ad19f47 trying to fix up old file permissions 2003-04-21 07:21:33 +00:00
moodler 9dd0b37817 Make sure to change the ownership of uploaded files 2003-04-21 07:11:29 +00:00
moodler 3269b238a7 Updated (to make the new release notes show up for CVS people :-) 2003-04-21 06:44:13 +00:00
moodler 6b708b9844 More info about new features in the upcoming release 2003-04-21 06:43:05 +00:00
paca70 978704f095 More comments 2003-04-20 18:15:03 +00:00
paca70 d2802df553 Added mimetype and icon for avi-files. 2003-04-20 07:42:18 +00:00
paca70 44a334d874 Undoing needless change. 2003-04-19 19:09:01 +00:00
paca70 d61bf02f18 Works now also with $a->something 2003-04-19 17:45:50 +00:00
paca70 4dddd64b5f Hilite also empty stings. 2003-04-19 10:25:58 +00:00
paca70 fe8bc4c9a5 Removed two `'s 2003-04-18 21:05:12 +00:00
paca70 cefc7e817e Fix for postgresql column adding( $oldfield is always '"$oldfield"') 2003-04-18 20:50:42 +00:00
moodler 2ab968e937 Trying some optimisations 2003-04-18 09:53:41 +00:00
moodler 32dcc87484 Fixed new bug that was preventing news being shown on course page 2003-04-18 07:25:58 +00:00
moodler fc6a91994e Robustness on a variable 2003-04-18 07:25:32 +00:00
moodler 02a7699f0d Tweak for generalbox 2003-04-18 06:41:34 +00:00
moodler 03aa0dfa10 Style improvements and upgrades 2003-04-18 06:39:40 +00:00
moodler 9e0a08bd28 Discussion, not subject 2003-04-18 06:14:17 +00:00
moodler c20b762a06 Fixed location of Older discussions link 2003-04-18 05:57:45 +00:00
moodler 3c8a606d85 Added simple paging ... only top 100 are shown by default. If there
are more then "older discussions" link shows all of them.

Someday proper 1,2,3,4 paging would be nice but this will do for now.
2003-04-18 05:54:18 +00:00
moodler 546be6dd89 don't valign subjects in html 2003-04-18 05:28:08 +00:00
moodler 96e301a7c9 Undoing last checkin 2003-04-18 05:25:46 +00:00
moodler 9ddb00e600 Improved colours 2003-04-18 05:22:49 +00:00
moodler 29507631a9 First pass at a cleaner display for discussion listings 2003-04-18 03:58:12 +00:00
moodler 801e1f0a3e Set guest name in current language on login 2003-04-18 02:18:12 +00:00
moodler bf3bc898ac Assigned $strsearchresults 2003-04-18 01:57:24 +00:00
moodler a00283d6cd Clear a variable, just in case 2003-04-17 15:46:39 +00:00
moodler c1d9daca3c Clear the variable, just in case 2003-04-17 15:45:57 +00:00
moodler 7226ce02b1 Robustness for $course variable 2003-04-17 13:20:26 +00:00
moodler da63e99627 Updating version because the quiz work is finished, for now 2003-04-16 15:20:21 +00:00
moodler 3abe21ab94 Latest tags 2003-04-16 15:19:23 +00:00
moodler e1122620b5 Er, similar to the last few changes but this way seems to actually work. :-)
Need sleep ...
2003-04-16 13:48:16 +00:00
moodler 2408867e8c Improvements for shuffleorder in collections of random questions 2003-04-16 13:25:03 +00:00
moodler 96192c4459 After doing a quiz that has been shuffled, present the feedback in the
same order.  Note that shuffled ANSWERS may still appear reshuffled.

When viewing reports, all shuffling is switched off so that quizzes
always appear in the default order (for easier comparison).

Also a few tweaks, robustness etc
2003-04-16 13:10:48 +00:00
moodler 77cff58927 Fixes for bug 268 - Changing answers of questions can lose responses for
existing quizzes with those questions.

When updating a question it now checks for existing answers and updates
those instead of making new ones.
2003-04-15 14:43:29 +00:00
moodler eece3a331a Tweakin' icons 2003-04-15 14:29:09 +00:00
mits f24f17c5bb no message 2003-04-15 14:07:48 +00:00
mits 2386e97f89 New translation added. 2003-04-15 14:05:47 +00:00
moodler d6a6331129 Add category to random question names 2003-04-15 13:14:33 +00:00
moodler c9548d4a5d Slight mods ... are they better? 2003-04-15 06:20:27 +00:00
moodler de38e2621d More robust use of $_FILES['imagefile'] 2003-04-15 02:08:27 +00:00
moodler 1acfbce5b6 Hide/show individual activities in any section
Code submitted by Eloy Lafuente (thanks!) for 1.0.8 ... I hand-merged it
into 1.0.9.
2003-04-14 15:11:09 +00:00
moodler 5a25f84d25 Fix for off-by-one grade error when 'Save Grades' had not been used 2003-04-14 13:52:59 +00:00
moodler 8b72b41bf9 Better looking code 2003-04-14 05:44:47 +00:00
moodler b610b4c2fd Showall is sticky, and also you get a warning about the number 2003-04-14 03:02:25 +00:00
moodler dea49bdd6c Changed wording a little 2003-04-14 02:56:31 +00:00
moodler 99de5ed02b New string "showall" 2003-04-14 02:55:48 +00:00
moodler cb77b5b67f Better wording 2003-04-14 02:53:55 +00:00
moodler a625debc38 Simplified display - less unnecessary clutter 2003-04-14 02:52:11 +00:00
moodler 15c715211e Mucking with the formtting 2003-04-14 02:48:40 +00:00
moodler 980d545f4f Smaller info 2003-04-14 02:45:03 +00:00
moodler 9ecb1bd3a4 New strings for showing users 2003-04-14 02:43:53 +00:00
moodler c5b6666eaf Better support for large classes 2003-04-14 02:42:40 +00:00
mits 63a77d2d39 no message 2003-04-13 18:48:24 +00:00
mits c76f49060f New translation added. 2003-04-13 18:47:03 +00:00
moodler 7c81b6e273 Sort subscribers by email address (easier to find subscribers based on
bounced messages)
2003-04-12 07:52:52 +00:00
moodler 752e1c2b62 Don't pass alltext from mod.html to details.php ... more efficient this way 2003-04-12 03:42:17 +00:00
moodler 67b69ce15b No real point to changing the numbers - changing them back to the original plan 2003-04-12 03:18:50 +00:00
moodler cdb0ca8315 Update to stop it falling too far behind 2003-04-12 03:18:02 +00:00
moodler f475564878 Latest tags 2003-04-11 14:46:21 +00:00
moodler 0bf2925db8 Minor fixes 2003-04-11 14:44:12 +00:00
paca70 5e776a02ad To check string sizes 2003-04-11 12:05:21 +00:00
moodler c6eed09730 New "create multiple questions" wizard.
Improvements to the importing routine for AON
2003-04-10 17:55:57 +00:00
moodler 340191ded7 Added Danish 2003-04-10 14:17:01 +00:00
moodler 085e317dbf Danish! From S?ren Vinther Hansen <info@thenavigator.dk> 2003-04-10 14:04:30 +00:00
moodler be09831ac3 More info about admin location and a fix 2003-04-10 13:57:21 +00:00
moodler dae73c05e9 New $CFG->admin directory can override the location of the admin
directory.

Useful because some web hosts use /admin for other things.
2003-04-10 13:46:52 +00:00
moodler bc700e6559 New function swapshuffle_assoc 2003-04-10 13:45:07 +00:00
moodler c05eca327c Importing improved to include pre and post-processing.
Removal of Random Matching code from the generic case.
Implementing a particular custom import style aon.php
2003-04-10 13:12:40 +00:00
moodler da5fb074c3 Minor robustness fix 2003-04-10 13:11:34 +00:00
moodler b1db099b7e New icons 2003-04-10 13:04:20 +00:00
moodler 44ce983d45 Updated number of languages 2003-04-10 06:24:57 +00:00
moodler 66a68c1739 Updated with current thoughts about general path this year 2003-04-10 06:22:04 +00:00
moodler 1365bacde6 Correct a typo 2003-04-09 14:30:04 +00:00
moodler 52c018a0b5 More logical position for shuffle options 2003-04-09 14:27:58 +00:00
moodler 4b85b71712 New quiz switches to
- shuffle questions order
  - shuffle answers order
2003-04-09 13:57:08 +00:00
moodler f5cbbecaf5 empty() --> !isset() 2003-04-09 13:41:11 +00:00
moodler 72e5815533 More fixes resulting from random question feature 2003-04-09 08:11:20 +00:00
moodler 434802d5ce Slightly more efficient database access. 2003-04-09 07:23:42 +00:00
moodler 34d52ad7d2 First implementation of completely random questions.
When you add a random question to a quiz, then a question
is chosen randomly from the same category.

Questions are not repeated in a particular quiz attempt.

This still needs more testing, but it's looking OK so far.
2003-04-09 06:32:51 +00:00
moodler d62413e869 Use "modified" date of posts when displaying them, not the "created" date. 2003-04-08 14:09:24 +00:00
moodler 329f046798 Don't use session.path check when the server is in safe mode 2003-04-08 03:51:38 +00:00
moodler 29cbd93a45 Just much simpler way of doing the last patch. 2003-04-07 16:08:52 +00:00
moodler aa6fbca550 Use the cached admin bit if it's there!
(saves one database access per editable activity on the course page!)  :-/
2003-04-07 15:30:34 +00:00
moodler 8daaf761c3 Added code to catch runaway case when there is more than one news forum.
It shouldn't happen, but I think it can when the database is having
problems.
2003-04-07 15:20:08 +00:00
moodler 8f202463d5 New file 2003-04-07 03:30:50 +00:00
mits b4e3b12234 New translation add and modify $string['configunzip'] , $string['configzip'] :) 2003-04-06 06:15:00 +00:00
moodler e64984a0bb Modifications to allow Moodle files management page to use PclZip
instead of external zip programs.

To use the internal PclZip, the config variables "zip" and "unzip"
must be left blank.

Code for PclZip integration originally from Robert Hetzel, though
I've expanded it and modified it a lot.

The zip files seem compatible with itself and Windows XP, but I had a
compatibility problem trying to unzip a PclZip file using Zip 2.3 on Linux
(directories are unpacked as empty files)
2003-04-06 05:53:47 +00:00
moodler 8ef3483b60 Added Version 1.3 of PclZip to the distribution 2003-04-06 05:48:56 +00:00
mits f07e21dec4 no message 2003-04-06 03:29:28 +00:00
mits f561b68011 Polished 2003-04-06 03:24:49 +00:00
moodler 46d552b810 Partial translation, by Ilia Chipitsine <ilia@chel.skbkontur.ru> 2003-04-05 14:29:26 +00:00
moodler e52c4f2231 Latest improvements from Paula 2003-04-05 14:21:10 +00:00
moodler c4dfc485eb Fixes for main SQL defintions - from Juro Chlebec 2003-04-04 10:47:37 +00:00
moodler ef49e5c301 addslashes to string used for javascript link 2003-04-02 07:24:42 +00:00
moodler 8a205861e0 Added a robustness check for USER->id 2003-04-01 02:38:31 +00:00
moodler 0305fe824d Undoing recent changes 2003-04-01 02:24:58 +00:00
moodler ffb410df03 Sorry, Petri, but we need to undo these changes, because:
- they could break accounts in existing installations
  - strtolower can corrupt strings in multibyte languages

Is it really a problem that usernames are case sensitive on PostgreSQL?
2003-04-01 02:14:16 +00:00
paca70 b398d5ee2a Use always only lowercase version of username.
When using authentication module (ldap, smb, pop etc...) and postgres-database multiple moodle
users were created for usernames like 'Username' 'username' 'userName'
2003-03-31 17:05:52 +00:00
mits 73f131b7a6 New translation added and polished some. 2003-03-31 03:03:20 +00:00
moodler e4be3d5943 Renamed randommatch.html -> randomsamatch.html 2003-03-30 16:51:24 +00:00
moodler 432d39026d New template for Match questions 2003-03-30 16:48:34 +00:00
moodler 54a67a5921 First cut at adding new "fixed" Match question type, which is manually
created.  Works OK after limited testing.

I've also renamed some strings to do with "Random Match", so that this
question type is now called "Random Short-Answer Match".

Later there will be a new 'Random Match' which randomly selects one of the
existing "Match" questions.
2003-03-30 16:46:50 +00:00
moodler 03fd6a965e Fixed a slight typo 2003-03-30 13:54:28 +00:00
moodler 0d0baabf2c Fixed a missing global $CFG declaration. 2003-03-30 13:25:49 +00:00
moodler 2d0b30a028 What was I thinking? This is much cleaner (and no duplicates). 2003-03-29 04:08:51 +00:00
moodler adaf39283c Changes to activate the "force subscribe" option on the Site News forum.
By default it is OFF, but if it is turned on, then site news is emailed
to ALL enrolled students and ALL current teachers.
2003-03-29 03:39:56 +00:00
paca70 754786f1be Updates 2003-03-28 08:58:47 +00:00
paca70 a3b0dbfa80 updates from Jaana 2003-03-27 20:04:24 +00:00
moodler 90707adb7f Added Romanian author, plus some fixes 2003-03-27 03:28:25 +00:00
moodler b8a0fb13a3 Eugen Tanul <roinstitute@fx.ro> 2003-03-27 03:14:44 +00:00
moodler aa9f961b7d New language: Romanian by Eugen Tanul <roinstitute@fx.ro> 2003-03-27 03:13:36 +00:00
moodler bad357c414 Restoring Paula de Waal's versions for the time being 2003-03-26 15:14:52 +00:00
moodler ea6003eb8a New translations of the help files, from Adriana Beal 2003-03-26 15:08:46 +00:00
moodler b60aa549fc Added Bobo 2003-03-26 14:14:16 +00:00
moodler b6f64be2a5 Fixes related to AcceptPathInfo - removed need for ifDefine lines. 2003-03-26 14:13:42 +00:00
moodler 075a591656 Better regular expresssion for detecting URLs at the very start of a text.
I don't know what the old one thought it was doing!  :-)
2003-03-26 07:33:26 +00:00
moodler 0ece16e90c Added tags file for codewalkers who can't generate one.
This file will not be included in distributions.
2003-03-26 06:03:34 +00:00
moodler 036d3c1f90 Typo! 2003-03-26 05:48:21 +00:00
moodler 6eff984aee Added some new indexes on quiz tables in MySQL 2003-03-26 05:46:09 +00:00
moodler 264d4e0b9a Added two new indexes on log table to help speed it up.
See Greg's note in bug 113
2003-03-26 02:17:46 +00:00
mits 1495667946 pgassignment.php done.
needs enough polish :)
2003-03-24 16:34:21 +00:00
mits 8cc7286ccc New translation added. 2003-03-24 15:33:37 +00:00
paca70 f5cdd4d133 Corrected typo 2003-03-24 13:15:48 +00:00
moodler b2d0ca3b7c Removed some tabs :-) 2003-03-21 14:09:51 +00:00
moodler 000cc405ba Hack from Roberto Pinna (Bobo) to add sorting when viewing submissions
Might need some tidying up still but it's functional ..
2003-03-21 14:07:25 +00:00
moodler e384fb7b73 Can now count a search of users 2003-03-21 10:10:21 +00:00
moodler 49e16355c2 Improvements to display of users 2003-03-21 10:08:23 +00:00
moodler c750592ac4 Added a search form to the "edit users" admin page yay! 2003-03-21 09:42:42 +00:00
moodler 6a3461ad1c Links to admin page in header are now relative 2003-03-21 04:56:05 +00:00
moodler 746665838a More robustness on checking sequence variables 2003-03-21 04:53:08 +00:00
moodler f8430195d9 Small fix to avoid PHP warnings 2003-03-21 04:49:29 +00:00
moodler ef4145f6ae Changes to make regrading work properly if the quiz has changed
and also an exptended timelimit for when regrading is REALLLLY slow
fue to some other unknown reason (as yet)
2003-03-20 07:28:53 +00:00
mits f2cc50f192 New translation added. 2003-03-20 06:10:00 +00:00
moodler 4c0e951049 Updated credit for Slovak 2003-03-18 12:57:01 +00:00
moodler 0fdddefbaa Improved Portuguese (Brazil) version by Paula de Waal 2003-03-16 15:02:38 +00:00
moodler d4120c3d7c Added some more options for longtimenosee 2003-03-16 02:35:03 +00:00
paca70 509139373e Fixed incorrect comparison. Peter Paluch pointed this out. 2003-03-15 18:26:46 +00:00
moodler 78e72ed16b Didn't quite finish the last patch of user -> usernew 2003-03-15 09:15:44 +00:00
moodler e6829515b0 Bug fix from Ray Le Couteur ... alphanumeric check was checking old
username but not the new username
2003-03-15 08:26:00 +00:00
paca70 e582b65e30 Fixed logic error.
Now also first time users can be course creators.
2003-03-14 21:34:39 +00:00
gregb_cc a2631c99d9 This closes bug http://moodle.org/bugs/bug.php?op=show&bugid=310
assignment_get_unmailed_submissions now ensures that a student is still enrolled
2003-03-14 19:58:53 +00:00
moodler 01cf7d2ebc Added some people 2003-03-14 12:45:05 +00:00
moodler a4ef9df2d7 Initial version from Les Kopari - les_kopari@yahoo.com 2003-03-14 08:22:37 +00:00
moodler 9d5b689c8a Added vim commands at the bottom of the file to try it out 2003-03-14 07:55:22 +00:00
gregb_cc b9287b2fba Added a useful message, to make the cron output more helpful in diagnosing
"stuck" assignments.
2003-03-13 20:59:31 +00:00
mits d48f938420 New translation added. 2003-03-13 15:22:43 +00:00
mits ddde5a8c82 New translation added. 2003-03-13 14:17:21 +00:00
gregb_cc c0f728ba9e code formatting change: switched from alternative syntax to using {} 2003-03-12 21:40:47 +00:00
gregb_cc 6908193151 speed improvement in smilie_replace. It is now almost as fast (within 5-10%) of
the version that used global smilie definitions.
2003-03-12 21:37:05 +00:00
gregb_cc 617778f2d3 Added benchmark and test for replace_smilies 2003-03-12 20:36:55 +00:00
moodler 4c31e7cfba Removed main_frame 2003-03-12 08:37:42 +00:00
moodler d4be5253aa Making a consistent download link for uploaded resources (same as web page) 2003-03-12 08:02:05 +00:00
moodler 2d8cf6799a Whoops! Accidentally checked in a quick hack I did for someone. 2003-03-12 07:49:54 +00:00
moodler c9082a8c2f Integrated the default redirect message delay from Greg B 2003-03-12 07:44:29 +00:00
moodler f82c2d428a Modified Greg's work to:
- rename the main_frame variable to framename, because it
       - might have caused some confusion
       - none of the global variables have underscores
  - put the config in the config table, with a default of _top
2003-03-12 07:36:22 +00:00
gregb_cc 2ea9027bc4 Small cleanup of smilie replacement.
This change removes the smilie variable assignment from the global namespace.
This change retains the original user input as the alt text.
The main reason for this change is to make it possible for me to use my
make_class function on weblib.php (still need to do something about the defines
though).
2003-03-12 03:42:44 +00:00
gregb_cc 08b3606390 This is a first attempt to make moodle frame safe.
I've added the variable CFG->main_frame to config-dist.php, and replaced _top
targets with the variable in all the php files.  HTML files, like those in the
documentation, have not been modified, as they are not (yet) parsed.

The variable should probably get moved into the config table, and get some
documentation.

I've also included, but commented out, a slight change in weblib.php, which
would guarantee that messages would be seen before redirecting the user (unless
delay intentionally set to 0 when redirect is used).
2003-03-11 21:35:12 +00:00
moodler 754b76fe65 Whoops, paca70! You accidentally jumped a month forward in the date. :-)
We need to increment the version.php file slowly now until time catches up.
2003-03-11 06:04:28 +00:00
moodler 3ac1dedc35 Added some popup help for topic/week summaries 2003-03-11 05:57:00 +00:00
moodler 1e5a2bf584 You can now use Richtext editor to edit section texts, plus the page is a
bit more consistent now
2003-03-11 05:43:39 +00:00
mits 8f6dcdbaa4 no message 2003-03-11 04:24:32 +00:00
mits 5c34d1e3a4 New translation added. 2003-03-11 04:19:12 +00:00
moodler 8fb2f0fa1e Corrected typo 2003-03-10 14:05:10 +00:00
moodler ac234d0262 Tidied up and rearranged a little 2003-03-10 14:02:12 +00:00
moodler fe32b83bbf Improvements to explain about AcceptPathInfo 2003-03-10 13:59:06 +00:00
moodler 76a359ba93 Added something for Apache 2 (to make 'slasharguments' work)
<IfDefine APACHE2>
    AcceptPathInfo on
</IfDefine>
2003-03-10 13:39:56 +00:00
paca70 7563a073c3 rtf-editor had mixed up some files 2003-03-07 17:55:44 +00:00
villate d106f1d9ae Improved translation of "search forums". 2003-03-07 16:15:30 +00:00
moodler 9a9a2907c2 Add a target to the "made with moodle" link to avoid confusing students 2003-03-07 15:09:12 +00:00
paca70 c605097983 RitchText editor had mixed up all php code. 2003-03-07 07:04:54 +00:00
mits 25f3420857 New translation added. 2003-03-06 17:48:25 +00:00
paca70 5fcda72588 updates 2003-03-06 16:39:17 +00:00
moodler e00f0f9f51 Added missing styles and so fixed bug of display of generalbox 2003-03-06 08:54:28 +00:00
moodler 548daac7d9 Some fixes sent in by "Adriana Beal - Vydia Tecnologia" <adriana@vydia.com.br> 2003-03-06 02:01:05 +00:00
mits 19bbe230f6 Polished 2003-03-05 14:12:48 +00:00
mits 66ea5000db New translation added. 2003-03-05 13:11:05 +00:00
mits 706e019764 Polished 2003-03-05 13:10:37 +00:00
paca70 1b7f43a40a updates 2003-03-05 13:01:29 +00:00
mits 247612cfe7 New translation added. 2003-03-05 03:29:32 +00:00
mits 049100796f Polished 2003-03-05 02:06:49 +00:00
compuproggy b1ca03e9cf *** empty log message *** 2003-03-04 12:45:58 +00:00
compuproggy cdf198d345 New Translations 2003-03-04 12:30:47 +00:00
moodler 70e5e91e9e Remove some old save_sessions 2003-03-04 09:01:26 +00:00
mits 7470fb3782 New translation 2003-03-03 17:55:19 +00:00
mits d831f93c73 no message 2003-03-03 17:54:27 +00:00
mits 1862b9eb54 New translation added. 2003-03-03 17:53:40 +00:00
moodler 0d1a40f00a Updated versions only 2003-03-03 17:48:39 +00:00
moodler 31ce4b538c Fixed quotes on column 2003-03-03 17:46:53 +00:00
moodler df103e8212 Questions now have a defaultgrade column (which defaults to 1)
... this grade is used as the default grade when adding questions
to a quiz.

At the moment it's just so that some imported questions can have
different defaults, but a field should be added to all question
editing pages.
2003-03-03 17:43:13 +00:00
moodler c363d9d11f Added QUIZ_DEFAULT_SCORE ... later this will be a quiz option 2003-03-03 17:05:35 +00:00
moodler 9314930280 Slight rewording 2003-03-03 13:23:50 +00:00
moodler 43f2302fdf Started a Frequently Asked Questions page 2003-03-03 13:18:34 +00:00
mits c4eb7e254f New translation added. 2003-03-02 06:10:16 +00:00
mits cd4b225bd0 no message 2003-03-02 01:13:47 +00:00
mits f84148d015 *** empty log message *** 2003-03-02 01:12:11 +00:00
mits d57d61e3a7 New translation added. 2003-03-02 01:10:16 +00:00
mits b365072d7c New translation added. 2003-03-01 16:54:36 +00:00
mits 687f38368e no message 2003-03-01 16:54:06 +00:00
paca70 9eee5e0559 Updates 2003-03-01 16:45:45 +00:00
mits 44ac5310a8 New translation added. 2003-03-01 14:10:43 +00:00
moodler 068e57cebc Courses are forced to have unique shortnames (see bug 299) 2003-03-01 12:52:04 +00:00
moodler b4b7572b9a new strings 2003-03-01 05:16:20 +00:00
moodler 14bdb2387a Sort question list by question type 2003-03-01 05:11:44 +00:00
moodler 02986c8002 Can now specify a number of random match questions to create automatically
during import.
2003-03-01 05:08:03 +00:00
villate 7169069bd5 Initial translation. 2003-02-27 19:27:06 +00:00
moodler 45930f2db5 Add support for Taiwan Chinese 2003-02-27 12:15:00 +00:00
moodler 3e7542449b Removed save_session() - no longer necessary 2003-02-27 02:49:18 +00:00
moodler 7a361c8b55 Removed save_session() - no longer needed. 2003-02-27 02:46:37 +00:00
moodler 55271c3047 Removed save_session() - no longer needed 2003-02-27 02:43:34 +00:00
moodler 08c17336a7 Fixed $USER and $SESSION to be pointers to the real $_SESSION
variables, so there's no longer a need for save_session  (thanks,Petri)
2003-02-27 02:38:55 +00:00
paca70 4e94d2608b updates 2003-02-26 19:18:56 +00:00
moodler ff20ee79f6 Use caching if necessary, so that teachers can't lock themselves out
accidentally during the current session.
2003-02-26 05:58:44 +00:00
moodler d92a53d182 No need for ismainteacher() ... it's enough to check that the user is
a teacher in a course, and a creator.
2003-02-26 05:55:31 +00:00
moodler c0f271aa5c Cleanups for course creator. 2003-02-26 04:18:46 +00:00
villate 12faa2684e Fixes the name of the "eachuserforum" type. 2003-02-25 17:39:06 +00:00
villate f8b8aa347b Initial translation. 2003-02-25 17:30:18 +00:00
villate 111f984300 Fixes an HTML syntas error. 2003-02-25 17:07:57 +00:00
villate ab202116b9 Initial translation. 2003-02-25 17:06:37 +00:00
moodler f02ca41cca Removed space from end of file 2003-02-25 17:04:40 +00:00
moodler 06334957fa Complete translation into Slovak! From Pavol Jackulik. 2003-02-25 16:54:07 +00:00
villate 66d323459e Translate "post" as "mensagem", "isolated knowledge" as "aprendizagem
individual" and "connected knowledge" as "aprendizagem colectiva".
2003-02-25 16:52:20 +00:00
villate 7dd3b70b10 A few changes in the translation 2003-02-25 16:08:58 +00:00
moodler 610b9de6f7 Draft-only version from Les 2003-02-25 12:43:56 +00:00
paca70 d7466bdecb Redirect teachers to course after coursecreation. 2003-02-25 10:45:37 +00:00
paca70 44996d00f9 Fixed some typos 2003-02-25 10:31:59 +00:00
paca70 38620c460b One strange 'o' jumped in.. 2003-02-25 07:24:48 +00:00
moodler 5b337cdf3b No need for course creators to have a link to the admin page. 2003-02-25 04:22:57 +00:00
moodler 38972a40a4 Some English spelling/grammar fixes. 2003-02-25 04:03:49 +00:00
moodler 8b2fc31ce0 Fix link in admin links 2003-02-25 03:57:14 +00:00
moodler 2fdb54b819 Fixed bug in table creation - (it was creating a null table!) 2003-02-25 03:53:50 +00:00
moodler 0ca1825cab Tidied up some of Petri's code :-/ 2003-02-25 03:46:06 +00:00
paca70 ea81ca5f6d README updates 2003-02-24 21:09:53 +00:00
paca70 6c891932c0 Some updates 2003-02-24 20:06:53 +00:00
paca70 9f9f92c6df Updates to Finnish translation and some correction to English one. 2003-02-24 19:00:39 +00:00
paca70 1924074c76 Added support for nonadmin course creation.
Course creators are managed by /admin/creator.php , same way that admins.
Or if authetication module have 'auth_iscreator'-function (right now only ldap-module have) ,
users are added to creators at login time.
2003-02-24 18:48:55 +00:00
moodler 38b68c5d6f More detail, clearer description 2003-02-24 10:45:49 +00:00
moodler 86bce68fa8 New table for Postgres 2003-02-24 10:42:07 +00:00
moodler 95dbc030a8 First version of code to implement new "Random Matching" type
of questions.  These use 2 or more short answer questions at
random to construct a questions where you have to match
answers to questions.  Only lightly tested so far.

Quiz questions can now be edited with Richtext editor.

Sundry little fixes along the way.
2003-02-24 10:37:56 +00:00
moodler 2b051f1c8e Changes to modify_database() so it works with string input 2003-02-24 09:36:15 +00:00
moodler ee0e5d57e2 Two new functions for randomizing arrays 2003-02-24 09:34:10 +00:00
moodler 663f70777a Restored Davide Suraci info 2003-02-21 09:19:22 +00:00
moodler 8f8e4f01b0 Updates and fixes, mostly from Paolo Lariccia. 2003-02-21 09:07:44 +00:00
paca70 652fd67246 Reverted to older version, those changes should never got to CVS. 2003-02-20 22:09:59 +00:00
paca70 f9a14cc720 Show creation option when available. 2003-02-20 21:55:14 +00:00
paca70 5f2c35db18 Added support for usercreation from Moodle to authentication module.
Works currently only with ldap-module (tested with e-directory), but
 other modules could be extended too by
adding following functions:

function auth_user_exists ($username) {
//returns true if given username  already exists on authetication database
}

function auth_user_create ($userobject,$plainpass) {
//create new user to authentication database
//in inactive state (if posible)
//returns true if user is created
}
function auth_user_activate ($username) {
//activate external user  after email-address is confirmed
//returns true if user is activated
}
2003-02-20 21:39:51 +00:00
moodler 47623d4f8f Portuguese, first version, contributed by Jaime Villate. 2003-02-19 11:12:22 +00:00
paca70 5443a18b8f Finnish installation instructions. 2003-02-18 22:52:55 +00:00
paca70 4c398dda96 updates
CV: ----------------------------------------------------------------------
2003-02-18 10:20:42 +00:00
paca70 79ba7581de Fixed some typos and making translation more consistent. 2003-02-18 08:41:49 +00:00
moodler 5a4d292bca Added changes to table_column from Petri Asikainen for Postgresql 7.3 2003-02-18 07:44:26 +00:00
moodler c2a96d6b32 Fixes for the use of LIMIT in SQL for Postgres 7.3 (from Petri Asikainen) 2003-02-18 03:16:07 +00:00
paca70 e10ed4f09f updates 2003-02-17 22:19:38 +00:00
moodler 14c7248d3c Select all 2003-02-17 18:14:06 +00:00
moodler a01b257195 Little changes 2003-02-17 18:13:41 +00:00
moodler dc1dc6e973 Added function to check everything on a page 2003-02-17 17:02:56 +00:00
paca70 035aa1848c updates 2003-02-17 13:35:55 +00:00
moodler 734d2c9887 Fixes to survey_get_responses() to make it work better with PostgreSQL
(from Petri Asikainen)
2003-02-17 08:35:51 +00:00
moodler 2f05b46ec9 Added language menus to top of login pages 2003-02-16 09:42:06 +00:00
moodler a59cbb7851 Update version 2003-02-16 09:25:02 +00:00
moodler 811c88b32f Fix short column 2003-02-16 09:24:25 +00:00
moodler 2a231ed650 Remove English word 'ago' 2003-02-16 09:22:52 +00:00
moodler c4e78a1b60 Tidy up the import screen 2003-02-16 08:03:55 +00:00
moodler 68fefdbe14 Change MC answers to letters a, b, c etc ... 2003-02-16 08:03:17 +00:00
moodler 49220fa70c Various quiz changes. Most importantly is the new framework for importing
quiz questions.   Importing works but is still being tested.
2003-02-16 07:08:57 +00:00
moodler 4270bba267 Fixed navigation link to login page 2003-02-15 02:58:34 +00:00
paca70 01a660a583 Updates 2003-02-12 10:27:21 +00:00
moodler 3f3960656d Fixed link to picture file in print_picture_file 2003-02-11 01:53:10 +00:00
moodler 434f33c00a Fixed license link 2003-02-11 01:35:31 +00:00
rkingdon 402eb657a6 peer graded assignment version 1.01 2003-02-06 21:43:57 +00:00
moodler 40f1246b14 Missing semicolon 2003-02-06 18:07:31 +00:00
moodler de2146b276 Note for something that needs to be fixed 2003-02-06 06:37:10 +00:00
moodler 73f8658c36 Provide the possibility that the format of a text is not defined properly 2003-02-05 12:41:59 +00:00
moodler bcdfe14e02 Whoops, fixed some obvious bugs when getting slash arguments 2003-02-05 10:52:55 +00:00
moodler eaa50dbc83 Removed some redundant code when looking for slash arguments (use me() function instead) 2003-02-05 10:48:13 +00:00
minkowski ac68f7ffc8 Completed Thai Translation 2003-02-04 04:35:17 +00:00
minkowski acf0f21ab1 rephrased quite a number of phrases 2003-02-04 04:12:30 +00:00
moodler ecc114ee3b Add better escaping for double quotes 2003-02-02 02:37:09 +00:00
rkingdon f879140423 peer graded assignment version 1.0 2003-02-01 22:04:27 +00:00
mits 08ffd31db1 New translation added. 2003-02-01 18:28:10 +00:00
rkingdon 49c4b1f779 Peer graded assignment - English Language file version 1.0 2003-02-01 17:53:41 +00:00
moodler 498d403283 Add some timing 2003-02-01 01:36:31 +00:00
paca70 56a4ed732a some updates 2003-01-31 11:05:43 +00:00
paca70 33ff2cca85 *** empty log message *** 2003-01-31 10:43:24 +00:00
moodler fced815cd7 Improved me() function 2003-01-30 15:52:38 +00:00
moodler db11e52dec Allow tags for embedded objects 2003-01-28 03:55:55 +00:00
moodler b35e8568ff Ignore all files and directories beginning with "." 2003-01-28 03:34:26 +00:00
moodler 7750f58e0c Explicitly set the character set 2003-01-28 03:06:52 +00:00
moodler f2e19ba41d Added some missing PHP variables to make it consistent with lib/htaccess 2003-01-28 03:06:20 +00:00
moodler d686bf500b Added some checks for PHP server variables - warnings are printed that
prevent installation until these are fixed.
2003-01-28 02:52:13 +00:00
moodler a09b86a693 Use On and Off instead of 0 and 1 2003-01-28 02:28:17 +00:00
moodler 0d3cbf4cca Changed some settings from "1" to "On" 2003-01-28 02:27:18 +00:00
moodler 1b27d92ad4 Old version of this file ... Ray will replace it shortly 2003-01-27 02:50:34 +00:00
moodler 89600ce15f Don't need this either 2003-01-26 16:59:39 +00:00
moodler 34afe40fb5 Removing English versions in the German lang pack 2003-01-26 16:58:55 +00:00
compuproggy c74a276913 *** empty log message *** 2003-01-26 12:22:09 +00:00
compuproggy a2da49f38b A better german version. Thx to a few modified translations of Michael Schneider 2003-01-26 12:08:01 +00:00
moodler 750ab759ed Slightly better robustness for notice() when there is no referer 2003-01-26 06:04:14 +00:00
compuproggy b49d73511b *** empty log message *** 2003-01-25 13:01:16 +00:00
moodler e79ddee2ad Smaller random number for smaller machines. :-) 2003-01-24 08:47:20 +00:00
moodler 03f06a1412 Remove the ampersand thing ... it was actually a Mozilla display bug. :-) 2003-01-24 08:41:18 +00:00
moodler 9223049919 Fixes to insert_record for inserting null values.
Also some unfinished changes to table_column ... not recommended for use right now
2003-01-24 07:51:55 +00:00
moodler 54d0590b47 Robustness fixes 2003-01-24 07:48:54 +00:00
moodler eb58acca4d New sessiontimeout config variable to set the timeout for sessions 2003-01-24 04:31:58 +00:00
moodler 7d8f674dea Implemented a safer version of stripslashes called stripslashes_safe.
This will only fix these three cases:

  \'
  \"
  \\

and leaves all other backslashes alone.  Should fix problems in forums
and forms where backslashes were sometimes disappearing from windows
paths like C:\temp - usually only in the richtext editor, but still.
2003-01-23 13:07:49 +00:00
moodler f3e48e6ef0 Solve this silly mpersand display problem 2003-01-23 05:03:27 +00:00
moodler 66fef9f99f If comment contains quotes then it can cause problems when
an assignment is uploaded.  Bug fixed by Ray Kingdon.
2003-01-23 04:23:05 +00:00
moodler 48d38fad63 Some robustness fixes 2003-01-23 02:50:38 +00:00
mits 878ece7eca New translation 2003-01-22 18:39:17 +00:00
mits 04222f70a3 no message 2003-01-22 18:38:19 +00:00
mits 5ca400f257 no message 2003-01-22 14:27:45 +00:00
mits 071df54ffd Modify strftime format for more natural Japanese way. 2003-01-22 14:26:35 +00:00
moodler dd98f2e261 Ignore the fonts folder 2003-01-22 12:03:22 +00:00
moodler 1042139455 Adding correct character set for Japanese.
These pages have to specify this stuff manually so that they work
even when not displayed within Moodle.

Nice job on the install translation, Mits!
2003-01-22 05:34:25 +00:00
moodler a42fcc51cb Removed all additional stuff for now 2003-01-22 04:15:29 +00:00
moodler 9f44d972c7 Add slashes to data pulled out of external source, just in case O'Brien logs in :-) 2003-01-22 01:55:54 +00:00
mits 5c71840819 New translation 2003-01-21 19:09:22 +00:00
moodler 7ba3fb64c9 More changes ... can't mess with the GPL. :-( 2003-01-21 16:13:23 +00:00
moodler cfe22ac921 Clean up 2003-01-21 13:22:05 +00:00
moodler eca6a3b781 Even better :-) 2003-01-21 12:57:10 +00:00
moodler 2d05c39303 Further rewording ... it's getting better I think. 2003-01-21 11:46:03 +00:00
moodler a43d392c69 Some info about this directory 2003-01-21 09:21:20 +00:00
moodler d60131c3c9 Changes to use fonts in language packs, and also to use a language
decoding function if necessary
2003-01-21 09:17:10 +00:00
moodler f6e653e06a Moved fonts into language pack so that other languages can have
proper displays in graphs
2003-01-21 07:27:01 +00:00
moodler bc43adf16d Slight changes to the wording of this new stuff 2003-01-21 04:52:17 +00:00
moodler b1e6dcb26c Rewritten for clarity 2003-01-21 03:08:37 +00:00
moodler ce9f2be2f9 Added new clause to Copyright about the use of Moodle logos. 2003-01-21 02:33:48 +00:00
moodler 86b32d51d9 Fixed a string 2003-01-20 15:55:41 +00:00
moodler 7d2e5b6595 Remove name on submit button 2003-01-20 15:43:09 +00:00
moodler 4e2767f8e0 Add times 2003-01-20 14:23:09 +00:00
moodler 17654e3845 Use $CFG->directorypermissions for new directories 2003-01-20 14:04:33 +00:00
moodler 63dddf351a Better control over directory permissions: $CFG->directorypermissions 2003-01-20 14:04:06 +00:00
moodler 2e6d42735f Added new configuration value $CFG->directorypermissions to set the
permissions for new directories created in dataroot
2003-01-20 14:03:11 +00:00
moodler 5a99c0de4d Fixes to make it work on safe mode servers, but also better control of
directory/file permissions.
2003-01-20 13:40:02 +00:00
moodler de5aabd2d2 Password had no default 2003-01-20 09:30:24 +00:00
moodler 0f61744597 Language editor uses current language (ie even the session language) 2003-01-20 09:28:38 +00:00
moodler 832ead4969 Fixed times 2003-01-20 09:23:06 +00:00
moodler 28e30091f0 Always. 2003-01-20 09:03:35 +00:00
moodler 25786a263a Throw away session language when logging in (use users language instead) 2003-01-20 09:00:36 +00:00
moodler caf7ccd44f Info 2003-01-20 08:51:50 +00:00
moodler 2fafa4bf31 Robustness fixes 2003-01-20 08:49:00 +00:00
moodler a53f918172 SOme more fixes - needs more 2003-01-20 08:40:41 +00:00
moodler b9fcddd16d FIxed some acutes 2003-01-20 08:38:30 +00:00
moodler 789a2500eb Slightly better formatting ... needs work still I think 2003-01-20 08:22:53 +00:00
moodler 3e9b5d5a90 Moved session lang setting into setup.php (works on all pages) 2003-01-20 08:09:25 +00:00
moodler 858156a995 Take session language into account when setting locale 2003-01-20 08:06:09 +00:00
moodler a38e24a544 Rearranged menu 2003-01-20 08:03:32 +00:00
moodler a5e3644bd2 Add setting of language to home page, and setting of new user accounts
to whatever the current language is.
2003-01-20 08:01:46 +00:00
moodler 0b949a6d0c Whoops, forgot a debug statement 2003-01-20 07:30:47 +00:00
moodler 1f3eb3191a More robustness on recover-password stuff 2003-01-20 07:16:23 +00:00
moodler 4028fcb159 Added Rodrigo 2003-01-20 07:13:25 +00:00
moodler 37208cd23a Some robustness 2003-01-20 07:13:02 +00:00
moodler dde4495df4 Update the version 2003-01-20 07:11:39 +00:00
moodler dc8791f367 Undoing recent change to insert_record() because of some problems 2003-01-20 07:10:14 +00:00
moodler 207190aa87 Make sure config array is always initialised before use 2003-01-20 06:43:44 +00:00
moodler c9d4e6da89 Remove old doclang variable 2003-01-19 12:37:56 +00:00
moodler 3db3acfb99 Instead of using doclang, use $SESSION->lang, and make it override other
language settings.  This should fix documentation display, but also will
be how setting registration languages and login languages works
2003-01-19 12:32:55 +00:00
mits 69ae05837c New translation 2003-01-19 12:00:06 +00:00
mits ecb1e78aaf no message 2003-01-19 11:26:28 +00:00
moodler a7e838796a Rogue tabs 2003-01-19 06:07:05 +00:00
moodler fe2874294c If we create a directory, then chmod it to protect the contents. 2003-01-19 05:54:08 +00:00
moodler 3c72e2f9c9 Some changes to insert_record to help Postgres 7.3 2003-01-19 05:46:49 +00:00
moodler e01b5c0e77 Small fix to make this script more usable on Multi-Byte languages like zh_hk 2003-01-19 05:25:31 +00:00
moodler b5fdd4c60a Updates 2003-01-19 05:05:45 +00:00
moodler 842b894b91 New translation Argentinian Spanish from Rodrigo Vigil 2003-01-19 04:57:25 +00:00
moodler 67c6f56f05 New updates for Spanish (esp. all-new help files) from Antonio Navarro 2003-01-19 03:42:29 +00:00
moodler 7fb92a3388 Changed Czech code 2003-01-19 01:23:53 +00:00
coolbit 59e6addbc9 add some new strings 2003-01-18 15:50:06 +00:00
moodler 2e43b5d987 Better notification and continue button is more useful 2003-01-18 14:24:40 +00:00
coolbit 319aa49306 update date formats 2003-01-18 14:20:22 +00:00
moodler 8f94fbcd4a Add slashes when printing correct Windows path to problems with backslashes 2003-01-18 14:05:52 +00:00
mits a9630e4f60 no message 2003-01-18 09:29:28 +00:00
mits ca791cb4a5 New translation added. 2003-01-18 09:26:55 +00:00
moodler cf194fc831 Latest updates - compatible with 1.0.8 2003-01-18 03:30:57 +00:00
moodler fdf5a1e2fb Changes to Course catagery editor to prevent duplicates 2003-01-17 02:03:42 +00:00
moodler 41b95af210 Strip slashes from short answers before comparing 2003-01-16 15:19:49 +00:00
moodler 536d3e22be Added Wales 2003-01-16 12:17:45 +00:00
moodler 722d4d1e14 Cleaned up the logic a bit 2003-01-16 11:57:34 +00:00
moodler d57bc55729 Updating the date 2003-01-16 04:06:23 +00:00
mits 83948780bc Update for New Date formatt. 2003-01-16 03:58:06 +00:00
moodler 2e41586e07 Added default date/time strings to all languages.
All European languages have now been changed to 24 hr time,
because AM and PM were not being displayed correctly.

Language editors should check these strings to see if there is
a more natural way to format these dates in their language.
2003-01-16 03:15:21 +00:00
moodler 7f43f576fc Updates from Hans de Zwart 2003-01-15 15:07:23 +00:00
moodler 7684f1efcc Minor fix with display of %% in language strings 2003-01-15 11:28:54 +00:00
moodler dcde9f020a Displayed time formats are now stored in lang files
(see the new strftime* strings) so they can be customised per language
2003-01-15 10:55:54 +00:00
moodler 9277dbd42d Bummer ... I introduced a new bug in 1.0.8.1 with pathinfo. Fixed. 2003-01-15 05:32:14 +00:00
moodler 1c418003d7 FIxed logic problem when checking has_default variable in the database
when inserting new data
2003-01-14 15:36:20 +00:00
moodler 7af6281f22 Don't bother working with empty course modules (can happen when an
module is uninstalled improperly)
2003-01-14 14:56:57 +00:00
moodler 2c104c0152 Fixed redirection when user not completed yet in some instances when
using external authentication
2003-01-14 14:54:45 +00:00
moodler ac0ac75240 Made this a bit clearer 2003-01-14 11:24:43 +00:00
moodler c078c29bb2 For assignments without a timemodified stamp, add one when graded 2003-01-14 03:01:10 +00:00
moodler dfcfb72876 Removing these files again 2003-01-14 01:47:27 +00:00
compuproggy a9a55d693e *** empty log message *** 2003-01-13 21:00:56 +00:00
moodler ab387834ab Development phase .. hold on to your hats! :-) 2003-01-13 15:26:57 +00:00
moodler 9ae687afb0 A little more robustness 2003-01-13 14:11:05 +00:00
moodler d98228e497 More checks to solve support requests before they happen. 2003-01-13 14:05:29 +00:00
moodler 13770d0c36 More fixes for robustness 2003-01-13 12:16:46 +00:00
moodler 11159c3c60 Fixed some PHP warnings 2003-01-13 12:14:47 +00:00
moodler 1063d08854 Add info that may help solve a bug on some old servers 2003-01-13 12:06:33 +00:00
moodler bcb5c5095e Fixed the default locale 2003-01-13 10:03:17 +00:00
moodler 94e3411897 Slightly more robust function 2003-01-13 02:42:57 +00:00
moodler 03c17ddfec Fix for dates (the last?) 2003-01-13 02:37:47 +00:00
moodler 3fb5b92095 RELEASE 1.0.8.1 2003-01-12 07:16:33 +00:00
moodler 29f18614e2 Updated version and release notes 2003-01-12 07:11:44 +00:00
moodler 6ed3da1da4 Cleaned up file argument processing a bit 2003-01-12 06:53:25 +00:00
moodler 1685298e60 Removed a line from config.php 2003-01-12 06:31:07 +00:00
moodler 105afdcb2e Daily changes 2003-01-12 03:35:58 +00:00
moodler 353439a354 Slight cleanup 2003-01-11 14:01:39 +00:00
moodler 6b72b9a911 A small standalone test program to test session support 2003-01-11 13:58:17 +00:00
moodler 704ac9fe76 Slightly clearer documentation 2003-01-11 05:29:49 +00:00
moodler bee00f48aa Closing sessions may fix some problems on WIndows/CGI systems ... 2003-01-11 03:03:54 +00:00
moodler 4738ab0d37 Daily changes 2003-01-10 13:47:48 +00:00
moodler f8c898243d Editing with Richtext wasn't working ... fixed now (typo) 2003-01-10 13:07:41 +00:00
moodler f978ad0acb Put in a check for the sessions directory 2003-01-10 07:33:26 +00:00
moodler d96b410816 More details about requirements 2003-01-10 07:22:34 +00:00
moodler 6c14c3948f PLease read the README.txt in this directory 2003-01-10 06:29:40 +00:00
moodler 61dcfc31e0 Updated version number 2003-01-10 05:50:34 +00:00
mits 5af670da9a no message 2003-01-10 05:44:51 +00:00
moodler 3db75c62fc Fix when making timestamps from web selector 2003-01-10 05:41:20 +00:00
moodler 39e018b338 Fix for display of date selector, and also for finding server name from
environment
2003-01-10 05:40:35 +00:00
mits a6602862fb Modified 2003-01-10 05:29:31 +00:00
moodler c897eac5e4 Some small robustness things, and a new style for quiz feedback text 2003-01-08 09:08:05 +00:00
moodler 1079c8a872 More robust when dealing with a plugin module that isn't readable 2003-01-08 09:07:07 +00:00
moodler 4e080c888a Missed something 2003-01-07 14:52:51 +00:00
moodler cd8ecdb0b9 Fixed typo 2003-01-07 14:48:06 +00:00
moodler af4542c29e Cleaned up, and improved the logic to avoid very rare case
when secret keys matched on two users
2003-01-07 14:46:12 +00:00
moodler 7dba8c384f Whoops forgot the date 2003-01-06 14:17:05 +00:00
moodler 8375fe4f88 More touch-ups 2003-01-06 14:15:45 +00:00
moodler 5cc1aff3db Robustness fixes 2003-01-06 14:01:56 +00:00
moodler ce78926df0 Small robustness fixes 2003-01-06 13:55:37 +00:00
moodler 8af3e37948 Slight increase in log field size 2003-01-06 13:40:05 +00:00
moodler 5be03da1e8 New file 2003-01-06 12:36:35 +00:00
moodler 0b963b9041 Tidying up old files 2003-01-06 12:36:08 +00:00
moodler 8d61f85e32 Update 2003-01-06 12:31:39 +00:00
moodler df8dd5f479 New strings from Fabricio 2003-01-06 12:29:52 +00:00
moodler 432809b1d6 Updating version to get ready for tonight 2003-01-06 09:29:06 +00:00
moodler 5674507b4d Slightly more rboust 2003-01-06 08:47:57 +00:00
moodler 58d6d79145 Default values 2003-01-06 08:44:03 +00:00
moodler 042a64f050 Missing file 2003-01-06 08:42:59 +00:00
moodler 72ae3a0eb4 Updates 2003-01-06 08:42:08 +00:00
moodler 20f47494ae Framed docs can now select a named anchor in a page 2003-01-06 08:23:36 +00:00
moodler bfe89310ce Link from admin page to docs 2003-01-06 08:23:13 +00:00
moodler 1b73ea5799 Link from themes page to themes docs 2003-01-06 08:22:49 +00:00
moodler c4028ac12b Garden theme by spiggy: http://phpgirl.com 2003-01-06 07:39:19 +00:00
moodler a657c48b96 A little fix to workaround what seems to be an ADOdb bug when using
database authentication
2003-01-06 05:37:26 +00:00
moodler 57b0a28bfa Latest versions from Sebastien 2003-01-06 03:28:44 +00:00
moodler f24a9b78eb String changes 2003-01-06 02:57:09 +00:00
moodler d9a9064e27 More rogue strings 2003-01-06 02:56:48 +00:00
moodler 3bd402300e Shot down some rebel strings 2003-01-06 02:43:50 +00:00
moodler 6a738db7b5 Added 4.3.0 bug compatibility 2003-01-06 01:44:49 +00:00
moodler 654eddf086 FIxed a missing quote, and fixed the highlight colour 2003-01-05 16:46:29 +00:00
moodler e2b5b53e46 READ ME ;-) 2003-01-05 16:34:34 +00:00
moodler 25a3810f01 Removing unnecessary English versions of these files (see README) 2003-01-05 16:33:52 +00:00
moodler 1ccee9fdc3 Updated 2003-01-05 16:15:25 +00:00
moodler d768dee320 Update versions 2003-01-05 14:23:30 +00:00
moodler b20f74c94a Rmove bad coursemodule error - not important enough to show 2003-01-05 14:20:33 +00:00
moodler b0e3a92523 Clean sweep through all the important changing all include(), include_once()
and require() to require_once()
2003-01-05 14:19:20 +00:00
moodler af60ea8a86 Fixed a link 2003-01-05 13:19:21 +00:00
moodler 8b3235f57f Fixes to use new mysql module with frame 2003-01-05 12:00:57 +00:00
moodler bdd2e029a0 Fixes dependency on standardlogo 2003-01-05 11:08:21 +00:00
moodler c07e87c6ee New standard white theme 2003-01-05 11:02:51 +00:00
moodler 6422da3570 Smaller image and links break out of frames 2003-01-05 10:23:49 +00:00
moodler 92a419a25c Make frame width a variable 2003-01-05 10:10:05 +00:00
moodler 5dc09fb6ee Cleaned things up somewhat and made it more generic 2003-01-05 09:53:30 +00:00
moodler 8bbba2486c Initial version of "Poweraid" theme from Bjarne Varoystrand aka Black Skorpio
with a few half-finished changes ... still needs work which I'm doing right now...
2003-01-05 07:23:04 +00:00
moodler f5789d86aa Updating to current info 2003-01-05 07:04:24 +00:00
moodler 7d0d7f4665 Initial version by Tom Murdock 2003-01-05 07:02:39 +00:00
moodler ed5e0c04ae More info 2003-01-05 06:52:55 +00:00
moodler f8b3c31f28 Update the version 2003-01-05 06:46:21 +00:00
moodler 607809b3ba OK a number of small changes here.
Firstly, I'm replacing all use of old-style global variables like
$HTTY_REFERER with their new-style equivalent $_SERVER["HTTP_REFERER"]
Also using $_POST instead $HTTP_POST_VARS  etc

Secondly, if gdversion == 0 (ie GD is not installed) then:

 - users are not even allowed to upload new images
 - graphs now just print a message instead of failing.

this allows Moodle to still be used even if GD is not present
2003-01-05 06:45:20 +00:00
moodler 3b7c1de95e Changes to improve robustness of uploads, and make things compatible
with PHP 4.3.0.  Also some translation fixes with upload strings.
2003-01-05 04:20:32 +00:00
moodler 8556ae8641 Language credits 2003-01-05 04:19:35 +00:00
moodler 087b81fc86 Updated Dutch strings. 2003-01-05 04:14:45 +00:00
paca70 da95fdd658 checkin for translation 2003-01-04 17:20:10 +00:00
paca70 fcbea507c4 Just checking in for translation. 2003-01-04 17:16:37 +00:00
paca70 0b9e04f07e more updates 2003-01-04 17:09:00 +00:00
moodler 70d4cf8267 Ah!! At last, the dreaded off-by-one date bug, squashed. 2003-01-03 16:58:37 +00:00
moodler 89885b582d Upgrade version for Beta Test version 2003-01-03 16:38:46 +00:00
moodler 17e6df458d Fixed display of headers while updating modules 2003-01-03 16:35:51 +00:00
moodler 1d2603b1e3 Make sure grades are always rounded 2003-01-03 16:05:44 +00:00
moodler a2fe7cc0dc Changed three fields to avoid SQL problems with PostgreSQL etc:
quiz_truefalse:  true->trueanswer  and false->falseanswer
quiz_questions:  type->qtype
2003-01-03 16:01:48 +00:00
moodler a3fb1c450a New function table_column() to add or alter a column in any database. 2003-01-03 15:31:30 +00:00
moodler d2d7c864de Mention language count 2003-01-03 14:39:13 +00:00
moodler 3cc9937d3c More stuff 2003-01-03 13:05:40 +00:00
moodler e53b0823ab More robust checking of returned $rs 2003-01-03 06:44:35 +00:00
moodler 8663bfdb08 Display months in local language for date_selector 2003-01-03 06:43:12 +00:00
moodler 15ac90653d Replaced &sect with &amp;sect to avoid some buggy browsers 2003-01-03 05:33:17 +00:00
moodler a86b60ddd9 Changed a link 2003-01-03 03:25:48 +00:00
moodler 3250c50889 Removed German help files 2003-01-03 03:03:19 +00:00
moodler 5f55de1007 New Dutch translation from Hans Zwart and Jacob Romeyn! 2003-01-03 02:54:50 +00:00
moodler 14217044a5 Some little fixes 2003-01-02 15:25:51 +00:00
moodler 5422d75fcb Hmmm database name causing some problems ... 2003-01-02 15:12:34 +00:00
moodler e1bf736ffa Fixed that damn www linking problem with words like wwwroot :-) 2003-01-02 14:54:33 +00:00
moodler 36b4f9852e buggy_referer is dead! Long live buggy_referer!
Should be fixed now.  As a bonus, I've removed all the uses of
HTTP_POST_VARS from all scripts.

All forms should use the new data_submitted() function to collect
form data (it does the match_referer thing internally now).

Much nicer.
2003-01-02 14:49:23 +00:00
moodler fb964e0c78 Some robustness fixes. 2003-01-02 13:08:20 +00:00
paca70 ba79f7429e Some updates, more to come. 2003-01-02 12:45:39 +00:00
moodler fa3ba0f6c1 Slightly more efficient way to open the database connections 2003-01-02 11:34:00 +00:00
moodler c030ab7078 More details... 2003-01-02 11:13:01 +00:00
moodler 7adcd58f82 Prepend database name to all table names to avoid ADOdb bug when there
is multiple database connections at once.
2003-01-02 11:09:03 +00:00
moodler 24cd45467f Site news forum defaults to the "Site news" string 2003-01-02 10:54:00 +00:00
moodler 9c2c5c5bd0 Use the name of the Site News forum on the front page ... instead of the
"Site News" string ...
2003-01-02 10:48:01 +00:00
moodler 51ba6ad642 Define forum type all the time 2003-01-02 10:46:52 +00:00
moodler 42a986b23a Looking like a beta 2003-01-02 10:38:08 +00:00
moodler 61e96406df Robustness fixes 2003-01-02 10:35:11 +00:00
moodler ac5d88ebe9 Ignore guest when checking imcomplete users 2003-01-02 10:32:51 +00:00
moodler 819df380a3 Initial version of Thai translation, by M Minkowski :-) 2003-01-02 07:55:40 +00:00
moodler 5b4fd9c20a Allow phpinfo() debugging to occur even if Moodle isn't configured yet
(to help with configuration problems!).
2003-01-02 07:37:28 +00:00
moodler 33e5f52c01 Removing english versions 2003-01-02 06:52:27 +00:00
moodler 6846ee2da5 Removing files 2003-01-02 06:51:56 +00:00
moodler a44d18e70e More consistency when printing editing stuff in section 2003-01-02 06:44:20 +00:00
compuproggy 6af88ac7a2 *** empty log message *** 2003-01-02 06:38:36 +00:00
moodler 106140f7d1 New frame mode for dox 2003-01-01 15:13:56 +00:00
moodler b79f41cd42 Robust fix 2003-01-01 15:13:21 +00:00
moodler e18b68b0b6 Updates. That's it for features now. :-) 2003-01-01 15:12:29 +00:00
moodler 8e6c87ccf3 Teachers can choose to allow review of quizzes, which means that students
are allowed to see past quizzes.  This only works once the quiz is completely
closed (to perhaps prevent easy cheating).
2003-01-01 14:47:11 +00:00
coolbit d78ab28640 no message 2003-01-01 13:41:08 +00:00
moodler 8ac3158791 Robustness fixes 2003-01-01 13:17:27 +00:00
moodler 0c106cd3ab Don't try to display docs files if they don't exist. 2003-01-01 12:03:15 +00:00
moodler fdb57a7473 Updated with more info 2003-01-01 11:53:39 +00:00
moodler 2f7566090f Necessary file for documentation to work! 2003-01-01 11:26:50 +00:00
coolbit cb573b2647 no message 2003-01-01 10:16:19 +00:00
moodler b6bae251a1 If prefix isn't defined in config.php then define it as "" to avoid
problems with upgraders who don't edit config.php
2003-01-01 09:29:05 +00:00
moodler 6fbf8d8fe8 Default debugging 2003-01-01 08:48:15 +00:00
moodler e29fa0c8e2 Add default prefix (for tables) of "" for upgraders 2003-01-01 08:33:22 +00:00
moodler 1c0200e074 More little robustness things 2003-01-01 08:21:19 +00:00
moodler db70b54b62 Better log_display fixes 2003-01-01 08:15:55 +00:00
moodler 14e4a496b4 Updates for log_display stuff 2003-01-01 08:08:44 +00:00
moodler 30d6173ed6 Fixes for Log display 2003-01-01 07:37:19 +00:00
moodler 7f7f2cca29 Robustness 2003-01-01 07:18:43 +00:00
moodler 13469b820d Introduce links to personal grade page 2003-01-01 07:03:23 +00:00
moodler 1df0ab5d8d Cleaned up a bit 2003-01-01 06:53:00 +00:00
moodler b0cef1ec45 Grade display for current user 2003-01-01 06:42:11 +00:00
moodler c2045f3436 Changes for robustness 2003-01-01 06:41:35 +00:00
moodler d2cded302b New strings for publishing results 2003-01-01 06:40:55 +00:00
moodler 346b1a2483 Tweaks 2003-01-01 06:40:31 +00:00
moodler f747744495 More robustness fixes 2003-01-01 06:34:54 +00:00
moodler 6d6c938999 New feature: choices can now be published (like polls) with names
or without.
2003-01-01 06:34:13 +00:00
moodler 366287b705 Old file 2003-01-01 05:39:30 +00:00
moodler a7514c09e6 More tweaks 2002-12-31 08:50:24 +00:00
moodler 50c4bd4145 More robustness, and some little bug fixes.
Also, database module now supports md5 passwords
2002-12-31 08:45:37 +00:00
moodler f53af9410c Better checks during membership checks 2002-12-31 07:16:52 +00:00
moodler 5eda92d0e2 Little robustness fixes 2002-12-30 15:47:54 +00:00
moodler 814ada432c Fixes to XLS routines that were causing some problems 2002-12-30 15:46:15 +00:00
moodler 86d6449306 Allow "." and "-" in usernames. 2002-12-30 15:38:10 +00:00
moodler 808a3baaf8 If a user has authenticated via external authentication, then FORCE them
to fill out the user profile form (is they can't do anything else until
this is done)
2002-12-30 15:30:05 +00:00
moodler 6dd38d4656 Allow STRIKE tag 2002-12-30 13:02:21 +00:00
moodler 149f85f035 Robustness fixes 2002-12-30 06:07:03 +00:00
moodler bdece65d72 More debugging 2002-12-30 05:31:54 +00:00
moodler 47f1da80d0 More little fixups for robustness 2002-12-30 05:13:43 +00:00
moodler c04c41c7d2 Many little fixes and cleanups for robustness 2002-12-30 05:10:01 +00:00
moodler b9b8ab696f Fixed p() and s() to deal with zero better 2002-12-30 03:39:42 +00:00
moodler 0ae5e5ea2d Fix default cursor 2002-12-30 03:38:59 +00:00
moodler b3fa6684ea Fixes to insert_record (from Petri) to explicitly use field default
values if we know them from ADOdb, to avoid some problems with PostgreSQL 7.2 onwards
2002-12-30 03:25:48 +00:00
moodler 4fd7ccc0fe New "debug" variable to turn debugging on and off 2002-12-30 03:24:07 +00:00
moodler 932e472fdc Daily changes 2002-12-29 17:41:18 +00:00
moodler 9c9f7d7790 Various little fixes to remove warnings (usually about empty variables)
when error_reporting is turned up to 15 or so ... more of these to come ...
2002-12-29 17:32:32 +00:00
moodler a900458749 It's now possible to choose a documentation language on the fly! 2002-12-29 16:28:41 +00:00
moodler 18496c590b New get_record_select function (for completeness) and a completely
revamped update_user_in_db() function
2002-12-29 16:28:09 +00:00
moodler cae7436602 Use session-specified language if possible 2002-12-29 16:26:44 +00:00
moodler b01597c807 Cleaned up files using new admin/lang.php 2002-12-29 16:23:48 +00:00
moodler d558a7b5d1 Cleaned up some strings without quotes 2002-12-29 16:15:41 +00:00
coolbit 8c05e98c41 remove them and wait for new translations 2002-12-29 15:33:39 +00:00
moodler 753db9ace7 Clearer info 2002-12-29 15:12:45 +00:00
moodler 3cae82fe52 Adding this back again to help brand-new installations and to keep
some old links alive.
2002-12-29 15:06:31 +00:00
moodler 235bb050c5 Better way to include initial intro.html 2002-12-29 14:43:49 +00:00
moodler 9bd2c8741c New function document_file() for fetching documentation from language
packs, and a few cleanups to reduce warnings
2002-12-29 14:41:03 +00:00
moodler f1dacb2ed0 Changes to how documentation works. A thin PHP interface now fetches
files from the language packs.  If a file isn't available in the current
language, then English is used.
2002-12-29 14:39:52 +00:00
moodler 4456254798 Added document files to English translation 2002-12-29 14:37:53 +00:00
mits ce0eedfc72 New translation added. 2002-12-29 09:13:19 +00:00
moodler 11e8f20ec4 Accidentally left debugging on 2002-12-29 04:18:09 +00:00
moodler 9d378732e4 More little fixes 2002-12-29 04:17:32 +00:00
moodler 5c63e0c4ee Some changes to remove warnings about empty variables and cleanup 2002-12-29 04:02:42 +00:00
compuproggy fa9ef12118 *** empty log message *** 2002-12-28 21:14:14 +00:00
moodler 92a4b0f180 Fixes to allow the GD detection to work on PHP 4.3.0 (with bundled GD) 2002-12-28 14:45:54 +00:00
moodler 57117c20d5 fixed user --> userid 2002-12-28 13:05:03 +00:00
moodler 05a6c03ed2 Er, unfinished code while upgrading log_display 2002-12-26 17:02:45 +00:00
coolbit 212f17dd08 new docs 2002-12-26 17:01:55 +00:00
moodler 8c8a471356 Added "source" mode in richtext editor 2002-12-26 16:27:44 +00:00
moodler 04fa59d015 Use HTML editor for editing HTML files 2002-12-26 16:26:55 +00:00
ahmed_nabil 5f7ed5ceb3 no message 2002-12-25 13:56:31 +00:00
set_lo f5ff25a482 spelling error vilkor substituted with villkor 2002-12-25 13:35:07 +00:00
set_lo 47149b438d action substituted with swedish aktion 2002-12-25 13:34:25 +00:00
ahmed_nabil d9843ab42d no message 2002-12-24 13:31:33 +00:00
moodler 4fe04be0bd Er... on the cookies I meant. 2002-12-24 10:08:24 +00:00
moodler 7185e073ed Use table prefixes on database too :-) 2002-12-24 10:07:45 +00:00
moodler c23f1c10ca Updates 2002-12-24 09:34:11 +00:00
moodler 29341af700 Updated release notes 2002-12-24 07:29:38 +00:00
moodler f7a5c8fafd Added new "Program" resource type, which allows Moodle to cooperate
with external web applications by passing info about the current
session to them.

Code contributed by Mark Kimes.
2002-12-24 07:01:03 +00:00
moodler 195ad21e96 New documentation for Moodle - new resource type called "Program" 2002-12-24 06:59:13 +00:00
moodler 7e5e076adf No need for forcetables hack any more. Moodle can now detect whether
it has already been installed in the current database (by looking
for all the main tables) and do the right thing.  It doesn't matter now
if there are other tables in the database or not.
2002-12-24 05:39:45 +00:00
moodler e494038ecb Forgot Turkish 2002-12-23 16:16:53 +00:00
moodler 1342d68a8a Tweak 2002-12-23 16:12:44 +00:00
moodler 67fcf6818a Tweak! 2002-12-23 16:10:06 +00:00
moodler d51fb96e98 More up-to-date-info 2002-12-23 16:07:38 +00:00
moodler abf90faf65 More details ... 2002-12-23 15:52:16 +00:00
moodler 97485d0726 More database tweaks and improved access to forum search engine 2002-12-23 15:33:40 +00:00
coolbit 7f8dcc6c02 no message 2002-12-23 15:08:55 +00:00
moodler 4e042a3ee9 Clearer directions. 2002-12-23 14:44:32 +00:00
moodler 99988d1a87 This version installs smoothly for me on PostgreSQL 2002-12-23 14:19:45 +00:00
moodler 31fefa636d More database tweaking ... looking pretty good with PostgreSQL now 2002-12-23 13:48:31 +00:00
moodler a3eea09cc9 More fixes for postgreSQL etc 2002-12-23 11:47:17 +00:00
moodler 6aeec7f8f8 Fixes for log display 2002-12-23 10:27:57 +00:00
moodler b6c38cec93 Slight fixes to headings 2002-12-23 10:18:51 +00:00
moodler ebc3bd2b24 Changes throughout Moodle to remove any reserved words from the
Moodle tables.

ie user -> userid in many tables, plus in user_students
   start -> starttime and end -> endtime

I've just done all this as carefully as I could ... I don't think
I missed anything but it's pretty intensive work and I'd be fooling myself
if I didn't think I'd missed a couple.

Note that this version should pretty much be able to bootstrap itself
using PostgreSQL now ... but this is untested
2002-12-23 09:39:26 +00:00
moodler 1f48942e7d Further SQL cleanups 2002-12-23 07:01:06 +00:00
mits b0cc830305 Modified 2002-12-23 06:50:50 +00:00
mits dcc4f0e83a New translation added. 2002-12-23 06:49:48 +00:00
moodler e323955db8 Changes to use new database stuff 2002-12-23 05:57:05 +00:00
moodler 1d881d926b More moving functions around and removal of hardcoded SQL 2002-12-23 03:07:01 +00:00
mits e99f76e01d Polished 2002-12-22 15:30:58 +00:00
moodler bdc23be0ff CHanges for new database table commands 2002-12-22 13:55:30 +00:00
moodler ba54c0b8ce New Swedish translation by Set Lonnert 2002-12-22 13:32:36 +00:00
moodler 9e12b88eb9 Fixed an error in survey.php in all languages ... colles18hort should be colles18short 2002-12-22 13:26:16 +00:00
moodler 19801b2b21 More little fixups for week 0 2002-12-22 06:45:09 +00:00
moodler 1523be781f Changes to get a more reliable insert ID for any table 2002-12-22 06:33:30 +00:00
moodler d26d7ed0c3 Changes to make things work again :-) 2002-12-22 06:15:44 +00:00
coolbit 62cdef7869 no message 2002-12-21 12:48:24 +00:00
coolbit 469c2cc7d1 no message 2002-12-21 11:39:27 +00:00
moodler 9fa49e22ab Many many changes lumped in here ... not finished yet either.
Basically all the Database functions are in lib/datalib.php
and the web functions are all in lib/weblib.php, so
moodlelib.php is much thinner than it was.

Data functions have been extended ... most old calls will
still work, but now many more SQL commands can be performed
using the datalib functions rather than using SQL.  I'm
currently moving through the whole tree replacing SQL
calls or at least concentrating them in one section of
mod/xxx/lib.php

Still working on forums, quizzes, surveys, resources.

The tree is currently not full working ... some things are
half-completed ... will resume tomorrow.
2002-12-20 14:44:14 +00:00
coolbit 03f13d2207 no message 2002-12-20 12:48:46 +00:00
moodler bdce039ca5 Slight updates such as removing old functions 2002-12-20 07:21:09 +00:00
mits 5a8415734f Polished 2002-12-19 15:54:41 +00:00
mits bfd5649fcc Polished 2002-12-18 14:19:58 +00:00
coolbit 663a621c51 Removed lots of "^M", hu!
Where do they come from?
2002-12-18 13:58:01 +00:00
moodler d5f48b1619 Preset the FULLME variable 2002-12-18 08:08:34 +00:00
mits e310476ae9 Polished 2002-12-18 06:34:40 +00:00
mits 45cbb10388 Polished 2002-12-18 03:08:09 +00:00
coolbit 84275343bd no message 2002-12-17 15:46:21 +00:00
carlesbellver 5736c5fcf4 *** empty log message *** 2002-12-17 13:21:50 +00:00
compuproggy 82fc646799 *** empty log message *** 2002-12-17 07:01:25 +00:00
moodler df28d6c5e6 Contains database functions split-off from moodlelib, just so you can see
what I'm doing ...

Some functions have been extended and cleaned up ...

I need to do more testing on it all before checking in all the other
changed files like moodlelib.php and setup.php
2002-12-17 04:41:18 +00:00
gregb_cc 8caf7e0430 Since the reimplementation of check_php_version will probably never be used, I
have removed it.
2002-12-17 03:04:07 +00:00
gregb_cc 709c0cb359 added in a commented out reimplementation of check_php_version, that will most
likely never be used.
2002-12-17 03:02:53 +00:00
ahmed_nabil fd66477c7d This files is updated after testing phase 1. and After final testing I will update this files again 2002-12-16 15:16:32 +00:00
mits 72af127890 Polished 2002-12-16 06:06:50 +00:00
moodler a4064f5755 Moved the view source button to solve problems with other languages
pushing it off the screen
2002-12-15 17:59:40 +00:00
mits af0aa10fc3 Polished 2002-12-15 17:09:02 +00:00
mits 3ac5d94015 New Translation 2002-12-15 15:31:23 +00:00
moodler 0b0260e7ba Fixes (they were causing errors) 2002-12-15 14:49:49 +00:00
moodler aaa872a9ed Minor editing ;-) 2002-12-15 10:53:36 +00:00
moodler 090e6d1959 Minor editing ;-) 2002-12-15 10:51:05 +00:00
moodler 852b18ff2b New files 2002-12-15 10:41:00 +00:00
moodler 1451da5eed Revised the text on these three pages.
These are ready to translate now.  If you have translated them
before, you may want to compare your translation because there
are some changes throughout.

Sorry if this causes any inconvenience - I try not to rewrite
the help files too much.
2002-12-15 10:31:33 +00:00
coolbit fdd417e212 New Chinese help files! 2002-12-15 10:13:28 +00:00
mits 342c546d99 Modified 2002-12-15 09:30:38 +00:00
mits 323af31737 Added 2002-12-15 09:23:13 +00:00
mits ab430cfd3d Polished 2002-12-15 08:49:15 +00:00
mits 5e22db9e23 Polished :^) 2002-12-15 07:58:08 +00:00
ahmed_nabil b75c36b802 This files is updated without testing. After testing I will update this files again 2002-12-15 06:56:36 +00:00
moodler 393cc5088b Improved course listing display when no courses 2002-12-15 06:00:58 +00:00
mits d2380ec365 Lastmodify updated 2002-12-15 05:00:24 +00:00
mits 035f8397db Polished 2002-12-15 04:58:47 +00:00
mits 33b4ba655f Polished :^) 2002-12-15 04:32:31 +00:00
moodler f6680cfa4a Put a space under the colon 2002-12-15 04:27:51 +00:00
moodler 4181fce9f9 Moved a colon (there's a joke about farts in there somewhere) 2002-12-15 04:26:44 +00:00
moodler fd790dfb55 Database and upgrade files for PostgreSQL 7 support! 2002-12-15 02:41:07 +00:00
moodler a3e175eea5 performance improvement when checking gd version 2002-12-15 02:40:25 +00:00
moodler ca3cf39ee1 Turn off time limits with big SQL commands ... some databases are really slow. 2002-12-14 18:33:37 +00:00
coolbit dee505a1c0 add new help files 2002-12-14 14:30:43 +00:00
coolbit 6d987a67cc some modify 2002-12-14 14:26:34 +00:00
coolbit fa949b2b5c New Chinese help files and update php files. 2002-12-14 09:04:05 +00:00
moodler 93f03cc436 Much cooler way to set the form focus after an error. Sent in by Greg Barnett. 2002-12-14 08:24:34 +00:00
moodler 778c28671a Added new configuration setting "country" to set a default country
for the site.  If this is set then user menus are pre-selected.
eg when signing up or filling out profile after external authentication.
2002-12-14 08:18:18 +00:00
moodler b2a2171f22 Shortened helprichtext phrase for better viewing of post forms on small
monitors
2002-12-14 07:36:19 +00:00
moodler e28a6c7378 Added LI tag (not cascading) 2002-12-13 17:01:16 +00:00
moodler 51e734b85f Some more information about buggy_referrer 2002-12-13 16:10:14 +00:00
coolbit ce3faff837 New Chinese help files! 2002-12-13 13:32:21 +00:00
mits 9c5b4e1587 Add New items. 2002-12-13 10:00:23 +00:00
moodler 8fc6971035 Updates 2002-12-13 09:57:12 +00:00
moodler 8c009049f4 Removed two old strings 2002-12-13 09:55:41 +00:00
moodler 50c5119d82 Notice up top 2002-12-13 09:37:13 +00:00
moodler e57e540ce1 Draft versions of these files ... please do not translate yet! :-) 2002-12-13 09:32:04 +00:00
moodler b0767657a6 New help files ... nothing written in them yet! 2002-12-13 09:09:19 +00:00
moodler 7be475f601 New consistent help buttons for textarea fields throughout all modules 2002-12-13 09:06:30 +00:00
moodler 2e9e77eba0 Tweaks for highlighting 2002-12-13 08:12:14 +00:00
mits 499ab3711e Changed softly :-) 2002-12-13 08:03:35 +00:00
moodler bfca4cffdc Different styles for content when week is highlighted 2002-12-13 07:37:47 +00:00
moodler 541b602d61 More tweaks ... added style for outlinecontent when highlighted (eg current week) 2002-12-13 07:37:13 +00:00
compuproggy 51b578bc6e *** empty log message *** 2002-12-13 06:42:25 +00:00
moodler 6176355393 WHoops ... I'd trashed the background 2002-12-13 04:56:10 +00:00
moodler d8c0083240 Fixed definition of standard styles 2002-12-13 04:54:29 +00:00
moodler 2e91475518 Fixed standard tags .... uses inheritance now 2002-12-13 04:51:56 +00:00
moodler 9984fe99e4 New style classes added to standard themes 2002-12-13 03:29:45 +00:00
moodler 45f21f94d7 config.php not required ... just in case themes move or something ... 2002-12-13 03:15:28 +00:00
moodler 8ab95b7186 Style hooks for print_simple_box 2002-12-13 03:14:49 +00:00
moodler 6daa3c2329 More hooks to hang styles from 2002-12-13 03:14:19 +00:00
moodler 02d35f5503 New themes under construction 2002-12-13 03:12:11 +00:00
moodler c2246cbb1e Some new names ... 2002-12-12 17:55:18 +00:00
mits 2590de4ff4 Polished :^) 2002-12-12 17:26:58 +00:00
mits f1f3b874ce Polished :^) 2002-12-12 14:18:37 +00:00
coolbit 7a6ce5df4c New Chinese help files! 2002-12-12 13:53:32 +00:00
moodler c21f835ac3 Don't even attempt to install the template module 2002-12-12 13:35:10 +00:00
coolbit 1d1b312890 Add space before and after a variable to display normally. 2002-12-12 13:18:22 +00:00
moodler 7f9b57040e Added all the missing help files etc 2002-12-12 13:10:25 +00:00
coolbit 59b888d7fb Change firstname to lastname in email for Chinese custom. 2002-12-12 13:00:40 +00:00
moodler 150e92dcf1 local = en_GB is causing my AM/PM to disappear! 2002-12-12 12:30:09 +00:00
mits 55181cf5a8 New items tralslated.
"highlights missing or empty strings" is great!!
2002-12-12 03:48:26 +00:00
moodler 06c0a76a1d Up to date with English 2002-12-12 03:33:40 +00:00
moodler e3305cc5d9 Better checks when comparing languages. Now highlights missing or
empty strings.  Quick check mode also flags strings when they exist
but are empty.  Larger form space to edit empty strings.
2002-12-12 03:33:12 +00:00
moodler f830b324cf Fixed two missing strings 2002-12-12 03:14:13 +00:00
moodler 31313bfb98 Fixed layout with multiplem categories 2002-12-12 02:58:05 +00:00
moodler 2f99e65049 Slight changes to auth_user_login ... don't accept blank username/passwords
and some minor logic changes
2002-12-12 02:37:35 +00:00
moodler 79e7f21a65 Fixed bad copyright message 2002-12-12 01:27:36 +00:00
mits ccddfeec89 Polished :^) 2002-12-11 19:57:43 +00:00
mits a23b08a360 Polished and add translation "Admin" related. 2002-12-11 19:06:45 +00:00
mits 91de0951af Date updated 2002-12-11 18:26:27 +00:00
mits a7c833d1dd Polished and translated new item "Assign admins". 2002-12-11 17:56:21 +00:00
mits be2946c27c Polished :^) 2002-12-11 17:27:21 +00:00
moodler c78a72fc5b Added a slash. Wow! 2002-12-11 16:30:53 +00:00
coolbit 836c3d0ed6 *** empty log message *** 2002-12-11 16:27:38 +00:00
moodler fbea810cf4 Updating the version for the development phase 2002-12-11 16:13:37 +00:00
coolbit fd6fbbeb0b *** empty log message *** 2002-12-11 16:02:59 +00:00
coolbit 45b1adcf20 *** empty log message *** 2002-12-11 15:46:55 +00:00
mits df6384e2b8 Polished 2002-12-11 15:23:56 +00:00
moodler d7facad81e Modifications from Greg Barnett at Crown College to add more admins.
See http://bugs.moodle.org/bug.php?op=show&bugid=202
2002-12-11 14:59:37 +00:00
ahmed_nabil cc2c8c6dc5 The last entry was translated 2002-12-11 13:50:14 +00:00
mits 5186f85951 Polished 2002-12-11 12:38:13 +00:00
coolbit e7a02c4c73 *** empty log message *** 2002-12-11 12:29:44 +00:00
mits 78774bae0d Polished 2002-12-11 12:24:44 +00:00
mits ae481044f7 Plished 2002-12-11 12:00:28 +00:00
mits a13975e028 Polished 2002-12-11 11:39:18 +00:00
moodler 21f34b5f67 Set the locale to ar_EG 2002-12-11 10:00:41 +00:00
moodler 795976b352 Added Ahmed Nabil as Arabic maintainer 2002-12-11 09:45:28 +00:00
moodler 7434d21a90 New Arabic translation by Ahmed Nabil <ana@harf.com> 2002-12-11 09:42:37 +00:00
mits af554bec95 Add lastmodify and URL(moodle.com -> Resources -> Languages) 2002-12-11 08:26:20 +00:00
mits fff61015b7 Polished 2002-12-11 08:14:05 +00:00
mits 379e2dcbae Polished 2002-12-11 08:06:21 +00:00
mits ad8aa0b9f3 Polished 2002-12-11 08:01:52 +00:00
mits 5f16e54d33 Add Local ja_JP and Polished. 2002-12-11 06:59:56 +00:00
mits 5d0a3181b0 Polished 2002-12-11 06:48:20 +00:00
moodler cf3f6bcc2c Removed makeclass stuff completely. It's now in contrib/crown_college 2002-12-11 06:31:59 +00:00
moodler eac7c90291 Names I'd forgotten 2002-12-11 06:19:50 +00:00
moodler 9e2265f707 Updated some names 2002-12-11 06:02:19 +00:00
moodler bb55809320 Another hint for the Windows users 2002-12-10 17:26:30 +00:00
mits f1d2a92c85 Save with Moodle. 2002-12-10 16:23:50 +00:00
mits 8c6cdfc613 Conflict solved 2002-12-10 16:05:22 +00:00
mits 266873247f "\r\n"(CRLF) removed 2002-12-10 15:46:43 +00:00
moodler 62c5a17de5 First version of Chinese! From Zhang Dexuan, cncoolbit@hotmail.com 2002-12-10 15:45:00 +00:00
moodler e6f10ec582 Theme not working for brand-new setup. 2002-12-10 13:37:37 +00:00
moodler 1355a93af2 Just fixing a wierd text-formatting problem. 2002-12-10 12:52:53 +00:00
mits 208307010c plished 2002-12-10 12:50:25 +00:00
moodler 9c645ce06c I was looking for bugs and reformatted as I went to make the layout
a little more consistent (with Moodle)
2002-12-10 12:08:57 +00:00
moodler 53a290ba03 Changed locale, because it was causing ADOdb to crash!! 2002-12-10 11:49:20 +00:00
moodler 673ada543a Fixed a typo - 'that' -> 'than' 2002-12-10 10:58:34 +00:00
moodler 2db0a31b69 Added locale 2002-12-10 09:59:22 +00:00
moodler 0fa6f59fbd New Turkish translation from M. Cuneyt Birkok, http://birkok.net ! 2002-12-10 09:57:59 +00:00
moodler 31861304ec Changed styles.css to styles.php ... 2002-12-10 09:50:18 +00:00
mits 913dbeb760 polished 2002-12-10 09:19:21 +00:00
mits adfd802f27 Polished 2002-12-10 08:14:56 +00:00
moodler 6ec3aaaf84 Mention all the languages 2002-12-10 07:54:10 +00:00
moodler f5f08e24c1 Fixed a typo rad -> read 2002-12-10 06:39:56 +00:00
moodler 454259a62f More links etc 2002-12-10 06:28:33 +00:00
moodler 8736d429d4 Documentation improvements for CVS and developing in general 2002-12-10 06:17:31 +00:00
compuproggy 0c8106d326 *** empty log message *** 2002-12-10 06:16:42 +00:00
moodler 8a6cafc806 Release of 1.0.7 2002-12-10 03:58:07 +00:00
moodler d34189e123 Added styles for forum posts 2002-12-10 02:48:05 +00:00
mits c6f0c3a455 polished 2002-12-09 21:06:27 +00:00
mits 8e664e00b9 Polished 2002-12-09 20:50:44 +00:00
moodler c6d09f2157 More information 2002-12-09 17:27:21 +00:00
moodler 4ba1e2d42a Increment 2002-12-09 17:08:56 +00:00
moodler bf1969570e Fixed blue a little 2002-12-09 16:21:02 +00:00
moodler 8120317e2e Changes for new styles and scheme 2002-12-09 16:10:57 +00:00
moodler e545445874 More fixes for course formats 2002-12-09 14:07:52 +00:00
moodler da00d31744 Latest Japanese files from Mits. This is now a COMPLETE TRANSLATION!
Well done, Mits.   That's LOTS of work.
2002-12-09 13:53:41 +00:00
moodler 2338465770 Tweak to etxt in box 2002-12-09 13:48:31 +00:00
moodler 920bb7ab2f Fix typo 2002-12-09 13:45:44 +00:00
moodler 1d43ffdeab Font size tweaks 2002-12-09 13:40:18 +00:00
moodler 7541bc3e87 More styles 2002-12-09 13:36:55 +00:00
moodler 21ba1d796b testing wrong thing 2002-12-09 12:12:42 +00:00
moodler 469e5eb18e More style and layout tweaking 2002-12-09 12:09:33 +00:00
moodler 4499b2e273 Slight alteration of colouring on printed posts 2002-12-09 10:49:44 +00:00
moodler 69d1973c07 New string readytosend 2002-12-09 10:48:59 +00:00
moodler 42fddf0237 Finish off topics display 2002-12-09 09:03:15 +00:00
moodler fb23e3cbb9 Slight changes 2002-12-09 08:53:49 +00:00
moodler 9307692fdf Add a javascript confirmation when submitting a quiz attempt 2002-12-09 08:20:19 +00:00
moodler 776dc2709f Allow print_all_courses to have width 2002-12-09 07:52:47 +00:00
moodler d9fd5e8b86 Allow course listing to have specified width 2002-12-09 07:51:31 +00:00
moodler 041b1712c6 Slightly adjust column width 2002-12-09 07:48:12 +00:00
moodler b27f9a32bc Slight changes 2002-12-09 07:45:45 +00:00
moodler 24a34da28c Updated version 2002-12-09 07:36:48 +00:00
moodler 5e367a2d56 Various little tweaks to improve the display of course home
pages and front page ... still have some work to do though
2002-12-09 07:35:40 +00:00
moodler 7a4c13797a Default with showrecent ON 2002-12-09 06:35:14 +00:00
moodler 64a92277da Fixed US spelling 2002-12-09 03:25:48 +00:00
moodler 1e6700a749 Restored "locale" string 2002-12-09 03:10:44 +00:00
moodler 651ba4e63c Latest changes in French, from Sebastien Nam?che 2002-12-09 03:00:54 +00:00
moodler 4be38f8bb2 CHanges from Antonio Navarro 2002-12-09 02:39:19 +00:00
moodler 2e4b204b26 Changes to make makeClassFromFile() in makeclass.php work better 2002-12-09 02:12:37 +00:00
moodler 1ed2b03af3 Fixed some names 2002-12-08 17:32:11 +00:00
moodler 339bb5599f New code to use locale information from language packs if necessary 2002-12-08 17:26:21 +00:00
moodler a8b7b66158 Use language string for "changes saved" 2002-12-08 17:21:10 +00:00
moodler 2893d91e46 Fixed name 2002-12-08 17:16:58 +00:00
moodler df0594edee Added locale codes to all languages 2002-12-08 17:01:13 +00:00
moodler 517f323637 US flavor of English to keep the yanks happy. ;-) 2002-12-08 16:49:49 +00:00
moodler 520283b4e4 Added Mitsuhiro's credit for Japanese 2002-12-08 11:28:32 +00:00
moodler 15a2a4e555 Updates for 1.0.7 and better-looking throughout 2002-12-08 03:45:03 +00:00
moodler 261be01672 More changes from Mits. 2002-12-07 16:19:58 +00:00
moodler 6ab29e19a4 Going back to simpler version numbers! 2002-12-07 08:53:07 +00:00
moodler 86400f05f5 Small changes to help display of Japanese and on Netscape 2002-12-07 08:44:21 +00:00
moodler 467aaec630 Small changes to tables to make them display better with Japanese 2002-12-07 08:39:24 +00:00
moodler a8a71844e4 If the database doesn't work then just die before anything else 2002-12-07 07:27:58 +00:00
moodler 657423c8f3 get rid of short_open_tags 2002-12-07 07:27:18 +00:00
moodler 95ea4a41ad Some info about forcetables 2002-12-07 07:19:28 +00:00
moodler 2348daf12c Updated the dox 2002-12-07 04:37:21 +00:00
moodler ec2e229a0f General purpose function to produce a class based on a library
of simple functions.  Can be used to provide a class interface
to Moodle functions.

Thanks to Greg Barnett!
2002-12-07 04:31:23 +00:00
moodler d72788c346 Added php mime type 2002-12-07 04:24:22 +00:00
moodler 81ef6a5ee5 Removed the "zero" value altogether 2002-12-07 04:20:35 +00:00
moodler ff4f23fdcc Better checking of existing value, in case it's not in the list 2002-12-07 04:00:05 +00:00
moodler 0fa2146388 More changes from Mits! 2002-12-06 12:22:59 +00:00
moodler 3e8ff7019f Fixed up CVS Id tag 2002-12-06 11:36:20 +00:00
moodler 2ccb36740b Wrapper file to make moodlelib.php functions accessible as a class
called moodlelib.  Based on idea from Greg Barnett:
http://moodle.com/mod/forum/discuss.php?d=356
2002-12-06 11:23:42 +00:00
moodler a7ce613296 First version of Japanese translation by Mitsuhiro Yoshida !
Still missing quiz.php, survey.php, auth.php and the help files

Helpers wanted!
2002-12-05 13:50:01 +00:00
moodler 035cdbff1a Improved removal of leading zeroes, but with some efficiency lost 2002-12-02 01:35:18 +00:00
moodler bea7a51e3c Slight change to get rid of leading zeroes in dates 2002-12-02 01:13:14 +00:00
moodler 8ea300947d These includes are actually required 2002-12-02 01:12:06 +00:00
moodler 666122b94b Upgraded ADOdb to 2.50 because it fixes some bugs with PHP 4.3.0 2002-11-30 13:23:39 +00:00
moodler 8da0e0e031 IMS/SCORM 2002-11-30 12:04:33 +00:00
moodler 3ad6393067 Revised 2002-11-30 12:00:47 +00:00
moodler 17820bd5bd New version of Italian translation - compatible with 1.0.6.3 2002-11-29 15:17:59 +00:00
moodler 39246b72f8 Some colour difference for my courses .... I'm not sure about it ... 2002-11-29 14:22:34 +00:00
moodler 85098089d1 Some improvements to the layout of courses when there are categories
and they are on the front page
2002-11-29 14:17:36 +00:00
moodler 3475d55ee7 Slight fix 2002-11-29 05:12:01 +00:00
moodler c1e735bb28 Added credit for Indonesian - Arfan Hidayat 2002-11-29 05:02:59 +00:00
moodler a08fe5809a Complete new Indonesian translation!
Thanks to Arfan Hidayat, http://www.kursusmaya.com, ivanh@telkom.net!
2002-11-29 04:58:27 +00:00
moodler b419cb6e28 Update version 2002-11-28 14:39:26 +00:00
moodler 3086f3f6cf With external authentication, the change password button on the user
page now does the same thing as the one on the login page.  It takes you
to the specified URL is it exists, and just doesn't appear if there is no URL
2002-11-28 12:31:46 +00:00
moodler 048ccc473a Highlight matches in post subject and discussion name too 2002-11-28 09:10:22 +00:00
moodler 88e729beed Add searching of subjects as well as messages 2002-11-28 09:04:04 +00:00
moodler d391e3b1ee First quick version of help on CVS 2002-11-28 03:05:24 +00:00
moodler 6cc0361107 Fixed heading 2002-11-28 02:53:25 +00:00
moodler c655755d92 Updates 2002-11-28 02:47:50 +00:00
moodler 64efda84b5 Fixes to increase the number of options available to limit assignment
upload size, and also to limit the list based on PHP limits
2002-11-28 02:41:56 +00:00
moodler f42cf95f3c Added missing </BODY> and </HTML> tags 2002-11-27 13:11:02 +00:00
carlesbellver 5c36a37c9f *** empty log message *** 2002-11-26 10:10:04 +00:00
moodler 0581a9f7c8 More info about database user 2002-11-26 03:19:15 +00:00
moodler b275ff65cb Additions and clean ups 2002-11-26 03:07:49 +00:00
moodler 71d552f677 Fix display of grades when there aren't any grades 2002-11-26 02:36:16 +00:00
moodler 83173d563c For the case when there are forums using ratings, but no ratings, and
the teacher is looking at grades, don't try and loop on an empty array
2002-11-26 02:29:54 +00:00
moodler fc05fccb64 Strip slashes from filenames 2002-11-26 02:11:05 +00:00
compuproggy 33651b3d3e *** empty log message *** 2002-11-25 06:45:08 +00:00
moodler 4d35cddd8a More fixes 2002-11-24 15:59:58 +00:00
moodler 2f0c25fc75 More tweaks 2002-11-24 15:44:59 +00:00
moodler 982d256d95 Yet more details 2002-11-24 15:40:07 +00:00
moodler 66fe2bb262 Updated versionm, ready for 1.0.6.4 2002-11-24 15:30:01 +00:00
moodler e746ec3416 More tweaks 2002-11-24 15:22:28 +00:00
moodler d40c314a0a More fixes 2002-11-24 15:20:29 +00:00
moodler 56b21759e5 More details 2002-11-24 15:16:49 +00:00
moodler 9ae472a374 New message about users being automatically unenrolled 2002-11-22 17:28:55 +00:00
moodler 7f1717c61e ALL LANGUAGE EDITORS PLEASE NOTICE THIS CHECKIN
I've changed htmlentities to htmlspecialchars in this file, to fix
bugs with editing multibyte languages (ie Japanese).  Please be
cautious and let me know if this causes any problems when editing
your language (it shouldn't, but I don't want to spoil your day!)
2002-11-22 17:27:56 +00:00
moodler 708964056e Update for kicks 2002-11-22 10:00:50 +00:00
moodler bcd6e7184f Hide password and unenrolment buttons from guest users 2002-11-22 09:59:31 +00:00
moodler 92710226a5 Tidy up some of the dox 2002-11-22 09:38:15 +00:00
moodler 466558e349 Changes to allow admin to control the "forgot password" function
and a bug fix for set_config
2002-11-22 08:43:35 +00:00
compuproggy caa963b03b Suche noch Lernwillige und Tutoren f?r http://www.selaction.de
Auch Mithelfer sind gerne gesehen wie ?bersetzer oder Moderatoren.
2002-11-22 07:39:08 +00:00
compuproggy 0cf3883167 Suche noch Lernwillige und Tutoren f?r http://www.selaction.de 2002-11-22 07:37:26 +00:00
paca70 ef62651f02 Fixed some typos 2002-11-21 18:40:33 +00:00
moodler b335cae1d3 Updated version 2002-11-21 16:59:41 +00:00
moodler cff8ba5a98 Moodle CVS is exactly 1 year old. :-) 2002-11-21 16:58:29 +00:00
moodler c351cf2799 For long courses reduce the text printed on x axis 2002-11-21 16:19:19 +00:00
moodler d751ddcb5d Reduce errorlevel reporting 2002-11-21 16:07:58 +00:00
moodler 372ce3d10c COnverted it to DOS format to make it easier for Windows users 2002-11-21 16:00:18 +00:00
moodler ad40c8a23c Updates 2002-11-21 15:30:53 +00:00
moodler 3b9a79f977 Fixes to allow graphs to be translated 2002-11-21 14:57:10 +00:00
moodler 89b5432563 Allow admin user to always get in, no matter what the authentication method 2002-11-21 12:39:33 +00:00
paca70 fd6a7ee524 New files for translation 2002-11-21 12:17:15 +00:00
moodler 6ae24de0e1 No longer need the getuserinfo parameter 2002-11-21 11:28:46 +00:00
moodler 7c58aee6c7 Added full configuration to LDAP (ie transferrable fields etc) 2002-11-21 11:27:44 +00:00
moodler 7ff671df29 Bug fix for dbtype menu 2002-11-21 11:12:55 +00:00
moodler b3f9585bcb Daily changes 2002-11-21 10:33:24 +00:00
moodler 02accd9c6a Fixed a bug from reusing newsubmission variable 2002-11-21 10:26:54 +00:00
moodler f10ed36d8d Error checking on image writes 2002-11-21 10:23:10 +00:00
moodler b913b369e8 Small bugfix with uploading new user images 2002-11-21 10:17:08 +00:00
paca70 f74dcc5e08 some updates 2002-11-21 08:26:27 +00:00
moodler 009b59336b Updated version (authentication tweaks) 2002-11-21 07:53:35 +00:00
moodler 34daec9b3b Tweaks to authentication system. Database method now allows other
fields to be specified so that things like email, names etc can be
pulled in from external database when new Moodle accounts are created
2002-11-21 07:37:21 +00:00
moodler 780db23080 Slight improvements to file security (scan for more bad characters) 2002-11-21 02:51:50 +00:00
moodler 6e07f68039 Fixed background colours of recent activity and news 2002-11-20 15:24:34 +00:00
moodler 1e77d2035c Update version slightly 2002-11-20 15:17:03 +00:00
moodler d26c7f1740 Forgot a comma 2002-11-20 15:16:03 +00:00
moodler bb90c4e867 Added guestloginbutton as default 2002-11-20 15:04:21 +00:00
moodler 277d2d9f3e Make sure guestloginbutton is set to 1 as a default 2002-11-20 15:03:06 +00:00
moodler 3790f3a151 New string for general form errors 2002-11-20 15:01:59 +00:00
moodler 15e4b2ecd9 User pictures no longer are links on main view page 2002-11-20 14:58:24 +00:00
moodler a406cdec66 Made the user profile a little more robust.
Uploaded images are now saved even if the rest of the form
has errors.

If errors are found in the form then a message is printed up
the top to make it clearer that they need to fix something.
2002-11-20 14:52:32 +00:00
moodler bd4707bf29 Er.. aligned center works better ;-) 2002-11-20 09:41:02 +00:00
moodler 68e1b65291 Fixed alignment on category boxes in some circumstances 2002-11-20 07:18:55 +00:00
moodler b66265fe0b Spacing 2002-11-19 16:16:37 +00:00
moodler bdbf373097 New version before release 2002-11-19 16:15:51 +00:00
moodler 8afe23aa9a New features and fixes 2002-11-19 16:14:47 +00:00
moodler 4ef1e78349 New files (not translated yet) 2002-11-19 15:54:12 +00:00
moodler 3c1cb3178b Checking in new updates from Fabricio 2002-11-19 15:52:25 +00:00
moodler b03b72770b Daily changes 2002-11-19 15:07:40 +00:00
moodler 076b229292 Changed it to DOS format to help Windows users 2002-11-19 14:35:07 +00:00
moodler 62c13a2f3e Changed all references of %e to %d to fix strftime on Windows 2002-11-19 14:27:57 +00:00
moodler 60459ef768 Added Authentication to admin_links 2002-11-19 09:55:54 +00:00
moodler 8297c9a012 More fixes 2002-11-19 09:09:11 +00:00
moodler 2827f134cf Fixed some strings 2002-11-19 09:06:42 +00:00
moodler 35a48c9ae4 A significant new system for authentication configuration that
exposes the wide array of authentication possibilities.

Authentication now has it's own page separate from other variables.

Most of this work was done by Petri Asikainen <paca@sci.fi>, who started
these changes off.

I've done some cleanups and additions which is why I'm checking it in.

It's all working pretty well at the moment but could use some testing.

Thanks, Petri!  :-)
2002-11-19 08:51:33 +00:00
moodler dfe952f2ea Small change to allow the same user (by email) be deleted more than
once.  Also some security in making deleted usernames very hard to guess.
2002-11-18 12:21:27 +00:00
compuproggy e1e499e02c An alle English-Deutsch ?bersetzer, wer hilf mit? -
To all english german translators, who wants to help me?
2002-11-18 07:00:24 +00:00
compuproggy 9127aca8cd *** empty log message *** 2002-11-18 06:57:57 +00:00
moodler 2b8d022c20 Fixed the O's 2002-11-18 01:57:32 +00:00
moodler e3234db924 Added Norwegian 2002-11-18 01:56:09 +00:00
moodler dbd019866f Removed an empty file 2002-11-18 01:42:26 +00:00
moodler c49de76319 Complete Norwegian translation by Joran Sorbo! joran.sorbo@teleweb.no 2002-11-18 01:41:20 +00:00
moodler e1fb2ab5e8 New imap type (imaptls) solved problems with TLS capable servers (eg Courier) 2002-11-17 15:11:35 +00:00
moodler da978ae4c7 Minor formatting 2002-11-17 11:03:59 +00:00
moodler b9b2750adb Added info about $CFG->buggy_referer 2002-11-17 11:00:55 +00:00
moodler 303077fdb5 Updated version for those using CVS etc 2002-11-17 10:46:02 +00:00
moodler 60f18531c8 A default format for format_text() and a workaround embedded
for sites with the buggy referer problem :

  define $CFG->buggy_referer = true in the config.php to activate it
2002-11-17 10:45:34 +00:00
moodler 123d2ebbc5 Now displays instructions for any authentication method 2002-11-17 10:07:01 +00:00
moodler 817c698e8f Slight updates 2002-11-17 09:57:34 +00:00
moodler 704da28e4d Remove { error, and move things around 2002-11-17 02:51:36 +00:00
moodler 23cbf014c0 When someone logs out, cler all sessions and send them to home page 2002-11-16 14:24:49 +00:00
moodler bf09e379a4 Some docs added 2002-11-16 04:26:54 +00:00
moodler 98bc913c2c Slight fixes with defaults etc 2002-11-16 03:56:00 +00:00
moodler df3988ea8b Separated code for IMAP into IMAP, POP3 and NNTP 2002-11-16 03:49:32 +00:00
moodler 3829c7bdd0 Added es_mx from Claudio ... :-) 2002-11-15 16:59:15 +00:00
moodler bb56980c83 Small tidy up of names 2002-11-15 12:49:21 +00:00
moodler d5b94ef46c Nothing missing, just needs testing and debugging 2002-11-15 09:13:31 +00:00
moodler d17bdf2b37 More options and faster (use IPs always) 2002-11-15 08:59:30 +00:00
moodler d1b4e17267 More authentication possibilities 2002-11-15 08:42:40 +00:00
moodler dce48fc85a First version of code to authenticate against external database.
This NOT TESTED yet, and has parameters hardcoded ... it will of
course be using Petri's config interface later when that's ready.
2002-11-15 08:25:24 +00:00
carlesbellver b2649432db *** empty log message *** 2002-11-15 07:21:56 +00:00
moodler 085bd98e7e Add option that allows students to resubmit after being graded 2002-11-15 03:32:30 +00:00
moodler 0431bd7c73 Extend the range of allowable timezones up to 13 hours ... (NZ Daylight savings) 2002-11-15 02:46:48 +00:00
moodler cc94d11b83 Some updates 2002-11-14 13:33:19 +00:00
moodler d483bcd35d Typo in variable 2002-11-14 11:48:01 +00:00
moodler 98c4eae3ac Set the character set of email to be the same as the default language 2002-11-14 11:45:14 +00:00
carlesbellver db5b2eaa17 *** empty log message *** 2002-11-14 07:59:31 +00:00
moodler 661890114b Re-rolling 1.0.6.3 2002-11-14 06:34:15 +00:00
moodler a15803d3d8 Argh ... fix for Netscape fix - was causing problems on other browsers 2002-11-14 06:22:13 +00:00
compuproggy 2f2e3a49a3 *** empty log message *** 2002-11-14 06:01:26 +00:00
moodler 82af8447ed Updated link for Antonio 2002-11-14 04:14:32 +00:00
moodler 5f29b7e9c5 Mention the fix for very large classes 2002-11-14 03:59:44 +00:00
moodler f8ef7d66a2 Getting ready for 1.0.6.3 release today 2002-11-14 03:14:10 +00:00
moodler cfc12f2d97 Changes from Antonio to bring it up to date with 1.0.6.2! 2002-11-14 02:43:01 +00:00
moodler a6fcdf98af Update course cache when creating new standard forums! 2002-11-14 02:33:48 +00:00
moodler 7e72f66016 Catalan translation by Carles Bellver (with the help of Merc? Renau,
Clara Andr?s and Jordi Adell).
2002-11-13 15:23:29 +00:00
moodler 21d7e306b1 Spanish (Spain) provided by Antonio Navarro (based on es_mx) 2002-11-13 13:49:30 +00:00
moodler 4a16445a3a Returning to previous version 2002-11-13 13:30:45 +00:00
moodler 34e46e5787 Small script to force tables to be created even if the database already
contains tables ... useful for sharing with other applications.
2002-11-13 12:09:18 +00:00
moodler fcf8e83671 WHoops bad typo ... made everyone a guest! 2002-11-13 06:26:36 +00:00
moodler 910d1731af Guest language ALWAYS the same as the current site language 2002-11-13 02:11:50 +00:00
moodler 9769da67ab Improvements in appearance for Netscape browsers 2002-11-12 17:20:36 +00:00
moodler 81b635c360 Improvements to formatting on old Netscape browsers 2002-11-12 17:20:04 +00:00
paca70 e0dfdf25f8 More updates 2002-11-12 14:19:24 +00:00
compuproggy 342f96b5a3 *** empty log message *** 2002-11-12 13:28:22 +00:00
compuproggy 54262b876f *** empty log message *** 2002-11-12 13:21:25 +00:00
paca70 05da6502ba added support for list users from ldap. 2002-11-12 12:10:08 +00:00
paca70 0aea12d689 Some updates 2002-11-12 06:00:09 +00:00
moodler ff446576af Small fix just in case numfiles isn't set ... it will still try to display
files if timemodified is set ... workaround for possible bug
2002-11-12 05:05:21 +00:00
moodler c75f5b4348 Small tweak to specify specifically number of files in an update 2002-11-12 04:59:28 +00:00
moodler b68de3e4d9 Updated version number 2002-11-12 04:29:49 +00:00
moodler 13beeacbcd New course option to enable/disable display of "recent activity" 2002-11-12 04:26:16 +00:00
moodler cbb0fee071 For very large classes don't even try to show all the participants 2002-11-12 03:02:51 +00:00
moodler 553064412d Better looking headings with right-to-left languages 2002-11-12 02:19:44 +00:00
compuproggy 469a4e8568 *** empty log message *** 2002-11-11 12:27:58 +00:00
moodler 3b5bf411db Updates 2002-11-11 08:35:09 +00:00
moodler 48e4f8bc3a Missing file 2002-11-11 08:32:31 +00:00
moodler 0aa65a3935 Slight update to release notes for clarity 2002-11-11 08:28:39 +00:00
moodler 3635d82ff3 Updated version for final release of 1.0.6.2 2002-11-11 08:25:41 +00:00
moodler 7304b852cd Slightly more info in error message 2002-11-11 08:25:05 +00:00
moodler 07358d40a4 30 per page 2002-11-11 08:03:54 +00:00
moodler ad81212ec3 Rearranged code so some output is printed before tackling the big table 2002-11-11 07:58:11 +00:00
compuproggy 8f1370c603 *** empty log message *** 2002-11-10 21:48:28 +00:00
moodler 7c0f298426 Update course cache when modules are moved up or down 2002-11-10 14:45:11 +00:00
moodler 76d6be7020 Put a menu on the documentation 2002-11-10 14:05:52 +00:00
moodler e34461f5ea Use #defines for resource types ... just esthetics 2002-11-10 14:03:25 +00:00
moodler cdc27f74a3 Added navmenu for journal edit page 2002-11-10 11:44:58 +00:00
moodler f7e4436690 Fixed front page display of modules 2002-11-10 11:14:06 +00:00
moodler 26d037e63a New info, ready for 1.0.6.2 release 2002-11-10 11:10:19 +00:00
moodler 2ee50b1a5d Added paging now, so this page is now usable with many users 2002-11-10 11:00:57 +00:00
moodler 723974203f New string 2002-11-10 10:40:02 +00:00
moodler 584f0a10ed Starting to speed up this page 2002-11-10 10:19:06 +00:00
moodler 7bee16d404 More sensible varible names 2002-11-10 08:55:39 +00:00
moodler c408b0c49b print_section now uses cached course modinfo to lessen load in database 2002-11-10 08:55:11 +00:00
moodler dfc9ba9bbe Added navmenu in more places 2002-11-10 08:43:44 +00:00
moodler 3e50a13968 Fix to break out of frames 2002-11-10 08:08:23 +00:00
moodler 4359e8f715 Typo in navmenu 2002-11-10 07:59:01 +00:00
moodler f0207959ab Bring back button to home page, update versions etc 2002-11-10 07:57:11 +00:00
moodler b1ae5fb0a8 Added menu stuff to other themes 2002-11-10 07:44:01 +00:00
moodler d897cae419 Changes to enable jumping between activity modules, using a new menu in
the upper-right corner.   Caution: Not well tested at this stage.
2002-11-10 07:37:15 +00:00
moodler 14272cdc38 Latest from Gilberto 2002-11-09 08:35:06 +00:00
moodler 4fdb415494 New version date 2002-11-09 06:52:30 +00:00
moodler f39d5f4576 Use course setting for "student" 2002-11-09 06:29:21 +00:00
moodler b309c289db WHoops typo 2002-11-09 06:24:21 +00:00
moodler f762c448ef FINALLY! Surveys are now translatable! :-) 2002-11-09 06:22:57 +00:00
moodler 8dfc9d0f19 Using LOCALE defines, not strings 2002-11-08 01:33:04 +00:00
moodler cdb56e3dc5 Modified files from Fabricio 2002-11-07 12:05:17 +00:00
moodler f426a62eff Header "login" link now breaks out of possible frame 2002-11-07 11:18:18 +00:00
moodler 8552044d4d Update for course format changes etc 2002-11-07 09:34:51 +00:00
moodler 9a22359743 Fixes to course display, tidy up of some code (could do with more)
and mainly - addition of section 0 display.
2002-11-07 09:30:41 +00:00
compuproggy 8f577101f4 *** empty log message *** 2002-11-07 08:53:53 +00:00
moodler 9fc3aa87b4 Tweaks 2002-11-07 03:01:53 +00:00
moodler 6f3ba7c93d Make a $homepage flag for use in footers 2002-11-06 15:46:12 +00:00
moodler 405ea757e6 Fixed some more missing strings 2002-11-06 09:13:19 +00:00
moodler 941dd21efb Fixes and simplification 2002-11-06 08:54:28 +00:00
moodler 4242a73f37 Bug fix on record counting 2002-11-06 08:44:44 +00:00
moodler aa96df8fef New version and release notes for 1.0.6.1 2002-11-06 08:30:33 +00:00
moodler f9f48383e3 New string 2002-11-06 08:24:54 +00:00
moodler 22710216f2 Add link to module editing ... back to module type list 2002-11-06 08:24:29 +00:00
moodler b7b4287462 Added new type of assignment - offline.
This type of assignment doesn't require anything of the student online,
it just tells them about an assignment and the teacher can provide
feedback and grades.  Useful for offline activities, and also for the
teacher to add manual columns to the grades page
2002-11-06 08:12:06 +00:00
moodler 65ccdd8cc8 When using loginas to be a student, you can now return to being
yourself using a link in the footer.  Improvements to footer display
2002-11-06 07:54:44 +00:00
moodler 7cbfca14c7 Added string for search results 2002-11-06 07:40:56 +00:00
moodler 46217d06b5 Language fixes 2002-11-06 07:40:36 +00:00
moodler 5ebe27e22c Fixed notices a bit 2002-11-05 16:47:30 +00:00
moodler cb909d74ca Fixes to prevent teachers using loginas to enter other courses as that student 2002-11-05 16:38:02 +00:00
moodler 34fdf5b933 Minor wording changes 2002-11-05 07:06:36 +00:00
moodler 3ea810dab0 Added Spanish 2002-11-05 07:04:44 +00:00
compuproggy 4249e34fbf *** empty log message *** 2002-11-05 06:34:57 +00:00
moodler 9f58537a53 Added SMTP authentication for email delivery 2002-11-05 06:06:18 +00:00
moodler 54e90f2d97 Checking in for Holger 2002-11-03 14:35:37 +00:00
moodler 9368247eb6 Simple help about assignment types 2002-11-03 09:34:17 +00:00
moodler 5331c4645b Changes from Fabricio Valadares 2002-11-02 17:34:35 +00:00
moodler 55dace4186 Updates from Claudio 2002-11-01 02:53:50 +00:00
moodler ad6c33dcaa New guest language is same as site 2002-11-01 01:11:46 +00:00
compuproggy 6f4db0e365 *** empty log message *** 2002-10-31 05:52:11 +00:00
paca70 32385d38a1 Initial Finnish translation 2002-10-30 19:20:48 +00:00
moodler b176f8e4cb Updated name of thislanguage 2002-10-30 02:40:46 +00:00
moodler 8b303d1d15 Updated version a little 2002-10-30 02:19:23 +00:00
moodler effdbf913f A very early Arabic translation 2002-10-30 02:09:19 +00:00
moodler b7808b3d97 Spanish translation (Mexican flavour) from Gilberto Rodr?guez et al 2002-10-30 02:00:40 +00:00
moodler ebaf37b55d Checking in CHanges to be part of a 1.0.6 rebuild to include the last
few days of minor changes (documentation etc)
2002-10-29 16:47:16 +00:00
moodler 7209909ec9 On second thoughts, don't apply locale to numbers because it may
affect some calculations.   Just strings and times.
2002-10-29 15:33:09 +00:00
moodler fa0c7d6d91 Use the locale to set everything (eg string conversions, comparisons,
money numbers etc instead of just the time)
2002-10-29 15:25:22 +00:00
moodler 024172be96 Fixed links back to top 2002-10-29 15:02:09 +00:00
moodler 27c82ede5e added documentation 2002-10-29 14:57:12 +00:00
moodler e149249bd2 Improvements to documentation formatting, content etc 2002-10-29 14:48:58 +00:00
moodler 533e975551 Added session.auto_start (off) ... having it turned on will break Moodle
on some versions of PHP
2002-10-29 12:30:31 +00:00
compuproggy 95152d474a *** empty log message *** 2002-10-29 06:24:12 +00:00
moodler 53f2259aa9 Added short_open_tag 2002-10-29 04:04:08 +00:00
moodler a5d34d51cb Removed UPGRADING.txt (replaced by doc/upgrade.html) and updated README.txt
to make it a bit clearer about where all the docs are.
2002-10-29 03:52:10 +00:00
moodler d6cd6ec4f6 New upgrading page (replaces the old UPGRADING.txt) 2002-10-29 03:47:43 +00:00
compuproggy 3129b66906 *** empty log message *** 2002-10-28 13:24:25 +00:00
compuproggy cb87603810 *** empty log message *** 2002-10-28 12:12:16 +00:00
moodler 41f2f344ab Show date in red if assignment date has passed 2002-10-28 02:25:18 +00:00
moodler f59d8272e8 Use translated strings for all upload feedback 2002-10-28 02:24:38 +00:00
moodler 660c20a6ba Added some new strings 2002-10-28 02:24:01 +00:00
moodler 52ab14dd82 Fixed "uploaded assignment" (uploadsuccess) string 2002-10-28 01:30:00 +00:00
compuproggy 519c5a76cd *** empty log message *** 2002-10-27 15:04:30 +00:00
moodler 627de17eda Typo (Survey mentioned twice) 2002-10-27 03:10:10 +00:00
moodler 4a3e5f7e25 Missing a bracket ) 2002-10-26 14:36:01 +00:00
moodler 97f3bedc10 I mean it!! This is 1.0.6!!!! 2002-10-26 06:16:33 +00:00
moodler 3a50203f34 Fixed small bug that was displaying fractions with too many decimal places
(eg 0.9999 instead of just 1)
2002-10-26 06:11:43 +00:00
moodler e386617506 OK, this is 1.0.6 2002-10-26 05:50:09 +00:00
moodler 06a609e91e One more thing - I' moved the RELEASE.html into the other documentation
to make it easier to find later on.
2002-10-26 05:37:31 +00:00
moodler 736458f308 Moving ../RELEASE.html to here 2002-10-26 05:32:26 +00:00
moodler 5946a43ee9 TIME TO CUT THE CORD, GENTLEMEN. THIS IS 1.0.6. 2002-10-26 05:26:06 +00:00
moodler cb62c00ad2 Fixed minor bug after creating default category. 2002-10-26 05:17:53 +00:00
moodler 960a79887b Updated version numbers in preparation for 1.0.6 release 2002-10-26 04:37:56 +00:00
moodler 67f0b4ccb0 Better formatting for the link 2002-10-26 03:37:06 +00:00
moodler a8afb411a0 OK, this should be better ... 2002-10-26 03:33:07 +00:00
moodler c585fa1707 A first try at a new shortening algorithm ... checking in to do some
tests on various servers
2002-10-26 03:21:41 +00:00
moodler 211ee674b3 Changed type of quiz_answers.feedback to TEXT (255 chars was a bit cramped) 2002-10-26 03:13:54 +00:00
moodler 0ee8d9203e Added some commented-out code that MIGHT help people with string slash problems. 2002-10-26 02:31:49 +00:00
moodler 2138dcf29d Added quiz max grade in column title, for reference 2002-10-25 15:34:05 +00:00
moodler 153cc356cb Added TARGET=_blank to links in HTML email ... apparently these links
were causing problems in Hotmail.  Normally I'd say "Good!", but ...  :-)
2002-10-25 15:27:12 +00:00
moodler 86c5e69a36 Remove "news" and "social" forums from learning forums. 2002-10-25 14:46:42 +00:00
moodler 690b1941fc About time 2002-10-25 09:14:16 +00:00
moodler e6874d9ff6 Brand-new news and social forums are now also assigned course modules and
put in section 0 of the course.
2002-10-25 09:10:40 +00:00
moodler 95e143f4cc Ugh type in string module name 2002-10-25 08:54:29 +00:00
moodler 7beb45d8a0 Upgrading all news and social forums (except those in social courses)
so that they are course modules in an (invisible) section, which means
they are now editable and parameters, names etc can be changed.
2002-10-25 08:47:53 +00:00
moodler bd823371c9 Making it clear not to overwrite old files 2002-10-25 08:42:06 +00:00
moodler e11c24bc0e Added translation for Attempt quiz now 2002-10-25 08:15:03 +00:00
moodler 256d0b7b47 Slight change to configlocale ... added examples 2002-10-25 08:01:48 +00:00
moodler 6c506ca744 Disallow people posting in forums where they arent allowed to post! 8-. 2002-10-25 07:22:59 +00:00
moodler 87a2fa0338 Tweaks 2002-10-25 07:17:23 +00:00
moodler f690562f81 Tweaks to mail formats so that unnecessary information (replies, etc)
is not printed.
2002-10-25 06:50:40 +00:00
moodler 3260de6780 Tweaks to forum formatting 2002-10-25 05:58:39 +00:00
compuproggy 4a91f52161 *** empty log message *** 2002-10-25 05:46:33 +00:00
moodler 1ea355a851 Latest updates from Fabricio 2002-10-25 03:20:59 +00:00
moodler ed4ed0939b Weekdays are now calculated using userdate, so that
- they are relative to the user
  - they should take advantage of locales etc
2002-10-25 02:11:58 +00:00
moodler 2be8b28f3d Changes to improve usability when the admin folder has been renamed,
and also a change in checking for the admin user, just in case an
old session is hanging around
2002-10-25 02:02:02 +00:00
moodler 255f2cc06e All the variables were missing! 2002-10-24 13:41:52 +00:00
moodler 4313922f65 Fix for category box display on IE 2002-10-24 12:49:53 +00:00
moodler e7b7951c0a The BR in print_post was to fix the case when embedded images are used.
However it added too much space.  I'll find a way to fix the embedded
images problem later, during the styles changeover, as it's pretty
rare.
2002-10-24 07:09:29 +00:00
moodler 23877f9407 never upgraded choice tables to six choices! 2002-10-24 03:43:37 +00:00
moodler 6673b085a9 Updated with some new features 2002-10-24 03:11:57 +00:00
moodler 3d27c2c201 Added a new debugging command so that I can see the config variables 2002-10-24 02:42:26 +00:00
moodler f6b502d246 more readable 2002-10-23 14:38:24 +00:00
moodler eb8eb6abc5 Rearranged to alphabetical order 2002-10-23 14:33:23 +00:00
moodler cef08a3a99 Forgot to mention the new LDAP functions! My deep apologies, Petri,
1.0.5 was too long ago - I forgot your plug-in was developed since then!
2002-10-23 14:30:38 +00:00
moodler e870c78bfc WHoops ... just undoing the last checkin which was premature ... 2002-10-23 12:13:47 +00:00
moodler 72c578ca4d Mail now contains Moodle version 2002-10-23 12:12:01 +00:00
moodler cc3b8c75de After saving new question, sanity checks are made to make sure the
fractional grades are correct.

Icons now have tooltips and are also a shortcut to editing page.
2002-10-23 12:10:38 +00:00
compuproggy cbb8979fa9 *** empty log message *** 2002-10-23 07:27:02 +00:00
moodler e7311a0a56 Changed name of upgrade_moodle function to main_upgrade (for consistency) 2002-10-23 04:10:10 +00:00
moodler 3bd87406ba Latest version of Italian from Davide Suraci. 2002-10-23 02:00:16 +00:00
moodler e4814d7f63 cvs update -dP
not

cvs update -d
2002-10-22 13:17:04 +00:00
compuproggy 6fad164f96 *** empty log message *** 2002-10-22 12:36:02 +00:00
moodler f6f0e53de0 Updated information for 1.0.6 Beta 1 2002-10-22 11:21:54 +00:00
moodler ffc5a2c03a More concise feedback on grading, and more efficiency (only update
attempt grades that have changed)
2002-10-22 10:56:48 +00:00
moodler cd63d77e08 Added help pages to quiz module.
A few little cleanups, such as trim() on shortanswers
2002-10-22 10:38:00 +00:00
moodler 377f3c9ee4 new function print_heading_with_help() to print a heading with a helpbutton 2002-10-22 09:54:36 +00:00
moodler f31edeeb88 Display tweaks to table of attempts 2002-10-22 07:03:36 +00:00
moodler e331eb06fd Teacher can now regrade (recalculate grades) of all quiz attempts
(in case the quiz changed somehow)
2002-10-22 06:52:23 +00:00
compuproggy 5ecb135644 *** empty log message *** 2002-10-22 05:37:42 +00:00
moodler 6d86b5dc16 Teacher can now view student attempts 2002-10-22 04:25:58 +00:00
moodler ff99ff634e German should be Deutsche 2002-10-22 02:48:05 +00:00
moodler ede685a73e Fixed name/date variables (don't translate variables!) 2002-10-22 02:34:41 +00:00
moodler 66197f51cc Removed unnecessary mentions of sel@ction 2002-10-22 02:30:36 +00:00
moodler e1c91df09b Can now delete questions. It checks that the question doesn't belong to
any quizzes first (if it's in a published category then it checks all quizzes
on the server).
2002-10-21 15:00:51 +00:00
moodler 34a4dfee10 Added log_display entries for quiz 2002-10-21 14:57:34 +00:00
moodler 2383cadbab Display tweaks 2002-10-21 13:13:33 +00:00
moodler 38f03e5a5c Round $bestgrade when storing it to avoid insert_record problems 2002-10-21 13:02:14 +00:00
moodler 20a3006529 Print intro as HTML 2002-10-21 12:49:28 +00:00
moodler 466a69bc42 Bugfix on calculating correct answers for multichoice questions 2002-10-21 12:48:13 +00:00
moodler e909c8d090 Some error checking 2002-10-21 12:39:46 +00:00
moodler 305ce2b33c Convert intro text to HTML 2002-10-21 11:41:36 +00:00
moodler 840aaba179 Added some more allowed HTML tags 2002-10-21 09:16:06 +00:00
moodler 2a3cda192e Allow teachers to look at ratings for anyone 2002-10-21 08:44:56 +00:00
moodler f166d2e295 Fixed up rating retrieval ... now gets them all seperate 2002-10-21 08:36:15 +00:00
moodler 36df40d60e Fix in forum_grades 2002-10-21 08:32:37 +00:00
moodler 4db9d14dad Don't show column grade when there's nothing to show 2002-10-21 08:19:15 +00:00
moodler caadf00909 Rearranged functions to match other modules, and added forum_grades() 2002-10-21 08:10:24 +00:00
compuproggy fa452aa6f0 *** empty log message *** 2002-10-21 08:06:42 +00:00
compuproggy 15657235ef *** empty log message *** 2002-10-21 08:02:03 +00:00
compuproggy 2ad604fe3c *** empty log message *** 2002-10-21 07:58:18 +00:00
compuproggy 8e44daa729 *** empty log message *** 2002-10-21 07:45:48 +00:00
moodler 912c058651 Grades are not always numbers, so take care in XLS writing 2002-10-21 06:55:01 +00:00
moodler be025399d8 Table header aligns to top 2002-10-21 06:51:56 +00:00
moodler 629e937352 Added journal_grades() so journals show up in the Grades page 2002-10-21 06:42:58 +00:00
moodler 09a4ce320c Changes to toolbar to position color pickers better, and
reintroduce the "select all" button.  Unfortnately, I had
to remove the "About richtext" button to make room
2002-10-21 05:42:37 +00:00
moodler 4168490e17 Added paragraphs to allowed HTML tags 2002-10-21 04:12:54 +00:00
moodler 7bcb78cee3 Modified language so that it speaks to students as well as teachers 2002-10-21 03:23:45 +00:00
moodler 51cc244d12 Added quizzes 2002-10-21 03:04:05 +00:00
moodler e5dfd0f31f Improvements to help, and addition of new "Activity modules" help
for teachers adding new modules.
2002-10-21 03:00:40 +00:00
moodler 2ee53d15ff Some more clues for new admins ... 2002-10-20 18:06:04 +00:00
compuproggy f38aa1ef23 *** empty log message *** 2002-10-20 18:02:40 +00:00
moodler f1edd1922f Updated versions 2002-10-20 17:50:20 +00:00
moodler 3bf89042f5 Whoops, forgot to check in these new icons 2002-10-20 17:42:28 +00:00
moodler b55a466b60 Fixes for display of public categories 2002-10-20 17:41:24 +00:00
moodler c74a0ca5c2 Category editing in quizzes is now supported. Some other little
cleanups along the way ...
2002-10-20 17:15:39 +00:00
moodler f9a9499a62 Guests can no longer see or attempt quizzes 2002-10-20 10:13:04 +00:00
moodler 60f49825a5 New and fixed strings 2002-10-20 10:12:36 +00:00
moodler 16c0beb00b Strip slashes from print_simple_box (just in case) 2002-10-20 10:12:12 +00:00
moodler 4b9b2f0fe4 Fixed display of "done" assignments 2002-10-20 05:35:48 +00:00
moodler 8db3eaddb2 Now shows correct answers, plus some small bug fixes 2002-10-20 05:35:25 +00:00
moodler c1d5710174 Cleaned up format a little, plus added better error checking of server
variables so that at least people will get feedback if they are missing
2002-10-19 04:58:14 +00:00
compuproggy 9b21d119c0 *** empty log message *** 2002-10-18 19:19:35 +00:00
compuproggy 7b1593f040 *** empty log message *** 2002-10-18 17:20:10 +00:00
moodler 7e67441553 Added stuff about the text editing 2002-10-18 17:17:32 +00:00
moodler 0be05df068 Find URLs at the beginning of lines ... 2002-10-18 17:05:17 +00:00
moodler 958aafe2b4 Quiz attempts are now timed. This is done by starting the quiz_attempts
record upon showing the quiz, and completing it upon submit.

Two new fields in quiz_attempts... should be upgrade friendly.
(Old attempts will show up as being of duration zero)


Also some small fixes here and there.
2002-10-18 16:05:21 +00:00
moodler 9f7fd360dd Some tidy ups 2002-10-18 16:02:12 +00:00
moodler aef47af493 Added RTE etc 2002-10-18 16:01:35 +00:00
moodler 291febf79c Improved the documentation (it has some live feedback on the state
of the Richtext functionality)
2002-10-18 11:27:14 +00:00
moodler 18a322490d Cleanup 2002-10-18 09:40:35 +00:00
moodler cf094bd4b4 Better help with text formats 2002-10-18 09:38:58 +00:00
moodler 02a72a36f1 Improved the help page 2002-10-18 09:35:20 +00:00
moodler 2166bb5d7a Language changes and help documentation additions to clearer explain richtext, html and moodle auto-format 2002-10-18 09:29:44 +00:00
moodler d2e186ed71 Revised string for formattext to make more sense 2002-10-18 09:09:54 +00:00
moodler 3fe3851d57 OK, I've rationalised the text formatting now. Basically, both Moodle and
HTML text allow the same range of HTML tags (so it doesn't matter is you
switch from one to the other).

<IMG> and <A> are now ALLOWED in Moodle text.  However, the clean_text
function now checks for and removes any embedded javascript triggers
to avoid cross-site scripting attacks that way.

clean_text() should be called on ANY text that comes in from students.
2002-10-18 09:09:19 +00:00
moodler a0bac19d81 Whoops ... typo. 2002-10-18 09:00:09 +00:00
moodler 57243ffe02 Also set default language on new user created by external authentication 2002-10-18 08:52:33 +00:00
moodler 177e50ed98 New users created by admin also now default to site language 2002-10-18 08:48:44 +00:00
moodler 369622db97 Default language for users is now the same as the site language. 2002-10-18 08:46:12 +00:00
moodler 08beb3327b Allow <IMG> tags in Moodle format text. Not having it can really mess
up smileys etc if the text has been edited at any stage using the
richtext editor.

I realise it's possible for students to really mess up forums display
etc if they wanted to include a huge picture ... I'm not sure if there
are any cross-site scripting attacks possible with images in there.

But there is also now the HTML format for most things, which is editable
using an ordinary form, so this problem is currently already exposed.

I think it's OK as long as can find a filter to strip all javascript
out of ANY format text in Moodle.
2002-10-18 06:05:56 +00:00
moodler e757af1662 Fixed the setting of answers for true-false questions 2002-10-18 05:41:24 +00:00
moodler f9ef3d77d1 Just some better formatting and info 2002-10-18 00:18:26 +00:00
moodler 11a3c89a8f Made transparent 2002-10-17 23:49:02 +00:00
moodler b0e999e646 Changes related to new module 'resource' 2002-10-17 15:32:52 +00:00
moodler 92674bf8bb Changes due to new module 'resource' 2002-10-17 15:14:54 +00:00
moodler 3a5a667386 Changes due to new resource module 2002-10-17 15:10:59 +00:00
moodler 242ee0175f Resulting from module name change 2002-10-17 15:07:22 +00:00
moodler 6c3e8758c6 Changed reading.php to resource.php 2002-10-17 15:03:20 +00:00
moodler 3d58a8b50b Moved from reading module 2002-10-17 14:32:55 +00:00
moodler 4282d7dde2 Changed string neverread to neverseen 2002-10-17 14:28:12 +00:00
moodler 2a439ba7f6 ***NOTE NOTE NOTE **********************************************************
THIS IS A BIG CHANGE!

I've renamed the "reading" module to "resource".

This meant changing quite a few references throughout Moodle.

The automatic upgrade process should work OK (it worked OK on my
development server) and there shouldn't be any problems.

BUT PLEASE PROCEED WITH CAUTION AND KEEP BACKUPS OF EVERYTHING
UNTIL I HAVE A FEW MORE TESTS!   If you upgrade please let me know.

One thing that will break are any hard-coded links within forum messages.

What I will be doing to fix this on my apache server is to add this to
httpd.conf:

Redirect /mod/reading/ http://moodle.com/mod/resource/

Sorry about any inconvenience, but it's better this is done sooner than later.
2002-10-17 14:03:59 +00:00
moodler e1ac42728d Added a 'change password' button 2002-10-17 12:25:25 +00:00
moodler 269eed6448 Changed headers so that it works seamlessly when called from user page. 2002-10-17 12:21:55 +00:00
moodler 952489e16c The grades page now supports downloading of grade data! :-) 2002-10-17 10:34:11 +00:00
moodler 417e6821bd Removed some blank lines that were causing output 2002-10-17 10:33:13 +00:00
moodler 6e770b179c Grr added transparency back again ... 2002-10-17 08:32:29 +00:00
moodler da19305885 Re-adding to overcome CVS strangeness (and my own indecision!) 2002-10-17 08:30:41 +00:00
moodler 9809249838 Better grade reports 2002-10-17 08:28:18 +00:00
moodler e34d323730 Some new strings 2002-10-17 07:58:50 +00:00
moodler 858deff0b4 Now includes maximum grades 2002-10-17 07:55:54 +00:00
moodler d0ac6bc236 Added new grading functions to work with course/grades.php 2002-10-17 07:23:51 +00:00
moodler 3486b7bee5 Added a new grading tool for teachers to see all grades on one page.
Grades are collected from each module using the module_grades function in
each mod/*/lib.php.
2002-10-17 07:23:12 +00:00
moodler 19c4f55c43 Feedback fixes 2002-10-16 15:52:29 +00:00
moodler 5f652ac38e Alt text on moodle logo 2002-10-16 15:48:22 +00:00
compuproggy c5e900c8aa *** empty log message *** 2002-10-16 10:42:35 +00:00
compuproggy 90892fd130 *** empty log message *** 2002-10-16 10:24:09 +00:00
moodler a8a372ccf7 Various fixes and additions. It now does quiz feedback pretty well
(though it doesn't show correct answers yet).
2002-10-16 09:35:04 +00:00
compuproggy 735715779b *** empty log message *** 2002-10-16 09:31:14 +00:00
compuproggy d6aa0e227e *** empty log message *** 2002-10-16 08:48:11 +00:00
moodler 18de986eb1 Actually, let's include journals that have no feedback yet as well. 2002-10-16 07:18:07 +00:00
moodler 8bff8ad835 When a teacher is giving feedback, entries that have been modified since
the last time a teacher has given feedback are highlighted.
2002-10-16 07:15:36 +00:00
moodler b425749fc3 Teacher can now use the richtext editor to edit the assignment text 2002-10-16 05:31:56 +00:00
moodler 7ce20f09cb Changes related to module editing buttons 2002-10-16 04:53:44 +00:00
moodler df2898fe3b Don't show htmleditor preference if it's disabled by admin 2002-10-16 04:52:57 +00:00
moodler 09aebc9468 Cleaned up some buttons ... 2002-10-16 04:51:55 +00:00
moodler 92a3c884f5 Small bugfixes ... (yawn) 2002-10-15 17:32:50 +00:00
moodler 7520988bb3 Fixes for grades 2002-10-15 17:13:11 +00:00
moodler 0a7994a0ba Just updated the number 2002-10-15 16:49:32 +00:00
moodler ab9d6d1e0e Some additions 2002-10-15 16:48:44 +00:00
moodler 55c2620784 Got rid of the wimpy icons in the top-right corner of pages and put some
manly buttons there.  ;-)   I think this will be much clearer for novices,
as well as being a bigger target for experts!
2002-10-15 16:47:43 +00:00
moodler 6b069ecef1 Bit of a clean up of the edit interface ... 2002-10-15 16:45:39 +00:00
moodler 49dcdd1800 Added timeopen and timeclose (instead of days) and did a few cleanups 2002-10-15 16:22:18 +00:00
moodler d197118510 Admin script to brutally delete every file and directory from the
Moodle data directory.  Will be useful for those on hosting servers
without root access.
2002-10-15 16:04:38 +00:00
moodler 8d94f5a08e OK, it seems reliable enough now for alpha testing.
If you have existing quizzes, delete them all, then
drop all the quiz tables and delete the quiz line from
the modules table.

Things to do still:

  - add/edit/remove categories
  - display question feedback on submissions ...
  - record the time they started the quiz, as well as the completion.
  - place time limits between attempts
  - add full specification of quiz open time and quiz close time
2002-10-15 12:54:11 +00:00
moodler 2a2c9725bb Can now create and re-edit all three types of questions.
Still working on grading ...
2002-10-15 10:04:28 +00:00
moodler 2834cce0d9 New strings 2002-10-15 05:31:03 +00:00
moodler 31e7516eb5 Forms now done, more or less 2002-10-15 05:29:57 +00:00
moodler d0030cf051 A little more explicit about PHP requirements 2002-10-15 03:48:04 +00:00
moodler 109613b290 Fix to clear the modform variable just in case there's one
from one module that later affects another module.
2002-10-14 16:06:19 +00:00
moodler ff80e012b0 Miscellaneous little changes from today ... 2002-10-14 16:00:55 +00:00
moodler edecd16dd2 New strings 2002-10-14 15:58:07 +00:00
moodler 10b9291c92 Checking in what I got so far .... Not working yet but I'm going to bed. 2002-10-14 15:57:33 +00:00
moodler 7bd1aa1d64 Quiz generation is working now. Just need question and category editors. 2002-10-14 12:21:18 +00:00
moodler 6a952ce7a0 Many new additions - code not quite usable yet, but getting close 2002-10-14 09:07:13 +00:00
moodler 2eaa2e2861 New strings 2002-10-14 09:04:33 +00:00
moodler 579ddad5ef Added a basic report and some clean-ups 2002-10-13 13:51:56 +00:00
moodler 5c0ee23cc3 Now uses real current language (may not be the same as $CFG->lang) 2002-10-13 10:06:01 +00:00
moodler a5e1f35c66 Just to show that something is happening!
At this stage this module:

  - prints quizzes,
  - accepts answers (for multiple attempts) and grades them,
  - stores the grades.

Really, it's usable as long as you don't mind using the database manually. :)

Next up is quiz reports, then I'll tackle quiz creation.
2002-10-13 07:17:48 +00:00
moodler 5a84640bd1 Tweaks to use new javascript-printing function etc 2002-10-12 15:01:17 +00:00
moodler 3df49694a9 New function to print richtext javascript 2002-10-12 15:00:34 +00:00
moodler 901f9f74e1 First version of German (Deutsch) translation, by Holger.Schadeck@webdesign-forum.de
Great!
2002-10-12 14:33:01 +00:00
moodler e1947876ec Moved the object code out into a function print_textarea 2002-10-12 07:23:16 +00:00
moodler aed0b713fe new string 2002-10-12 06:27:24 +00:00
moodler b2a5ee1822 Added richtext to Journal entries. 2002-10-12 06:20:56 +00:00
moodler 87aa027831 Some notes about the other new stuff. 2002-10-12 05:47:05 +00:00
moodler a5a5a129b7 Added help buttons about the richtext editor (when active) 2002-10-12 05:43:00 +00:00
moodler 66dc0c39d0 Help file for the new richtext HTML editor 2002-10-12 05:39:00 +00:00
moodler 1a072208ce Smilies are now replaced even in HTML text, and small fixes 2002-10-12 05:09:49 +00:00
moodler 75096957ca Keep this one here :-) for the interface 2002-10-12 04:19:51 +00:00
moodler d86cdde20b A bit of info 2002-10-12 04:13:39 +00:00
moodler 0c074a4f2e No longer needed ... replaced by "angry.gif" ... 2002-10-12 04:12:26 +00:00
moodler 2ec69fce6a Added a function useful for debugging Javascript problems 2002-10-12 04:09:51 +00:00
moodler 1581d9b1d8 Swapped clown icon for surprise in the layout ... looks better that way 2002-10-12 04:06:26 +00:00
moodler 696f751f7a Swapped clown for surprise - looks better that way 2002-10-12 04:04:59 +00:00
moodler c828070ac9 Deleted these icons because I'm not using them. The editor now uses
the standard Moodle icons instead.
2002-10-12 04:03:23 +00:00
moodler cd68ebfaef This page now uses the Moodle standard icons for consistency 2002-10-12 03:55:50 +00:00
moodler 84f98bc8a9 Removed references to btnPost because I don't use it 2002-10-12 03:54:56 +00:00
moodler c9dda99059 Modified text_to_html to use the new smilies, which for efficiency are
now defined in a global array, and use str_replace instead of ereg ...
2002-10-12 03:53:40 +00:00
moodler d2aad0a838 Modified this help file to describe the new smilies 2002-10-12 03:51:29 +00:00
moodler c0f4f066c2 Modified all smilies and added some new ones. 2002-10-12 03:50:45 +00:00
moodler 113bb2a26b Better placing of standard links etc when there are lots of images and
other funny formatting in HTML posts
2002-10-11 05:20:23 +00:00
moodler a9ff3d4cdf New strings to do with language direction 2002-10-11 02:32:05 +00:00
moodler 541117b6cb Changes to support choice of language direction (so that languages
like Arabic, Hebrew etc will work)
2002-10-11 02:31:37 +00:00
moodler 4b9318947c Added a new string to make it very clear how to upload assignments 2002-10-11 01:58:24 +00:00
moodler 213e8cc67d Better default options, and hiding of moodle-text help when htmlediting is operational 2002-10-10 09:27:49 +00:00
moodler c4a4cae062 Added another translator for Finnish 2002-10-10 07:29:44 +00:00
moodler da061bb457 Added option to choose HTML editor 2002-10-10 07:29:09 +00:00
moodler 73bb08357c Initial attempt at adding html text editor features to these forms. 2002-10-10 07:27:57 +00:00
moodler d2fce839b6 Updated the version (database table addition user->htmleditor) 2002-10-10 07:27:07 +00:00
moodler 0095d5cd3c Additions to cope with richtext editor being used in some forms. 2002-10-10 07:26:10 +00:00
moodler fa7d70c8c1 Added new strings 2002-10-10 07:24:59 +00:00
moodler de909d238d Adding a beta version of Rich Text Editor, for embedding into Moodle
forms (forums, readings, journals etc).  Works only on IE 5.5 and later.

Slightly customised for a slimmer toolbar.
2002-10-10 07:21:32 +00:00
moodler bc0750aaae Arg .. so much for quick hacks ... this code is so messy it's
a hassle to hack ... going back to the way it was originally, with
just a more informative error message instead.
2002-10-09 14:20:24 +00:00
moodler 0bdce31166 Changes to avoid cryptic errors 2002-10-09 14:08:33 +00:00
paca70 b54cd88f34 More corrections, documentation is coming. 2002-10-08 15:51:27 +00:00
moodler b1f2587a65 Latest changes for Italian version, by Davide Suraci 2002-10-08 02:09:43 +00:00
paca70 80f4bff33e Initial version 2002-10-07 17:17:33 +00:00
paca70 2cfd9e4dc9 Some corrections 2002-10-06 18:41:38 +00:00
paca70 66ea86f3b8 Initial version 2002-10-06 18:24:14 +00:00
moodler f3632647e7 Empty file 2002-10-06 17:31:46 +00:00
moodler 8e7ad7283b New words 2002-10-06 17:20:54 +00:00
moodler f8e4809a03 New function print_file_picture for printing a picture from the
files area, or optionally from a URL
2002-10-06 17:20:32 +00:00
moodler 14d8c0b409 Further work done. It currently can print the quiz form (including images!)
but can't mark them yet.  I've been constructing quizzes manually in the
database and it's helping to refine the database structure.  Don't count
on anything stable in the quiz module for a few days yet ...
2002-10-06 17:06:54 +00:00
moodler 55c0c75c03 A start on the page that actually prints the questions and stores the answers 2002-10-06 03:24:56 +00:00
moodler 36658798dc More or less working now 2002-10-06 03:23:34 +00:00
moodler 3a506ca299 Added some more functions 2002-10-06 03:23:16 +00:00
moodler 765814def3 Changed includes of module libraries to use full pathnames constructed
from $CFG->dirroot, rather than relative.  This is because the relative
path could sometime be a different case to the full path (on Windows)
causing include_once not to work.
2002-10-06 03:05:22 +00:00
moodler f01826ee39 Moved module upgrading functions out into database-specific files 2002-10-05 17:21:39 +00:00
moodler c0d6bcc508 Moved upgrade functions into db/mysql.sql 2002-10-05 17:20:24 +00:00
moodler 31f0900c61 Moved upgrade_moodle functions out to database-specific files, because
the SQL is not compatible (nor is it possible to make it so).
2002-10-05 17:09:31 +00:00
moodler e858f9da96 create_new_user() can now import other fields from an external source
if the function for it has been defined.  (Petri's code with additions by me)
2002-10-05 16:49:42 +00:00
paca70 2a86e7a1a5 More corrections 2002-10-04 13:07:16 +00:00
moodler 730fd187c8 Skeleton version of the quiz module. It won't break an installation,
but it doesn't do anything yet.
2002-10-04 02:59:05 +00:00
moodler 518d37151d Use main version of "maximum grade" string 2002-10-04 02:55:27 +00:00
moodler b2a82ad65c Make names into a list 2002-10-04 02:54:53 +00:00
paca70 7d3e684292 and some more.... 2002-10-03 17:10:50 +00:00
paca70 75ebf527c9 Some fixs more. 2002-10-03 17:04:15 +00:00
paca70 a08db54a84 Translated new strings and fixed some old ones. 2002-10-03 16:54:58 +00:00
paca70 68605943ae Corrected some comments. 2002-10-03 15:55:45 +00:00
paca70 fcad13730e Initial version of ldap authentication module. It have no config-interface yet. (But it's coming)
It contains also experimental auth_get_userinfo() function, what is not used by moodle yet.
If you like to try it, create following $CFG variables to /config.php or directly to config-table and activate
ldap authentication from admin-configuration page.

$CFG->ldap_bind_dn      	"If your like to use bind-user to search users, specify it here. Someting like 'cn=ldapuser,ou=public,o=org'"
$CFG->ldap_bind_pw      	"Password for bind-user."
$CFG->ldap_contexts    		"List of contexts where users are located.
				  Separate different contexts with ';'. Something like 'ou=users,o=org; ou=other,o=org'"
$CFG->ldap_host_url      	"Specify LDAP host in URL-form like 'ldap://ldap.myorg.com/' or 'ldaps//ldap.myorg.com/' ";
$CFG->ldap_search_sub   	"Put value <> 0 if  you like to search users from subcontexts.";
$CFG->ldap_user_attribute 	"What attribute is used to name/search users. Usually 'cn'. ";

More configuration optios are coming. This version is tested against Novell E-Directory without SSL and it works fine.
2002-10-03 13:45:19 +00:00
moodler abf59b15bd Fixed definition of forum->open 2002-10-03 11:17:51 +00:00
moodler 70c476a79e Fixes bug 112
Changes to expand "open" option in forums.  Now have a choice between
three options:  new discussions and new replies, new replies only and
no new discussions or new replies.

Three new options in lang/forum.php and I changed "allowdiscussions".
2002-10-03 11:15:50 +00:00
moodler 7d95ed97c7 User's name in footer is now a link 2002-10-03 11:11:53 +00:00
moodler 8dbed6be60 format_time() now supports language strings for day(s)/hour(s)/min(s)/sec(s)
String lookups are cached in user/index.php for efficiency
2002-10-03 04:04:59 +00:00
moodler 05d09aa1f9 Just making this more relevant for the CVS update junkies :-) 2002-10-03 03:55:03 +00:00
moodler a168bd029f Expanded the description and included sample commands 2002-10-03 03:35:53 +00:00
moodler 7b5baeb7de "Activities" wasn't being taken from language files 2002-10-03 02:57:36 +00:00
paca70 4b76aa52d0 Minor update to test that update rights are working. 2002-10-02 19:37:35 +00:00
moodler 5251893741 Fixes for accented characters 2002-10-02 16:23:12 +00:00
moodler 5c958cabcc Updated a word 2002-10-02 15:55:22 +00:00
moodler 168fe1427a New version number for development 2002-10-02 14:43:04 +00:00
moodler 3eb4b24fed Added 'thischarset' = "iso-8859-1", for completeness 2002-10-02 14:20:30 +00:00
moodler 59857bd7a8 Checked in initial Italian version by Davide Suraci, with help from others 2002-10-02 13:50:36 +00:00
moodler 3763e302ff Added Sebastien Nameche 2002-10-02 10:59:04 +00:00
moodler 0cb8bf3bcd Locale box is a bit bigger, since locale strings can be bigger :-) 2002-10-02 10:35:43 +00:00
moodler 3a178d04d1 Removed configcharset, but kept thischarset 2002-10-02 10:34:31 +00:00
moodler 4bfa92e714 Added new header to all pages to set the current charset, to help browsers 2002-10-02 10:33:05 +00:00
moodler 53e61ab906 Updates to the French translation, by M. Sebastien Nam?che 2002-10-02 09:37:29 +00:00
moodler 0ebe961a18 A change to test the ACLs 2002-10-02 08:23:49 +00:00
moodler a1122760d0 Changes 2002-10-02 07:59:22 +00:00
moodler 39df7c9774 Fixed links to be relative. This prevents errors on the offchance that
the current URL != $CFG->wwwroot/login
2002-10-02 07:08:56 +00:00
moodler 2e60a1ace3 Made these images transparent 2002-10-02 05:10:10 +00:00
moodler b4ab71a6db Fixed links in navigation 2002-10-02 02:24:19 +00:00
moodler 7fbd6b1c0b Don't use getenv anywhere - not necessary and breaks PHP under ISAPI 2002-10-02 02:05:29 +00:00
martin e99af4408f CHANGES UP TO 1.0.5 2002-09-27 15:14:04 +00:00
martin cc300ceb39 Mentioned newly allowed tags 2002-09-27 15:03:28 +00:00
martin 8dcea3963a Added a few more allowed HTML tags in plain text files. <dl> <h1><h2><h3> <hr> 2002-09-27 14:48:25 +00:00
martin dfb6e4ac3e Tweaks to page titles to make them more consistent 2002-09-27 14:26:02 +00:00
martin 0d399dc585 Aaaahhh I remember now why this was in here, because in future there might
be course-level themes and user-level themes.

Putting it back as before ... :-)
2002-09-27 14:19:59 +00:00
martin cd1c4d2321 Removed theme chooser from here ... moving it to admin folder 2002-09-27 14:18:06 +00:00
martin 555bdfc813 Fixed a little link to login page 2002-09-27 13:44:52 +00:00
2325 changed files with 157445 additions and 32776 deletions
+2225 -5668
View File
File diff suppressed because it is too large Load Diff
+51 -32
View File
@@ -1,32 +1,51 @@
README $Id$
------
Here is a basic outline of the installation process,
which normally takes me only a few minutes:
1) Move the Moodle files into your web directory.
2) Create an empty directory somewhere to store
uploaded files (NOT accessible via the web).
This directory must be writeable by the web server
process.
3) Create a single database for Moodle to store all
it's tables in.
4) Copy the file config-dist.php to config.php, and
edit it with all your own settings.
5) Visit your new home page with a web browser. Moodle
will lead you through the rest of the setup,
creating an admin account and so on.
6) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more details, I highly recommend you read the
full installation documentation, which is stored
in the "doc" directory or found at http://moodle.com/doc/.
Cheers!
Martin Dougiamas
README $Id$
------
If you are installing the first time, then you
should read the installation guide which is
part of the Moodle documentation (along with
information about upgrading etc):
http://moodle.com/doc/
There is a copy of all this documentation as part of
this Moodle distribution. You can access your local
copy of the installation guide here:
lang/en/docs/install.html
Once Moodle is installed on your machine, then
you can also access a local copy of all this
documentation (localised to your language) at:
http://yourmoodlesite.com/doc/
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create an empty directory somewhere to store
uploaded files (NOT accessible via the web).
This directory must be writeable by the web server
process.
3) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
4) Copy the file config-dist.php to config.php, and
edit it with all your own settings.
5) Visit your new home page with a web browser. Moodle
will lead you through the rest of the setup,
creating an admin account and so on.
6) Set up a cron task to call the file admin/cron.php
every five minutes or so.
Cheers!
Martin Dougiamas
-46
View File
@@ -1,46 +0,0 @@
<H3> Release notes for Moodle 1.0.5 </H3>
<P> New features (since 1.0.4): </P>
<UL><DL>
<DT> Configuration
<DD> Most variables are now stored in the database and modifed using an
admin form - this means config.php can be much shorter (only 8 items).
The GD version is now auto-detected on all versions of PHP.
New authentication plug-ins are now supported (auth directory).
<DT> Language improvements
<DD> We have three new languages! French, Finnish and Portuguese (Brazil).
The authors are on the credits page in the Moodle documentation.
Also, languages can now be easily edited directly via an admin web page.
<DT> Theme improvements
<DD> The standard theme code has been tidied up. It is now easier to
hack them and make your own themes. Existing themes are 100%
compatible. One new feature is that the home page can have a
different look to the other pages. A new standardlogo theme has
been added that shows you how to put your logo on the front page
(eg like moodle.com does)
<DT> User improvements
<DD> The user profile editing page now has a better layout.
The list of participants now switches to various "condensed modes"
when displaying larger classes. All user listings now support
sorting by column. The admin user can now delete (disable) user
accounts so that the user isn't displayed anywhere. Individual
users can choose their own display language (so that all web pages
and mailouts will be in that language).
<DT> Activity improvements
<DD> The "recent activity" box now also shows journal entries and
submitted assignments and surveys. The guest user can no longer
edit *anything* at all. A new reading type called "HTML text"
allows experienced users to use pure HTML.
<DT> Miscellaneous
<DD> Many tweaks to the interface and small bugs fixed, such as the one
that displayed the guest icon sometimes on course listings, even
when guest was actually disabled.
</DL></UL>
-73
View File
@@ -1,73 +0,0 @@
UPGRADING $Id$
---------
As Moodle grows, there are changes to the code and
sometimes changes to the database structures.
Moodle is able to upgrade its own databases, using
information in files called version.php. There is
one of these for the main tables (in this directory)
and one for each module.
Before the upgrade
------------------
Before upgrading any version of Moodle, I recommend
making a backup copy of the moodle directory, your
data directory and your database, to guard against
the very unlikely event that something in the upgrade
goes wrong.
At the very least, make a copy of your config.php file
and any languages, custom themes or plug-ins you have
added to Moodle.
Upgrading the files using CVS
--------------------------------
If you are using CVS, just go to the Moodle root
directory and type "cvs update -d".
If you have been editing Moodle files watch the
messages very closely for possible conflicts
(and consider sending your changes in to me as patches!)
Upgrading the files using a downloaded archive
-------------------------------------------------
Remove the current installation directory
and then unpack the new tar or zip file into the same
location. (Overwriting an old installation usually
works fine, but I can't guarantee that it always will).
Next, copy the config.php file from your old installation
into the new installation (or make a new one by editing
config-dist.php). If you have created new themes or
other plug-ins then make sure you copy those back too.
Finishing the upgrade
---------------------
Visit the admin page of your installation to complete
the upgrade (eg http://example.com/moodle/admin).
It doesn't matter if you are logged in as admin or not.
Moodle will automatically detect the new version
and perform any database or filesystem upgrades that
might be necessary.
If all goes well (no error messages) then you can just
go on using the new version!
If you have problems with this procedure, let me know.
Cheers, and have fun!
Martin
+179
View File
@@ -0,0 +1,179 @@
<?PHP // $Id$
// Admin-only script to assign administrative rights to users
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
$primaryadmin = get_admin();
/// If you want any administrator to have the ability to assign admin
/// rights, then comment out the following if statement
if ($primaryadmin->id != $USER->id) {
error("You must be the primary administrator to use this page.");
}
/// assign all of the configurable language strings
$stringstoload = array (
"assignadmins",
"administration",
"existingadmins",
"noexistingadmins",
"potentialadmins",
"nopotentialadmins",
"addadmin",
"removeadmin",
"search",
"searchagain",
"toomanytoshow",
"searchresults"
);
foreach ($stringstoload as $stringtoload){
$strstringtoload = "str" . $stringtoload;
$$strstringtoload = get_string($stringtoload);
}
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
print_header("$site->shortname: $strassignadmins",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"{$_SERVER['PHP_SELF']}\">$strassignadmins</a>", "");
/// Get all existing admins
$admins = get_admins();
/// Add an admin if one is specified
if ($add) {
$user = @get_record("user", "id", $_REQUEST['add']) or
error("That account (id = {$_REQUEST['add']}) doesn't exist");
if ($admins) {
foreach ($admins as $aa) {
if ($aa->id == $user->id) {
error("That user is already an admin.");
}
}
}
$admin->userid = $user->id;
$admin->id = insert_record("user_admins", $admin);
$admins[] = $user;
}
/// Remove an admin if one is specified.
if ($remove) {
$user = @get_record("user", "id", $_REQUEST['remove']) or
error("That account (id = {$_REQUEST['remove']}) doesn't exist");
if ($admins) {
foreach ($admins as $key => $aa) {
if ($aa->id == $user->id) {
/// make sure that we don't delete the primary admin
/// account, so that there is always at least on admin
if ($aa->id == $primaryadmin->id) {
error("That user is the primary admin, and shouldn't be removed.");
} else {
remove_admin($user->id);
unset($admins[$key]);
}
}
}
}
}
/// Print the lists of existing and potential admins
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingadmins</th><th width=50%>$strpotentialadmins</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing admins
if (! $admins) {
echo "<p align=center>$strnoexistingadmins</a>";
$adminlist = "";
} else {
$adminarray = array();
foreach ($admins as $admin) {
$adminarray[] = $admin->id;
echo "<p align=right>$admin->firstname $admin->lastname,
$admin->email &nbsp;&nbsp; ";
if ($primaryadmin->id == $admin->id){
print_spacer(10, 9, false);
} else {
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
title=\"$strremoveadmin\"><img src=\"../pix/t/right.gif\"
border=0></A>";
}
echo "</p>";
}
$adminlist = implode(",",$adminarray);
unset($adminarray);
}
echo "<td width=50% nowrap valign=top>";
/// Print list of potential admins
$usercount = get_users(false, $search, true, $adminlist);
if ($usercount == 0) {
echo "<p align=center>$strnopotentialadmins</p>";
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (!$users = get_users(true, $search, true, $adminlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
"title=\"$straddadmin\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
?>
+174
View File
@@ -0,0 +1,174 @@
<?PHP // $Id$
// config.php - allows admin to edit all configuration variables
include("../config.php");
require_login();
if (!$site = get_site()) {
redirect("index.php");
}
if (!isadmin()) {
error("Only the admin can use this page");
}
/// If data submitted, then process and store.
if ($config = data_submitted()) {
$config = (array)$config;
validate_form($config, $err);
if (count($err) == 0) {
print_header();
foreach ($config as $name => $value) {
if (! set_config($name, $value)) {
notify("Problem saving config $name as $value");
}
}
redirect("auth.php", get_string("changessaved"), 1);
exit;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
}
/// Otherwise fill and print the form.
if (empty($config)) {
$config = $CFG;
}
$modules = get_list_of_plugins("auth");
foreach ($modules as $module) {
$options[$module] = get_string("auth_$module"."title", "auth");
}
asort($options);
if (isset($_GET['auth'])) {
$auth = $_GET['auth'];
} else {
$auth = $config->auth;
}
require_once("$CFG->dirroot/auth/$auth/lib.php"); //just to make sure that current authentication functions are loaded
if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
}
if (! isset($config->auth_instructions)) {
$config->auth_instructions = "";
}
if (! isset($config->changepassword)) {
$config->changepassword = "";
}
$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
foreach ($user_fields as $user_field) {
$user_field = "auth_user_$user_field";
if (! isset($config->$user_field)) {
$config->$user_field = "";
}
}
if (empty($focus)) {
$focus = "";
}
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
$createoptions[0] = get_string("no");
$createoptions[1] = get_string("yes");
$stradministration = get_string("administration");
$strauthentication = get_string("authentication");
$strauthenticationoptions = get_string("authenticationoptions","auth");
$strsettings = get_string("settings");
print_header("$site->shortname: $strauthenticationoptions", "$site->fullname",
"<A HREF=\"index.php\">$stradministration</A> -> $strauthenticationoptions", "$focus");
echo "<CENTER><P><B>";
echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
print_string("chooseauthmethod","auth");
choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
echo "</B></P></CENTER>";
print_simple_box_start("center", "100%", "$THEME->cellheading");
print_heading($options[$auth]);
print_simple_box_start("center", "60%", "$THEME->cellcontent");
print_string("auth_$auth"."description", "auth");
print_simple_box_end();
echo "<hr>";
print_heading($strsettings);
echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
require_once("$CFG->dirroot/auth/$auth/config.html");
if ($auth != "email" and $auth != "none") {
echo "<tr valign=\"top\">";
echo "<td align=right nowrap><p>";
print_string("changepassword", "auth");
echo ":</p></td>";
echo "<td>";
echo "<input type=\"text\" name=\"changepassword\" size=40 value=\"$config->changepassword\">";
echo "</td>";
echo "<td>";
print_string("changepasswordhelp","auth");
echo "</td></tr>";
}
echo "<tr valign=\"top\">";
echo "<td align=right nowrap><p>";
print_string("guestloginbutton", "auth");
echo ":</p></td>";
echo "<td>";
choose_from_menu($guestoptions, "guestloginbutton", $config->guestloginbutton, "");
echo "</td>";
echo "<td>";
print_string("showguestlogin","auth");
echo "</td></tr>";
if (function_exists('auth_user_create')){
echo "<tr valign=\"top\">";
echo "<td align=right nowrap><p>";
print_string("auth_user_create", "auth");
echo ":</p></td>";
echo "<td>";
choose_from_menu($createoptions, "auth_user_create", $config->auth_user_create, "");
echo "</td>";
echo "<td>";
print_string("auth_user_creation","auth");
echo "</td></tr>";
}
echo "</table><center><p><input type=\"submit\" value=\"";
print_string("savechanges");
echo "\"></p></center></form>";
print_simple_box_end();
print_footer();
exit;
/// Functions /////////////////////////////////////////////////////////////////
function validate_form(&$form, &$err) {
// if (empty($form->fullname))
// $err["fullname"] = get_string("missingsitename");
return;
}
?>
+272 -129
View File
@@ -1,74 +1,133 @@
<FORM METHOD="post" action="config.php" NAME="form">
<form method="post" action="config.php" name="form">
<TABLE cellpadding=9 cellspacing=0 >
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>auth:</TD>
<TD>
<? $modules = get_list_of_plugins("auth");
foreach ($modules as $module) {
$options[$module] = $module;
}
choose_from_menu ($options, "auth", $config->auth, "", "", "");
formerr($err["auth"]);
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><p>lang:</td>
<td>
<?php choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</td>
<td>
<?php print_string("configlang") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langdir:</td>
<td>
<?php
unset($options);
$options["LTR"] = get_string("langltr");
$options["RTL"] = get_string("langrtl");
choose_from_menu ($options, "langdir", $config->langdir, "", "", "");
?>
</TD>
<TD>
<? print_string("configauth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>lang:</TD>
<TD>
<? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", "");
formerr($err["lang"]);
</td>
<td>
<?php print_string("configlangdir") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langmenu:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "langmenu", $config->langmenu, "", "", "");
?>
</TD>
<TD>
<? print_string("configlang") ?>
</TD>
</td>
<td>
<?php print_string("configlangmenu") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>langlist:</td>
<td>
<input name=langlist type=text size=40 value="<?php p($config->langlist) ?>">
</td>
<td>
<?php print_string("configlanglist") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>locale:</td>
<td>
<input name=locale type=text size=10 value="<?php p($config->locale) ?>">
</td>
<td>
<?php print_string("configlocale") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>country:</td>
<td><?php choose_from_menu ($COUNTRIES, "country", $config->country, get_string("selectacountry"), "", "") ?>
</td>
<td>
<?php print_string("configcountry") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtphosts:</td>
<td>
<input name=smtphosts type=text size=30 value="<?php p($config->smtphosts)?>">
</td>
<td>
<?php print_string("configsmtphosts") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtpuser:</td>
<td>
<input name=smtpuser type=text size=10 value="<?php p($config->smtpuser)?>">
</td>
<td rowspan=2>
<?php print_string("configsmtpuser") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>smtppass:</td>
<td>
<input name=smtppass type=text size=10 value="<?php p($config->smtppass)?>">
</td>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>locale:</TD>
<TD>
<INPUT NAME=locale TYPE=text SIZE=3 VALUE="<?=$config->locale?>">
<? formerr($err["locale"]); ?>
</TD>
<TD>
<? print_string("configlocale") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtphosts:</TD>
<TD>
<INPUT NAME=smtphosts TYPE=text SIZE=30 VALUE="<?=$config->smtphosts?>">
<? formerr($err["smtphosts"]); ?>
</TD>
<TD>
<? print_string("configsmtphosts") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>gdversion:</TD>
<TD>
<? $options[0] = get_string("gdnot");
<tr valign=top>
<td align=right><p>gdversion:</td>
<td>
<?php
unset($options);
$options[0] = get_string("gdnot");
$options[1] = get_string("gd1");
$options[2] = get_string("gd2");
$installed = check_gd_version();
choose_from_menu ($options, "gdversion", $installed, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configgdversion") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>maxeditingtime:</TD>
<TD>
<? $options[3600] = get_string("numminutes", "", 60);
</td>
<td>
<?php print_string("configgdversion") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>htmleditor:</td>
<td>
<?php
unset($options);
$options[0] = get_string("allownot");
$options[1] = get_string("allow");
choose_from_menu ($options, "htmleditor", $config->htmleditor, "", "", "");
?>
</td>
<td>
<?php print_string("confightmleditor") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>maxeditingtime:</td>
<td>
<?php
unset($options);
$options[3600] = get_string("numminutes", "", 60);
$options[2700] = get_string("numminutes", "", 45);
$options[1800] = get_string("numminutes", "", 30);
$options[900] = get_string("numminutes", "", 15);
@@ -76,17 +135,18 @@
$options[60] = get_string("numminutes", "", 1);
choose_from_menu ($options, "maxeditingtime", $config->maxeditingtime, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configmaxeditingtime") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>longtimenosee:</TD>
<TD>
<? $options[1000] = get_string("numdays", "", 1000);
</td>
<td>
<?php print_string("configmaxeditingtime") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>longtimenosee:</td>
<td>
<?php
unset($options);
$options[1000] = get_string("numdays", "", 1000);
$options[365] = get_string("numdays", "", 365);
$options[180] = get_string("numdays", "", 180);
$options[150] = get_string("numdays", "", 150);
@@ -94,75 +154,158 @@
$options[90] = get_string("numdays", "", 90);
$options[60] = get_string("numdays", "", 60);
$options[30] = get_string("numdays", "", 30);
$options[21] = get_string("numdays", "", 21);
$options[14] = get_string("numdays", "", 14);
$options[7] = get_string("numdays", "", 7);
choose_from_menu ($options, "longtimenosee", $config->longtimenosee, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configlongtimenosee") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>zip:</TD>
<TD>
<INPUT name=zip TYPE=text SIZE=30 VALUE="<?=$config->zip?>">
<? formerr($err["zip"]); ?>
</TD>
<TD>
<? print_string("configzip") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>unzip:</TD>
<TD>
<INPUT name=unzip TYPE=text SIZE=30 VALUE="<?=$config->unzip?>">
<? formerr($err["unzip"]); ?>
</TD>
<TD>
<? print_string("configunzip") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>slasharguments:</TD>
<TD>
<? $options[0] = "file.php?file=/pic.jpg";
</td>
<td>
<?php print_string("configlongtimenosee") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>loglifetime:</td>
<td>
<?php
unset($options);
$options[0] = get_string("neverdeletelogs");
$options[1000] = get_string("numdays", "", 1000);
$options[365] = get_string("numdays", "", 365);
$options[180] = get_string("numdays", "", 180);
$options[150] = get_string("numdays", "", 150);
$options[120] = get_string("numdays", "", 120);
$options[90] = get_string("numdays", "", 90);
$options[60] = get_string("numdays", "", 60);
$options[30] = get_string("numdays", "", 30);
choose_from_menu ($options, "loglifetime", $config->loglifetime, "", "", "");
?>
</td>
<td>
<?php print_string("configloglifetime") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>sessiontimeout:</td>
<td>
<?php
unset($options);
$options[14400] = get_string("numhours", "", 4);
$options[10800] = get_string("numhours", "", 3);
$options[7200] = get_string("numhours", "", 2);
$options[5400] = get_string("numhours", "", "1.5");
$options[3600] = get_string("numminutes", "", 60);
$options[2700] = get_string("numminutes", "", 45);
$options[1800] = get_string("numminutes", "", 30);
$options[900] = get_string("numminutes", "", 15);
$options[300] = get_string("numminutes", "", 5);
choose_from_menu ($options, "sessiontimeout", $config->sessiontimeout, "", "", "");
?>
</td>
<td>
<?php print_string("configsessiontimeout") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>zip:</td>
<td>
<input name=zip type=text size=30 value="<?php p($config->zip) ?>">
</td>
<td>
<?php print_string("configzip") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>unzip:</td>
<td>
<input name=unzip type=text size=30 value="<?php p($config->unzip) ?>">
</td>
<td>
<?php print_string("configunzip") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>slasharguments:</td>
<td>
<?php unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
$installed = check_gd_version();
choose_from_menu ($options, "slasharguments", $config->slasharguments, "", "", "");
unset($options);
?>
</TD>
<TD>
<? print_string("configslasharguments") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>proxyhost:</TD>
<TD>
<INPUT name=proxyhost TYPE=text SIZE=30 VALUE="<?=$config->proxyhost?>">
<? formerr($err["proxyhost"]); ?>
</TD>
<TD ROWSPAN=2>
<? print_string("configproxyhost") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>proxyport:</TD>
<TD>
<INPUT name=proxyport TYPE=text SIZE=5 VALUE="<?=$config->proxyport?>">
<? formerr($err["proxyport"]); ?>
</TD>
</td>
<td>
<?php print_string("configslasharguments") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>proxyhost:</td>
<td>
<input name=proxyhost type=text size=30 value="<?php p($config->proxyhost) ?>">
</td>
<td rowspan=2>
<?php print_string("configproxyhost") ?>
</td>
</TR>
<tr valign=top>
<td align=right><p>proxyport:</td>
<td>
<input name=proxyport type=text size=5 value="<?php p($config->proxyport) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p>debug:</td>
<td>
<?php
unset($options);
$options[7] = get_string("no");
$options[15] = get_string("yes");
choose_from_menu ($options, "debug", $config->debug, "", "", "");
?>
</td>
<td>
<?php print_string("configdebug") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>framename:</td>
<td>
<?php
if (empty($config->framename)) {
$config->framename = "_top";
}
?>
<input name=framename type=text size=15 value="<?php p($config->framename)?>">
</td>
<td>
<?php print_string("configframename") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>secureforms:</td>
<td>
<?php
unset($options);
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu ($options, "secureforms", $config->secureforms, "", "", "");
?>
</td>
<td>
<?php print_string("configsecureforms") ?>
</td>
</tr>
<TR>
<TD COLSPAN=3 ALIGN=CENTER>
<INPUT TYPE="submit" VALUE="<? print_string("savechanges") ?>"></TD>
</TR>
</TABLE>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
</FORM>
</form>
+21 -19
View File
@@ -1,17 +1,9 @@
<?PHP // $Id$
// config.php - allows admin to edit all configuration variables
include("../config.php");
require_once("../config.php");
require_once("../lib/countries.php");
if (isset($phpinfo)) { // For debugging purposes, protected by password
if (md5($phpinfo) == "caf9b6b99962bf5c2264824231d7a40c") {
if ($site = get_site()) {
print_heading("$site->fullname");
}
phpinfo();
exit;
}
}
if ($site = get_site()) { // If false then this is a new installation
require_login();
@@ -20,12 +12,16 @@
}
}
/// This is to overcome the "insecure forms paradox"
if (isset($secureforms) and $secureforms == 0) {
$match = "nomatch";
} else {
$match = "";
}
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
$config = (object)$HTTP_POST_VARS;
if ($config = data_submitted($match)) {
validate_form($config, $err);
@@ -46,7 +42,7 @@
}
}
}
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"), 1);
redirect("index.php", get_string("changessaved"), 1);
exit;
} else {
@@ -58,28 +54,34 @@
/// Otherwise fill and print the form.
if (!isset($config)) {
if (empty($config)) {
$config = $CFG;
}
if (empty($focus)) {
$focus = "";
}
$stradmin = get_string("administration");
$strconfigvariables = get_string("configvariables");
if ($site) {
print_header("$site->fullname", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradmin</A> -> $strconfigvariables", "$focus");
print_header("$site->shortname: $strconfigvariables", $site->fullname,
"<A HREF=\"index.php\">$stradmin</A> -> $strconfigvariables", $focus);
print_heading($strconfigvariables);
} else {
print_header();
print_heading($strconfigvariables);
print_simple_box(get_string("configintro"), "center");
echo "<BR>";
echo "<br />";
}
print_simple_box_start("center", "", "$THEME->cellheading");
include("config.html");
print_simple_box_end();
print_footer();
if ($site) {
print_footer();
}
exit;
+165
View File
@@ -0,0 +1,165 @@
<?PHP // $Id$
// Admin only script to assign course creator rights to users
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
optional_variable($search, "");
optional_variable($add, "");
optional_variable($remove, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
$primaryadmin = get_admin();
/// If you want any administrator to have the ability to assign admin
/// rights, then comment out the following if statement
if ($primaryadmin->id != $USER->id) {
error("You must be the primary administrator to use this page.");
}
/// assign all of the configurable language strings
$stringstoload = array (
"assigncreators",
"administration",
"existingcreators",
"noexistingcreators",
"potentialcreators",
"nopotentialcreators",
"addcreator",
"removecreator",
"search",
"searchagain",
"toomanytoshow",
);
foreach ($stringstoload as $stringtoload){
$strstringtoload = "str" . $stringtoload;
$$strstringtoload = get_string($stringtoload);
}
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
print_header("$site->shortname: $strassigncreators",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"{$_SERVER['PHP_SELF']}\">$strassigncreators</a>", "");
/// Get all existing creators
$creators = get_creators();
/// Add an creator if one is specified
if ($add) {
$user = @get_record("user", "id", $add) or
error("That account (id = $add) doesn't exist");
if ($creators) {
foreach ($creators as $aa) {
if ($aa->id == $user->id) {
error("That user is already a creator .");
}
}
}
$creator->userid = $user->id;
$creator->id = insert_record("user_coursecreators", $creator);
$creators[] = $user;
}
/// Remove an creator if one is specified.
if ($remove) {
$user = @get_record("user", "id", $remove) or
error("That account (id = $remove) doesn't exist");
if ($creators) {
foreach ($creators as $key => $aa) {
if ($aa->id == $user->id) {
delete_records("user_coursecreators","userid",$user->id);
unset($creators[$key]);
}
}
}
}
/// Print the lists of existing and potential creators
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingcreators</th><th width=50%>$strpotentialcreators</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing creators
if (! $creators) {
echo "<p align=center>$strnoexistingcreators</a>";
$creatorlist = "";
} else {
$creatorarray = array();
foreach ($creators as $creator) {
$creatorarray[] = $creator->id;
echo "<p align=right>$creator->firstname $creator->lastname,
$creator->email &nbsp;&nbsp; ";
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$creator->id\"
title=\"$strremovecreator\"><img src=\"../pix/t/right.gif\"
border=0></a>";
echo "</p>";
}
$creatorlist = implode(",",$creatorarray);
unset($creatorarray);
}
echo "<td width=50% nowrap valign=top>";
/// Print list of potential creators
$usercount = get_users(false, $search, true, $creatorlist);
if ($usercount == 0) {
echo "<p align=center>$strnopotentialcreators</p>";
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (!$users = get_users(true, $search, true, $creatorlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
"title=\"$straddcreator\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
?>
+40 -25
View File
@@ -1,25 +1,29 @@
<?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.
//
// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
// or php /web/moodle/admin/cron.php
/// 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.
///
/// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
/// or php /web/moodle/admin/cron.php
require("../config.php");
$FULLME = "cron";
$starttime = microtime();
require_once("../config.php");
echo "<PRE>\n";
$timenow = time();
// Run all cron jobs for each module
/// Run all cron jobs for each module
if ($mods = get_records_sql("SELECT * FROM modules WHERE cron > 0 AND (($timenow - lastcron) > cron)")) {
if ($mods = get_records_select("modules", "cron > 0 AND (($timenow - lastcron) > cron)")) {
foreach ($mods as $mod) {
$libfile = "$CFG->dirroot/mod/$mod->name/lib.php";
if (file_exists($libfile)) {
@@ -37,14 +41,11 @@
}
// Unenrol users who haven't logged in for $CFG->longtimenosee
/// Unenrol users who haven't logged in for $CFG->longtimenosee
if ($CFG->longtimenosee) { // value in days
$cutofftime = $timenow - ($CFG->longtimenosee * 3600 * 24);
if ($users = get_records_sql("SELECT u.* FROM user u, user_students s
WHERE lastaccess > '0' AND
lastaccess < '$cutofftime' AND
u.id = s.user GROUP BY u.id")) {
$longtime = $timenow - ($CFG->longtimenosee * 3600 * 24);
if ($users = get_users_longtimenosee($longtime)) {
foreach ($users as $user) {
if (unenrol_student($user->id)) {
echo "Deleted student enrolment for $user->firstname $user->lastname ($user->id)\n";
@@ -54,13 +55,10 @@
}
// Delete users who haven't confirmed within seven days
/// Delete users who haven't confirmed within seven days
$cutofftime = $timenow - (7 * 24 * 3600);
if ($users = get_records_sql("SELECT * FROM user
WHERE confirmed = '0' AND
firstaccess > '0' AND
firstaccess < '$cutofftime'")) {
$oneweek = $timenow - (7 * 24 * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records("user", "id", $user->id)) {
echo "Deleted unconfirmed user for $user->firstname $user->lastname ($user->id)\n";
@@ -68,6 +66,23 @@
}
}
/// Delete old queued mail that didn't get sent within 30 minutes
$oldmailtime = $timenow - 1800;
delete_records_select("mail_queue", "timecreated < '$oldmailtime'");
/// Delete old logs to save space (this might need a timer to slow it down...)
if (!empty($CFG->loglifetime)) { // value in days
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
delete_records_select("log", "time < '$loglifetime'");
}
echo "Cron script completed correctly\n";
$difftime = microtime_diff($starttime, microtime());
echo "Execution took ".$difftime." seconds\n";
?>
+63
View File
@@ -0,0 +1,63 @@
<?PHP //$Id$
// Deletes the moodledata directory, COMPLETELY!!
// BE VERY CAREFUL USING THIS!
require_once("../config.php");
require_login();
if (!isadmin()) {
error("You must be admin to use this script!");
}
$deletedir = $CFG->dataroot; // The directory to delete!
if (!$sure) {
notice_yesno ("Are you completely sure you want to delete everything inside the directory $deletedir ?", "delete.php?sure=yes", "index.php");
exit;
}
if (!$reallysure) {
notice_yesno ("Are you REALLY REALLY completely sure you want to delete everything inside the directory $deletedir (this includes all user images, and any other course files that have been created) ?", "delete.php?sure=yes&reallysure=yes", "index.php");
exit;
}
/// OK, here goes ...
delete_subdirectories($deletedir);
echo "<H1 align=center>Done!</H1>";
print_continue($CFG->wwwroot);
exit;
function delete_subdirectories($rootdir) {
$dir = opendir($rootdir);
while ($file = readdir($dir)) {
if ($file != "." and $file != "..") {
$fullfile = "$rootdir/$file";
if (filetype($fullfile) == "dir") {
delete_subdirectories($fullfile);
echo "Deleting $fullfile ... ";
if (rmdir($fullfile)) {
echo "Done.<BR>";
} else {
echo "FAILED.<BR>";
}
} else {
echo "Deleting $fullfile ... ";
if (unlink("$fullfile")) {
echo "Done.<BR>";
} else {
echo "FAILED.<BR>";
}
}
}
}
closedir($dir);
}
?>
+195 -65
View File
@@ -1,47 +1,132 @@
<?PHP // $Id$
require("../config.php");
/// 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;
}
require_once("../config.php");
/// Check that PHP is of a sufficient version
if ( ! check_php_version("4.1.0") ) {
if (!check_php_version("4.1.0")) {
$version = phpversion();
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
die;
}
/// Check some PHP server settings
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
if (ini_get_bool('session.auto_start')) {
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
}
if (ini_get_bool('magic_quotes_runtime')) {
error("The PHP server variable 'magic_quotes_runtime' should be Off - $documentationlink");
}
if (!ini_get_bool('magic_quotes_gpc')) {
error("The PHP server variable 'magic_quotes_gpc' is not turned On - $documentationlink");
}
if (!ini_get_bool('file_uploads')) {
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
}
if (!ini_get_bool('short_open_tag')) {
error("The PHP server variable 'short_open_tag' is not turned On - $documentationlink");
}
/// Check that sessions are supported
if (!is_readable(ini_get('session.save_path')) and !ini_get_bool('safe_mode')) {
$sessionpath = ini_get('session.save_path');
notify("Warning: It appears your server does not support sessions (session.save_path = '$sessionpath')");
}
/// Check that config.php has been edited
if ($CFG->wwwroot == "http://example.com/moodle") {
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() ) {
if (!$agreelicence) {
/// 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:
<P>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
<P>but it should be:
<P>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
"./");
}
/// Set some necessary variables during set-up to avoid PHP warnings later on this page
if (!isset($CFG->framename)) {
$CFG->framename = "_top";
}
if (!isset($CFG->release)) {
$CFG->release = "";
}
if (!isset($CFG->version)) {
$CFG->version = "";
}
/// 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;
}
}
}
if (! $maintables) {
if (empty($agreelicence)) {
$strlicense = get_string("license");
print_header($strlicense, $strlicense, $strlicense);
print_heading("<A HREF=\"http://moodle.com\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;");
print_heading("<A HREF=\"http://moodle.org\">Moodle</A> - Modular Object-Oriented Dynamic Learning Environment");
print_heading(get_string("copyrightnotice"));
print_simple_box_start("CENTER");
print_simple_box_start("center");
echo text_to_html(get_string("gpl"));
print_simple_box_end();
echo "<BR>";
echo "<br />";
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
"http://www.gnu.org/copyleft/gpl.html");
"http://moodle.org/doc/?frame=licence.html");
exit;
}
$strdatabasesetup = get_string("databasesetup");
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup);
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, "", "", false, "&nbsp;", "&nbsp;");
if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = true;
set_time_limit(0); // To allow slow databases to complete the long SQL
if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = false;
notify($strdatabasesuccess);
notify($strdatabasesuccess, "green");
} else {
$db->debug = false;
error("Error: Main databases NOT set up successfully");
@@ -56,7 +141,8 @@
/// Check version of Moodle code on disk compared with database
/// and upgrade if possible.
include_once("$CFG->dirroot/version.php"); # defines $version and upgrades
include_once("$CFG->dirroot/version.php"); # defines $version
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines upgrades
if ($CFG->version) {
if ($version > $CFG->version) { // upgrade
@@ -64,13 +150,14 @@
$a->newversion = $version;
$strdatabasechecking = get_string("databasechecking", "", $a);
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
notify($strdatabasechecking);
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
print_heading($strdatabasechecking);
$db->debug=true;
if (upgrade_moodle($CFG->version)) {
if (main_upgrade($CFG->version)) {
$db->debug=false;
if (set_config("version", $version)) {
notify($strdatabasesuccess);
notify($strdatabasesuccess, "green");
print_continue("index.php");
die;
} else {
@@ -85,16 +172,17 @@
}
} else {
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
$strcurrentversion = get_string("currentversion");
print_header($strcurrentversion, $strcurrentversion, $strcurrentversion,
"", "", false, "&nbsp;", "&nbsp;");
if (set_config("version", $version)) {
notify("You are currently using Moodle version $version (Release $release)");
print_heading("You are currently using Moodle version $version (Release $release)");
print_continue("index.php");
die;
} else {
$db->debug=true;
if (upgrade_moodle(0)) {
if (main_upgrade(0)) {
print_continue("index.php");
} else {
error("A problem occurred inserting current version into databases");
@@ -106,15 +194,15 @@
/// Updated human-readable release version if necessary
if ($release <> $CFG->release) { // Update the release version
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
$strcurrentrelease = get_string("currentrelease");
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;");
print_heading($release);
if (!set_config("release", $release)) {
notify("ERROR: Could not update release version in database!!");
}
print_continue("index.php");
print_simple_box_start("CENTER");
include("$CFG->dirroot/RELEASE.html");
include("$CFG->dirroot/lang/en/docs/release.html");
print_simple_box_end();
print_continue("index.php");
exit;
@@ -128,11 +216,29 @@
}
foreach ($mods as $mod) {
if ($mod == "NEWMODULE") { // Someone has unzipped the template, ignore it
continue;
}
$fullmod = "$CFG->dirroot/mod/$mod";
unset($module);
include_once("$fullmod/version.php"); # defines $module with version etc
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;
}
if (!isset($module)) {
continue;
@@ -144,7 +250,7 @@
if ($currmodule->version == $module->version) {
// do nothing
} else if ($currmodule->version < $module->version) {
notify("$module->name module needs upgrading");
print_heading("$module->name module needs upgrading");
$upgrade_function = $module->name."_upgrade";
if (function_exists($upgrade_function)) {
$db->debug=true;
@@ -155,7 +261,8 @@
if (! update_record("modules", $module)) {
error("Could not update $module->name record in modules table!");
}
notify(get_string("modulesuccess", "", $module->name));
notify(get_string("modulesuccess", "", $module->name), "green");
echo "<HR>";
} else {
$db->debug=false;
notify("Upgrading $module->name from $currmodule->version to $module->version FAILED!");
@@ -167,16 +274,19 @@
}
} else { // module not installed yet, so install it
if (!$updated_modules) {
if (empty($updated_modules)) {
$strmodulesetup = get_string("modulesetup");
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup);
print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, "", "", false, "&nbsp;", "&nbsp;");
}
print_heading($module->name);
$updated_modules = true;
$db->debug = true;
set_time_limit(0); // To allow slow databases to complete the long SQL
if (modify_database("$fullmod/db/$CFG->dbtype.sql")) {
$db->debug = false;
if ($module->id = insert_record("modules", $module)) {
notify(get_string("modulesuccess", "", $module->name));
notify(get_string("modulesuccess", "", $module->name), "green");
echo "<HR>";
} else {
error("$module->name module could not be added to the module list!");
}
@@ -186,7 +296,7 @@
}
}
if ($updated_modules) {
if (!empty($updated_modules)) {
print_continue("index.php");
die;
}
@@ -196,64 +306,84 @@
include_once("$CFG->dirroot/lib/defaults.php");
$CFG = (array)$CFG;
foreach ($defaults as $name => $value) {
if (!isset($CFG[$name])) {
$config->name = $name;
$config->value = $CFG[$name] = $value;
insert_record("config", $config);
if (!isset($CFG->$name)) {
$CFG->$name = $value;
set_config($name, $value);
$configchange = true;
}
}
$CFG = (object)$CFG;
/// If any new configurations were found then send to the config page to check
if ($configchange) {
redirect("$CFG->wwwroot/admin/config.php");
if (!empty($configchange)) {
redirect("config.php");
}
/// Set up the overall site name etc.
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/site.php");
redirect("site.php");
}
/// Set up the admin user
if (!isadmin()) {
if (! record_exists_sql("SELECT * FROM user_admins")) { // No admin user yet
redirect("$CFG->wwwroot/admin/user.php");
}
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/");
if (! record_exists("user_admins")) { // No admin user yet
redirect("user.php");
}
/// Check for valid admin user
if (!iscreator()) {
error("You need to be an admin user or teacher to use this page.", "$CFG->wwwroot/login/index.php");
}
/// At this point everything is set up and the user is an admin, so print menu
$stradministration = get_string("administration");
print_header("$site->fullname: $stradministration","$site->fullname: $stradministration", "$stradministration");
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
$table->align = array ("CENTER", "CENTER", "CENTER");
$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>";
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "<P><A HREF=\"$CFG->dbtype/\">".get_string("managedatabase")."</A></P>";
}
$table->data[0][1] = "<P><A HREF=\"../course/edit.php\">".get_string("addnewcourse")."</A></P>".
"<P><A HREF=\"../course/teacher.php\">".get_string("assignteachers")."</A></P>".
"<P><A HREF=\"../course/delete.php\">".get_string("deletecourse")."</A></P>".
"<P><A HREF=\"../course/categories.php\">".get_string("categories")."</A></P>";
$table->data[0][2] = "<P><A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A></P>".
"<P><A HREF=\"user.php\">".get_string("edituser")."</A></P>";
print_header("$site->shortname: $stradministration","$site->fullname: $stradministration", "$stradministration");
if (isadmin()) {
$table->head = array (get_string("site"), get_string("courses"), get_string("users"));
$table->align = array ("CENTER", "CENTER", "CENTER");
$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>";
if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) {
$table->data[0][0] .= "<p><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></p>";
}
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
"<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>";
}
$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>";
} else { /// user is coursecreator
$table->head = array (get_string("courses"));
$table->align = array ("CENTER");
$table->data[0][1] = "<p><a href=\"../course/edit.php\">".get_string("addnewcourse")."</a></p>".
"<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>";
}
print_table($table);
echo "<br><div align=center>";
print_single_button("$CFG->wwwroot/doc", NULL, get_string("documentation"));
echo "</div>";
echo "<br><div align=center>";
print_single_button("register.php", NULL, get_string("registration"));
echo "</div>";
print_heading("Moodle $CFG->release ($CFG->version)", "CENTER", 1);
print_footer();
print_footer($site);
?>
+47 -33
View File
@@ -1,6 +1,6 @@
<?PHP // $Id$
require("../config.php");
require_once("../config.php");
optional_variable($mode, "");
@@ -31,23 +31,24 @@
$title = $strcomparelanguage;
break;
default:
$title = $strchecklanguage;
$navigation = $strchecklanguage;
break;
}
if ($USER->lang) {
$currentlang = $USER->lang;
} else {
$currentlang = $CFG->lang;
}
$currentlang = current_language();
print_header("$site->fullname: $title", "$site->fullname",
"<A HREF=\"index.php\">$stradministration</A> -> $navigation");
print_header("$site->shortname: $title", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $navigation");
if (!$mode) {
print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage"));
print_heading("<A HREF=\"lang.php?mode=missing\">$strmissingstrings</A>");
print_heading("<A HREF=\"lang.php?mode=compare\">$strcomparelanguage</A>");
print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>");
print_heading("<a href=\"lang.php?mode=compare\">$strcomparelanguage</a>");
echo "<center><hr noshade size=1>";
$options["lang"] = $currentlang;
print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack"));
echo "</center>";
print_footer();
exit;
}
@@ -62,7 +63,7 @@
}
foreach ($stringfiles as $key => $file) {
if ($file == "README" or $file == "help" or $file == "docs") {
if ($file == "README" or $file == "help" or $file == "docs" or $file == "fonts") {
unset($stringfiles[$key]);
}
}
@@ -85,15 +86,16 @@
$first = true;
foreach ($enstring as $key => $value) {
if (!isset($string[$key])) {
$value = htmlentities($value);
if (!isset($string[$key]) or $string[$key] == "") {
$value = htmlspecialchars($value);
$value = str_replace("$"."a", "\\$"."a", $value);
$value = str_replace("%%","%",$value);
if ($first) {
echo "</PRE><HR><P><B>".get_string("stringsnotset","","$langdir/$file")."</B></P><PRE>";
$first = false;
$somethingfound = true;
}
echo "$"."string[$key] = \"$value\";<BR>";
echo "$"."string['$key'] = \"$value\";<BR>";
}
}
}
@@ -121,7 +123,7 @@
}
}
if ($somethingfound) {
if (!empty($somethingfound)) {
print_continue("lang.php");
} else {
notice(get_string("languagegood"), "lang.php");
@@ -129,8 +131,8 @@
} else if ($mode == "compare") {
if (isset($HTTP_POST_VARS['file'])){ // Save a file
$newstrings = $HTTP_POST_VARS;
if (isset($_POST['file'])){ // Save a file
$newstrings = $_POST;
$file = $newstrings['file'];
unset($newstrings['file']);
if (lang_save_file($langdir, $file, $newstrings)) {
@@ -146,7 +148,7 @@
echo "</CENTER>";
foreach ($stringfiles as $file) {
print_heading("$file", "LEFT", 4);
if (!file_exists("$langdir/$file")) {
@@ -178,18 +180,29 @@
}
echo "<TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=3 BORDER=0>";
foreach ($enstring as $key => $envalue) {
$envalue = nl2br(htmlentities($envalue));
$envalue = str_replace("\$a","<B>\$a</B>", $envalue); // Make variables bold
// TODO: It would be nice if all the $a->something variables were bold too
$envalue = nl2br(htmlspecialchars($envalue));
$envalue = preg_replace('/(\$a\-\&gt;[a-zA-Z0-9]*|\$a)/', '<b>$0</b>', $envalue); // Make variables bold.
$envalue = str_replace("%%","%",$envalue);
echo "<TR>";
echo "<TD WIDTH=20% BGCOLOR=\"$THEME->cellheading\" NOWRAP VALIGN=TOP>$key</TD>";
echo "<TD WIDTH=40% BGCOLOR=\"$THEME->cellheading\" VALIGN=TOP>$envalue</TD>";
$value = str_replace("\\","",$string[$key]); // Delete all slashes
$value = htmlentities($value);
$value = $string[$key];
$value = str_replace("\r","",$value); // Bad character caused by Windows
$value = str_replace("\n\n\n\n\n\n","\n",$value); // Collapse runs of blank lines
$value = str_replace("\n\n\n\n\n","\n",$value);
$value = str_replace("\n\n\n\n","\n",$value);
$value = str_replace("\n\n\n","\n",$value);
$value = str_replace("\n\n\n","\n",$value);
$value = str_replace("\\","",$value); // Delete all slashes
$value = str_replace("%%","%",$value);
$value = htmlspecialchars($value);
$cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
if ($editable) {
echo "<TD WIDTH=40% VALIGN=TOP>";
echo "<TD WIDTH=40% BGCOLOR=\"$cellcolour\" VALIGN=TOP>";
if (isset($string[$key])) {
$valuelen = strlen($value);
} else {
@@ -200,17 +213,15 @@
$rows = ceil($valuelen / $cols);
echo "<TEXTAREA NAME=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</TEXTAREA>";
} else {
$cols = $valuelen + 2;
if ($valuelen) {
$cols = $valuelen + 2;
}
echo "<INPUT TYPE=\"TEXT\" NAME=\"string-$key\" VALUE=\"$value\" SIZE=\"$cols\"></TD>";
}
echo "</TD>";
} else {
if (isset($string[$key])) {
echo "<TD WIDTH=40% BGCOLOR=white VALIGN=TOP>$value</TD>";
} else {
echo "<TD WIDTH=40% BGCOLOR=white ALIGN=CENTER VALIGN=TOP>-</TD>";
}
echo "<TD WIDTH=40% BGCOLOR=\"$cellcolour\" VALIGN=TOP>$value</TD>";
}
}
if ($editable) {
@@ -256,10 +267,13 @@ function lang_save_file($path, $file, $strings) {
foreach ($strings as $key => $value) {
list($id, $stringname) = explode("-",$key);
$value = str_replace("\\","",$value); // Delete all slashes
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
$value = str_replace("\\","",$value); // Delete all slashes
}
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
$value = str_replace("\"", "\\\"", $value); // Add slashes for "
if ($id == "string"){
$value = str_replace("\"", "\\\\\\\"", $value); // Add slashes for "
$value = str_replace("%","%%",$value); // Escape % characters
if ($id == "string" and $value != ""){
fwrite($f,"\$string['$stringname'] = \"$value\";\n");
}
}
+182
View File
@@ -0,0 +1,182 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
require_once("../config.php");
require_once("../course/lib.php");
optional_variable($disable);
optional_variable($enable);
optional_variable($delete);
optional_variable($confirm);
if (!isadmin()) {
error("Only administrators can use this page!");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stradministration = get_string("administration");
$strmanagemodules = get_string("managemodules");
$strdelete = get_string("delete");
$strhide = get_string("hide");
$strshow = get_string("show");
$stractivitymodule = get_string("activitymodule");
print_header("$site->shortname: $strmanagemodules", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strmanagemodules");
print_heading($strmanagemodules);
/// If data submitted, then process and store.
if (!empty($hide)) {
if (!$module = get_record("modules", "name", $hide)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
}
if (!empty($show)) {
if (!$module = get_record("modules", "name", $show)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
}
if (!empty($delete)) {
$strmodulename = get_string("modulename", "$delete");
if (empty($confirm)) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&confirm=$delete",
"modules.php");
print_footer();
exit;
} else { // Delete everything!!
if ($delete == "forum") {
error("You can not delete the forum module!!");
}
if (!$module = get_record("modules", "name", $delete)) {
error("Module doesn't exist!");
}
// OK, first delete all the relevant instances from all course sections
if ($coursemods = get_records("course_modules", "module", $module->id)) {
foreach ($coursemods as $coursemod) {
if (! delete_mod_from_section($coursemod->id, $coursemod->section)) {
notify("Could not delete the $strmodulename with id = $coursemod->id from section $coursemod->section");
}
}
}
// Now delete all the course module records
if (!delete_records("course_modules", "module", $module->id)) {
notify("Error occurred while deleting all $strmodulename records in course_modules table");
}
// Then delete all the logs
if (!delete_records("log", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log table");
}
// And log_display information
if (!delete_records("log_display", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log_display table");
}
// And the module entry itself
if (!delete_records("modules", "name", $module->name)) {
notify("Error occurred while deleting the $strmodulename record from modules table");
}
// Then the tables themselves
if ($tables = $db->Metatables()) {
$prefix = $CFG->prefix.$module->name;
foreach ($tables as $table) {
if (strpos($table, $prefix) === 0) {
if (!execute_sql("DROP TABLE $table", false)) {
notify("ERROR: while trying to drop table $table");
}
}
}
}
rebuild_course_cache(); // Because things have changed
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
notice(get_string("moduledeletefiles", "", $a), "modules.php");
}
}
/// Get and sort the existing modules
if (!$modules = get_records("modules")) {
error("No modules found!!"); // Should never happen
}
foreach ($modules as $module) {
$strmodulename = get_string("modulename", "$module->name");
$modulebyname[$strmodulename] = $module;
}
ksort($modulebyname);
/// Print the table of all modules
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$table->head = array ($stractivitymodule, "$strhide/$strshow", $strdelete);
$table->align = array ("LEFT", "CENTER", "CENTER");
$table->wrap = array ("NOWRAP", "", "");
$table->size = array ("100%", "10", "10");
$table->width = "100";
foreach ($modulebyname as $modulename => $module) {
$icon = "<img src=\"$modpixpath/$module->name/icon.gif\" hspace=10 height=16 width=16 border=0>";
$delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name\" title=\"$strhide\">".
"<img src=\"$pixpath/i/hide.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
$class = "";
} else {
$visible = "<a href=\"modules.php?show=$module->name\" title=\"$strshow\">".
"<img src=\"$pixpath/i/show.gif\" align=\"absmiddle\" height=16 width=16 border=0></a>";
$class = "class=\"dimmed_text\"";
}
if ($module->name == "forum") {
$delete = "";
$visible = "";
$class = "";
}
$table->data[] = array ("<p $class>$icon $modulename</p>", $visible, $delete);
}
print_table($table);
echo "<br /><br />";
print_footer();
?>
+22
View File
@@ -0,0 +1,22 @@
<?PHP // $Id$
// phpinfo.php - shows phpinfo for the current server
require_once("../config.php");
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
$stradministration = get_string("administration");
$site = get_site();
print_header("$site->shortname: phpinfo", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> phpinfo");
phpinfo();
print_footer();
?>
+138
View File
@@ -0,0 +1,138 @@
<?PHP // $Id$
// register.php - allows admin to register their site on moodle.org
include("../config.php");
require_once("../lib/countries.php");
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
if (!$site = get_site()) {
redirect("index.php");
}
if (!$admin = get_admin()) {
error("No admins");
}
if (!$admin->country and $CFG->country) {
$admin->country = $CFG->country;
}
if (!$admin->secret) { // secret field hasn't been set yet
$admin->secret = random_string(15);
if (!set_field("user", "secret", $admin->secret, "id", $admin->id)) {
error("Could not set admin's secret string!");
}
}
/// Print headings
$stradministration = get_string("administration");
$strregistration = get_string("registration");
$strregistrationinfo = get_string("registrationinfo");
print_header("$site->shortname: $strregistration", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration");
print_heading($strmanagemodules);
print_simple_box($strregistrationinfo, "center", "70%");
echo "<br />";
/// Print the form
print_simple_box_start("center", "", "$THEME->cellheading");
echo "<form name=\"form\" action=\"http://moodle.org/register/\" method=post>\n";
echo "<table cellpadding=9 border=0>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>Moodle URL:</td>\n";
echo "<td><p>$CFG->wwwroot</td>\n";
echo "<!-- The following hidden variables are to help prevent fake entries being sent. -->\n";
echo "<!-- Together they form a key. If any of these change between updates then the entry -->\n";
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
echo "<input type=\"hidden\" name=\"secret\" value=\"$admin->secret\">\n";
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
echo "</td></tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("currentversion").":</td>\n";
echo "<td><p>$CFG->release ($CFG->version)</td>\n";
echo "<input type=\"hidden\" name=\"version\" value=\"$CFG->version\">\n";
echo "<input type=\"hidden\" name=\"release\" value=\"$CFG->release\">\n";
echo "</td></tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("fullsitename").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"sitename\" value=\"$site->fullname\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("country").":</td>\n";
echo "<td><p>";
choose_from_menu ($COUNTRIES, "country", $admin->country, get_string("selectacountry")."...", "", "");
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p><a href=\"http://moodle.org/sites\" title=\"See the current list of sites\" target=_blank>".get_string("publicdirectory")."</a>:</td>\n";
echo "<td><p>";
$options[0] = get_string("publicdirectory0");
$options[1] = get_string("publicdirectory1");
$options[2] = get_string("publicdirectory2");
choose_from_menu ($options, "public", "2", "", "", "");
unset($options);
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td colspan=2><hr size=1 noshade>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("administrator").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"adminname\" value=\"$admin->firstname $admin->lastname\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("email").":</td>\n";
echo "<td><p><input size=50 type=\"text\" name=\"adminemail\" value=\"$admin->email\"></td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right><p>".get_string("registrationemail")."</a>:</td>\n";
echo "<td><p>\n";
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
choose_from_menu ($options, "mailme", "1", "", "", "");
unset($options);
echo "</td>\n";
echo "</tr>\n";
echo "<tr valign=top>\n";
echo "<td align=right>&nbsp;</td>\n";
echo "<td><p><input type=\"submit\" value=\"".get_string("registrationsend")."\"></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
print_simple_box_end();
echo "<br />\n";
print_footer();
?>
+30 -28
View File
@@ -1,28 +1,31 @@
<FORM METHOD="post" action="site.php" NAME="form">
<TABLE cellpadding=9 cellspacing=0 >
<form method="post" action="site.php" name="form">
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td align=right><P><? print_string("fullsitename") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
<? formerr($err["fullname"]) ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("shortsitename") ?>:</td>
<td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
<? formerr($err["shortname"]) ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
<? helpbutton("text", get_string("helptext")) ?>
</td>
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
<? formerr($err["summary"]) ?>
<td align=right><P><?php print_string("fullsitename") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<?php p($form->fullname) ?>">
<?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><? print_string("frontpageformat") ?>:</td>
<td><?
<td align=right><P><?php print_string("shortsitename") ?>:</td>
<td><input type="text" name="shortname" size=50 value="<?php p($form->shortname) ?>">
<?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><?php print_string("frontpagedescription") ?>:</P><br />
<font size=1>
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
<?php helpbutton("html", get_string("helphtml"), "moodle", true, true) ?><br />
</font>
</td>
<td><textarea name=summary cols=50 rows=10 wrap=virtual><?php p($form->summary) ?></textarea>
<?php if (isset($err["summary"])) formerr($err["summary"]); ?>
</td>
</tr>
<tr valign=top>
<td align=right><P><?php print_string("frontpageformat") ?>:</td>
<td><?php
$newsitem = get_string("newsitem");
$newsitems = get_string("newsitems");
$options = array("0" => get_string("showlistofcourses"),
@@ -37,16 +40,15 @@
"9" => "9 $newsitems",
"10" => "10 $newsitems");
choose_from_menu ($options, "newsitems", "$form->newsitems", "");
formerr($err["newsitems"]);
?>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</TABLE>
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
<INPUT type="hidden" name="category" value="<?=$form->category ?>">
<INPUT type="hidden" name="format" value="<?=$form->format ?>">
</FORM>
</table>
<input type="hidden" name="id" value="<?php p($form->id) ?>">
<input type="hidden" name="category" value="<?php p($form->category) ?>">
<input type="hidden" name="format" value="<?php p($form->format) ?>">
</form>
+34 -15
View File
@@ -1,19 +1,17 @@
<?PHP // $Id$
require("../config.php");
require_once("../config.php");
if ($site = get_site()) {
if (!isadmin()) {
error("You need to be admin to edit this page");
}
$site->format = "social"; // override
}
$site->format = "social"; // override
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
$form = (object)$HTTP_POST_VARS;
if ($form = data_submitted()) {
validate_form($form, $err);
@@ -23,7 +21,7 @@
if ($form->id) {
if (update_record("course", $form)) {
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not update the site record! (id = $form->id)");
}
@@ -31,7 +29,7 @@
if ($newid = insert_record("course", $form)) {
$cat->name = get_string("miscellaneous");
if (insert_record("course_categories", $cat)) {
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"), "1");
redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
} else {
error("Serious Error! Could not set up a default course category!");
}
@@ -39,36 +37,57 @@
error("Serious Error! Could not set up the site!");
}
}
die;
die;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
}
}
/// Otherwise fill and print the form.
if ($site && !$form) {
if ($site and empty($form)) {
$form = $site;
$firsttime = false;
} else {
$form->fullname = "";
$form->shortname = "";
$form->summary = "";
$form->newsitems = 0;
$form->id = "";
$form->category = 0;
$form->format = "social";
$form->newsitems = 0;
$firsttime = true;
}
if (empty($focus)) {
$focus = "form.fullname";
}
$stradmin = get_string("administration");
$strsitesettings = get_string("sitesettings");
print_header("$site->fullname", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradmin</A> -> $strsitesettings", "$focus");
if ($firsttime) {
print_header();
print_heading($strsitesettings);
print_simple_box(get_string("configintrosite"), "center");
echo "<br />";
} else {
print_header("$site->shortname: $strsitesettings", "$site->fullname",
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
print_heading($strsitesettings);
}
print_heading($strsitesettings);
print_simple_box_start("center", "", "$THEME->cellheading");
include("site.html");
include("site.html");
print_simple_box_end();
print_footer();
if (!$firsttime) {
print_footer();
}
exit;
+204
View File
@@ -0,0 +1,204 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 30);
optional_variable($id); // course id
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, ""); // search string
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!iscreator()) {
error("You must be an administrator or course creator to use this page.");
}
$strassignteachers = get_string("assignteachers");
$stradministration = get_string("administration");
$strexistingteachers = get_string("existingteachers");
$strnoexistingteachers = get_string("noexistingteachers");
$strpotentialteachers = get_string("potentialteachers");
$strnopotentialteachers = get_string("nopotentialteachers");
$straddteacher = get_string("addteacher");
$strremoveteacher = get_string("removeteacher");
$strsearch = get_string("search");
$strsearchresults = get_string("searchresults");
$strsearchagain = get_string("searchagain");
$strtoomanytoshow = get_string("toomanytoshow");
if ($search) {
$searchstring = $strsearchagain;
} else {
$searchstring = $strsearch;
}
if (!$id) {
print_header("$site->shortname: $strassignteachers", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> $strassignteachers");
$isadmin = isadmin(); /// cache value
$courses = get_courses();
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
foreach ($courses as $course) {
if ($isadmin or isteacher($course->id, $USER->id)){
echo "<a href=\"teacher.php?id=$course->id\">$course->fullname ($course->shortname)</a><br>\n";
$coursesfound = TRUE;
}
}
print_simple_box_end();
if ($coursesfound == FALSE) {
print_heading(get_string("nocoursesyet"));
print_continue("../$CFG->admin/index.php");
}
print_footer();
exit;
}
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
print_header("$site->shortname: $course->shortname: $strassignteachers",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> ->
<a href=\"teacher.php\">$strassignteachers</a> -> $course->shortname", "");
print_heading("<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname ($course->shortname)</a>");
/// Get all existing teachers for this course.
$teachers = get_course_teachers($course->id);
/// Add a teacher if one is specified
if (!empty($add)) {
if (!isteacher($course->id)){
error("You must be an administrator or teacher to modify this course.");
}
if (! $user = get_record("user", "id", $add)) {
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $tt) {
if ($tt->id == $user->id) {
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
}
}
}
$teacher->userid = $user->id;
$teacher->course = $course->id;
if (!empty($teachers)) {
$teacher->authority = 2;
} else {
$teacher->authority = 1; // First teacher is the main teacher
}
$teacher->id = insert_record("user_teachers", $teacher);
if (empty($teacher->id)) {
error("Could not add that teacher to this course!");
}
$teachers[] = $user;
}
/// Remove a teacher if one is specified.
if (!empty($remove)) {
if (!isteacher($course->id)){
error("You must be an administrator or teacher to modify this course.");
}
if (! $user = get_record("user", "id", $remove)) {
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
}
if (!empty($teachers)) {
foreach ($teachers as $key => $tt) {
if ($tt->id == $user->id) {
remove_teacher($user->id, $course->id);
unset($teachers[$key]);
}
}
}
}
/// Print the lists of existing and potential teachers
echo "<table cellpadding=2 cellspacing=10 align=center>";
echo "<tr><th width=50%>$strexistingteachers</th><th width=50%>$strpotentialteachers</th></tr>";
echo "<tr><td width=50% nowrap valign=top>";
/// First, show existing teachers for this course
if (empty($teachers)) {
echo "<p align=center>$strnoexistingteachers</a>";
$teacherlist = "";
} else {
$teacherarray = array();
foreach ($teachers as $teacher) {
$teacherarray[] = $teacher->id;
echo "<p align=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;&nbsp; <a href=\"teacher.php?id=$course->id&remove=$teacher->id\" title=\"$strremoveteacher\"><img src=\"../pix/t/right.gif\" border=0></a></p>";
}
$teacherlist = implode(",",$teacherarray);
unset($teacherarray);
}
echo "<td width=50% nowrap valign=top>";
/// Print list of potential teachers
$usercount = get_users(false, $search, true, $teacherlist);
if ($usercount == 0) {
echo "<p align=center>$strnopotentialteachers</p>";
} else if ($usercount > MAX_USERS_PER_PAGE) {
echo "<p align=center>$strtoomanytoshow</p>";
} else {
if ($search) {
echo "<p align=center>($strsearchresults : $search)</p>";
}
if (!$users = get_users(true, $search, true, $teacherlist)) {
error("Could not get users!");
}
foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?id=$course->id&add=$user->id\"".
"title=\"$straddteacher\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
}
if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<input type=hidden name=id value=\"$course->id\">";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
}
echo "</tr></table>";
print_footer();
?>
+130 -57
View File
@@ -1,22 +1,27 @@
<?PHP // $Id$
require("../config.php");
require("../user/lib.php");
require("../lib/countries.php");
require_once("../config.php");
require_once("../user/lib.php");
require_once("../lib/countries.php");
$recordsperpage = 30;
optional_variable($newuser, "");
optional_variable($delete, "");
optional_variable($confirm, "");
optional_variable($sort, "name");
optional_variable($dir, "ASC");
optional_variable($page, 0);
optional_variable($search, "");
if (! record_exists_sql("SELECT * FROM user_admins")) { // No admin user yet
$user->firstname = "Admin";
$user->lastname = "User";
if (! record_exists("user_admins")) { // No admin user yet
$user->firstname = get_string("admin");
$user->lastname = get_string("user");
$user->username = "admin";
$user->password = md5("admin");
$user->email = "root@localhost";
$user->confirmed = 1;
$user->lang = $CFG->lang;
$user->maildisplay = 1;
$user->timemodified = time();
@@ -24,7 +29,7 @@
error("SERIOUS ERROR: Could not create admin user record !!!");
}
$admin->user = $user->id;
$admin->userid = $user->id;
if (! insert_record("user_admins", $admin)) {
error("Could not make user $user->id an admin !!!");
@@ -38,7 +43,7 @@
error("Could not find site-level course");
}
$teacher->user = $user->id;
$teacher->userid = $user->id;
$teacher->course = $site->id;
$teacher->authority = 1;
if (! insert_record("user_teachers", $teacher)) {
@@ -50,9 +55,10 @@
$USER->site = $CFG->wwwroot;
$USER->admin = true;
$USER->teacher["$site->id"] = true;
save_session("USER");
$USER->newadminuser = true;
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&course=$site->id");
exit;
} else {
if (! $site = get_site()) {
@@ -72,6 +78,7 @@
$user->username = "changeme";
$user->password = "";
$user->email = "";
$user->lang = $CFG->lang;
$user->confirmed = 1;
$user->timemodified = time();
@@ -90,9 +97,11 @@
$stredit = get_string("edit");
$strdelete = get_string("delete");
$strdeletecheck = get_string("deletecheck");
$strsearch = get_string("search");
$strshowallusers = get_string("showallusers");
print_header("$site->fullname : $stredituser", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $stredituser");
print_header("$site->shortname: $stredituser", $site->fullname,
"<A HREF=\"index.php\">$stradministration</A> -> $stredituser");
if ($delete) { // Delete a selected user, after confirmation
if (!$user = get_record("user", "id", "$delete")) {
@@ -105,7 +114,7 @@
exit;
} else if (!$user->deleted) {
$user->deleted = "1";
$user->username = $user->email; // Remember it just in case
$user->username = "$user->email.".time(); // Remember it just in case
$user->email = ""; // Clear this field to free it up
$user->timemodified = time();
if (update_record("user", $user)) {
@@ -121,6 +130,7 @@
// Carry on with the user listing
$columns = array("name", "email", "city", "country", "lastaccess");
foreach ($columns as $column) {
@@ -134,7 +144,7 @@
if ($columnsort == $sort) {
$$column = $string[$column];
} else {
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir\">".$string[$column]."</A>";
$$column = "<A HREF=\"user.php?sort=$columnsort&dir=$columndir&search=$search\">".$string[$column]."</A>";
}
}
@@ -142,54 +152,117 @@
$sort = "firstname";
}
if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest'
AND deleted <> '1' ORDER BY $sort $dir")) {
if (!$users = get_users_listing($sort, $dir, $page, $recordsperpage, $search)) {
if (!$users = get_users_listing($sort, $dir, 0, $recordsperpage)) {
error("No users found!");
} else {
notify(get_string("nousersmatching", "", $search));
$search = "";
}
}
foreach ($users as $key => $user) {
$usercount = get_users(false);
if ($search) {
$usersearchcount = get_users(false, $search);
print_heading("$usersearchcount / $usercount ".get_string("users"));
$usercount = $usersearchcount;
} else {
print_heading("$usercount ".get_string("users"));
}
$a->start = $page;
$a->end = $page + $recordsperpage;
if ($a->end > $usercount) {
$a->end = $usercount;
}
echo "<TABLE align=center cellpadding=10><TR>";
echo "<TD>";
if ($page) {
$prevpage = $page - $recordsperpage;
if ($prevpage < 0) {
$prevpage = 0;
}
$options["dir"] = $dir;
$options["page"] = 0;
$options["sort"] = $sort;
$options["search"] = $search;
print_single_button("user.php", $options, " << ");
echo "</TD><TD>";
$options["page"] = $prevpage;
print_single_button("user.php", $options, " < ");
}
echo "</TD><TD>";
print_heading(get_string("displayingusers", "", $a));
echo "</TD><TD>";
$nextpage = $page + $recordsperpage;
if ($nextpage < $usercount) {
$options["dir"] = $dir;
$options["page"] = $nextpage;
$options["sort"] = $sort;
$options["search"] = $search;
print_single_button("user.php", $options, " > ");
echo "</TD><TD>";
$options["page"] = $usercount-$recordsperpage;
print_single_button("user.php", $options, " >> ");
}
echo "</TD></TR></TABLE>";
flush();
foreach ($users as $key => $user) {
if (!empty($user->country)) {
$users[$key]->country = $COUNTRIES[$user->country];
}
if ($sort == "country") { // Need to resort by full country name, not code
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
$users = $nusers;
}
print_heading(get_string("chooseuser"));
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
$table->width = "95%";
foreach ($users as $user) {
if ($user->id == $USER->id or $user->username == "changeme") {
$deletebutton = "";
} else {
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
}
if ($user->lastaccess) {
$strlastaccess = format_time(time() - $user->lastaccess);
} else {
$strlastaccess = get_string("never");
}
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
"$user->email",
"$user->city",
"$user->country",
$strlastaccess,
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
$deletebutton);
}
print_table($table);
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
} else {
error("No users found!");
}
if ($sort == "country") { // Need to resort by full country name, not code
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
$users = $nusers;
}
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
$table->width = "95%";
foreach ($users as $user) {
if ($user->id == $USER->id or $user->username == "changeme") {
$deletebutton = "";
} else {
$deletebutton = "<A HREF=\"user.php?delete=$user->id\" TARGET=\"$strdeletecheck\">$strdelete</A>";
}
if ($user->lastaccess) {
$strlastaccess = format_time(time() - $user->lastaccess);
} else {
$strlastaccess = get_string("never");
}
$table->data[] = array ("<A HREF=\"../user/view.php?id=$user->id&course=$site->id\">$user->firstname $user->lastname</A>",
"$user->email",
"$user->city",
"$user->country",
$strlastaccess,
"<A HREF=\"../user/edit.php?id=$user->id&course=$site->id\">$stredit</A>",
$deletebutton);
}
echo "<TABLE align=center cellpadding=10><TR><TD>";
echo "<FORM ACTION=user.php METHOD=POST>";
echo "<INPUT TYPE=text NAME=search VALUE=\"$search\" SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
if ($search) {
echo "<INPUT type=\"button\" onClick=\"document.location='user.php';\" value=\"$strshowallusers\">";
}
echo "</FORM>";
echo "</TD></TR></TABLE>";
print_table($table);
print_heading("<A HREF=\"user.php?newuser=true\">".get_string("addnewuser")."</A>");
print_footer();
}
+49
View File
@@ -31,5 +31,54 @@ none - no authentication at all .. very insecure!!
- when user tries to access a course they
are forced to set up their account details
manual - internal authentication only
- user logs in using username and password
- no way for user to make their own account
ldap - Uses an external LDAP server
- user logs in using username and password
- these are checked against an LDAP server
- if correct, user is logged in
- optionally, info is copied from the LDAP
database to the Moodle user database
(see the ldap/README for more details on config etc...)
imap - Uses an external IMAP server
- user logs in using username and password
- these are checked against an IMAP server
- if correct, user is logged in
- if the username doesn't already exist then
a new account is created
pop3 - Uses an external POP3 server
- user logs in using username and password
- these are checked against a POP3 server
- if correct, user is logged in
- if the username doesn't already exist then
a new account is created
nntp - Uses an external NNTP server
- user logs in using username and password
- these are checked against an NNTP server
- if correct, user is logged in
- if the username doesn't already exist then
a new account is created
db - Uses an external database to check username/password
- user logs in using username and password
- these are checked against an external database
- if correct, user is logged in
- if the username doesn't already exist then
a new Moodle account is created
+235
View File
@@ -0,0 +1,235 @@
<?PHP
if (!isset($config->auth_dbhost)) {
$config->auth_dbhost = "localhost";
}
if (!isset($config->auth_dbtype)) {
$config->auth_dbtype = "mysql";
}
if (!isset($config->auth_dbname)) {
$config->auth_dbname = "";
}
if (!isset($config->auth_dbuser)) {
$config->auth_dbuser = "";
}
if (!isset($config->auth_dbpass)) {
$config->auth_dbpass = "";
}
if (!isset($config->auth_dbtable)) {
$config->auth_dbtable = "";
}
if (!isset($config->auth_dbfielduser)) {
$config->auth_dbfielduser = "";
}
if (!isset($config->auth_dbfieldpass)) {
$config->auth_dbfieldpass = "";
}
if (!isset($config->auth_dbpasstype)) {
$config->auth_dbpasstype = "plaintext";
}
?>
<tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbhost:</TD>
<TD>
<INPUT name=auth_dbhost TYPE=text SIZE=30 VALUE="<?=$config->auth_dbhost?>">
<? if (isset($err["auth_dbhost"])) formerr($err["auth_dbhost"]); ?>
</TD>
<TD>
<? print_string("auth_dbhost","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbtype:</TD>
<TD>
<? $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
foreach ($dbtypes as $dbtype) {
$dboptions[$dbtype] = $dbtype;
}
choose_from_menu($dboptions, "auth_dbtype", $config->auth_dbtype, "");
?>
</TD>
<TD>
<? print_string("auth_dbtype","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbname:</TD>
<TD>
<INPUT name=auth_dbname TYPE=text SIZE=30 VALUE="<?=$config->auth_dbname?>">
<? if (isset($err["auth_dbname"]))formerr($err["auth_dbname"]); ?>
</TD>
<TD>
<? print_string("auth_dbname","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbuser:</TD>
<TD>
<INPUT name=auth_dbuser TYPE=text SIZE=30 VALUE="<?=$config->auth_dbuser?>">
<? if (isset($err["auth_dbuser"])) formerr($err["auth_dbuser"]); ?>
</TD>
<TD>
<? print_string("auth_dbuser","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbpass:</TD>
<TD>
<INPUT name="auth_dbpass" TYPE="text" SIZE="30" VALUE="<?=$config->auth_dbpass?>">
<? if (isset($err["auth_dbpass"])) formerr($err["auth_dbpass"]); ?>
</TD>
<TD>
<? print_string("auth_dbpass","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbtable:</TD>
<TD>
<INPUT name="auth_dbtable" TYPE="text" SIZE="30" VALUE="<?=$config->auth_dbtable?>">
<? if (isset($err["auth_dbtable"])) formerr($err["auth_dbtable"]); ?>
</TD>
<TD>
<? print_string("auth_dbtable","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbfielduser:</TD>
<TD>
<INPUT name="auth_dbfielduser" TYPE="text" SIZE="30" VALUE="<?=$config->auth_dbfielduser?>">
<? if (isset($err["auth_dbfielduser"])) formerr($err["auth_dbfielduser"]); ?>
</TD>
<TD>
<? print_string("auth_dbfielduser","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbfieldpass:</TD>
<TD>
<INPUT name="auth_dbfieldpass" TYPE="text" SIZE="30" VALUE="<?=$config->auth_dbfieldpass?>">
<? if (isset($err["auth_dbfieldpass"])) formerr($err["auth_dbfieldpass"]); ?>
</TD>
<TD>
<? print_string("auth_dbfieldpass","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_dbpasstype:</TD>
<TD>
<? $passtype["plaintext"] = get_string("plaintext", "auth");
$passtype["md5"] = get_string("md5", "auth");
choose_from_menu($passtype, "auth_dbpasstype", $config->auth_dbpasstype, "");
?>
</TD>
<TD>
<? print_string("auth_dbpasstype","auth") ?>
</TD>
</TR>
<TR>
<TD ALIGN=RIGHT><P><? print_string("firstname") ?>:</TD>
<TD>
<INPUT name="auth_user_firstname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_firstname?>">
</TD>
<TD rowspan=12 VALIGN=CENTER>
<? print_string("auth_dbextrafields","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("lastname") ?>:</TD>
<TD>
<INPUT name="auth_user_lastname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lastname?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("email") ?>:</TD>
<TD>
<INPUT name="auth_user_email" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_email?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("phone") ?> 1:</TD>
<TD>
<INPUT name="auth_user_phone1" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone1?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("phone") ?> 2:</TD>
<TD>
<INPUT name="auth_user_phone2" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone2?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("department") ?>:</TD>
<TD>
<INPUT name="auth_user_department" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_department?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("address") ?>:</TD>
<TD>
<INPUT name="auth_user_address" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_address?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("city") ?>:</TD>
<TD>
<INPUT name="auth_user_city" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_city?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("country") ?>:</TD>
<TD>
<INPUT name="auth_user_country" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_country?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("description") ?>:</TD>
<TD>
<INPUT name="auth_user_description" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_description?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("idnumber") ?>:</TD>
<TD>
<INPUT name="auth_user_idnumber" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_idnumber?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("language") ?>:</TD>
<TD>
<INPUT name="auth_user_lang" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lang?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+75
View File
@@ -0,0 +1,75 @@
<?PHP // $Id$
// Authentication by looking up an external database table
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
global $CFG;
// This is a hack to workaround what seems to be a bug in ADOdb with accessing
// two databases of the same kind ... it seems to get confused when trying to access
// the first database again, after having accessed the second.
// The following hack will make the database explicit which keeps it happy
$CFG->prefix = "$CFG->dbname.$CFG->prefix";
// Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
switch ($CFG->auth_dbpasstype) { // Re-format password accordingly
case "md5":
$password = md5($password);
break;
}
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'
AND $CFG->auth_dbfieldpass = '$password' ");
if (!$rs) {
notify("Could not connect to the specified authentication database...");
return false;
}
if ( $rs->RecordCount() ) {
return true;
} else {
return false;
}
}
function auth_get_userinfo($username){
// Reads any other information for a user from external database,
// then returns it in an array
global $CFG;
$config = (array) $CFG;
ADOLoadCode($CFG->auth_dbtype);
$authdb = &ADONewConnection();
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang");
$result = array();
foreach ($fields as $field) {
if ($config["auth_user_$field"]) {
if ($rs = $authdb->Execute("SELECT ".$config["auth_user_$field"]." FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
$result["$field"] = $rs->fields[$config["auth_user_$field"]];
}
}
}
}
return $result;
}
?>
+1
View File
@@ -0,0 +1 @@
<!-- No config needed -->
+58
View File
@@ -0,0 +1,58 @@
<?PHP
if (!isset($config->auth_imaphost)) {
$config->auth_imaphost = "127.0.0.1";
}
if (!isset($config->auth_imaptype)) {
$config->auth_imaptype = "imap";
}
if (!isset($config->auth_imapport)) {
$config->auth_imapport = "143";
}
?>
<tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_imaphost:</TD>
<TD>
<INPUT name=auth_imaphost TYPE=text SIZE=30 VALUE="<?=$config->auth_imaphost?>">
<? if (isset($err["auth_imaphost"])) formerr($err["auth_imaphost"]); ?>
</TD>
<TD>
<? print_string("auth_imaphost","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_imaptype:</TD>
<TD>
<? $imaptypes = array("imap","imapssl", "imapcert", "imaptls");
foreach($imaptypes as $imaptype) {
$imapoptions[$imaptype] = $imaptype;
}
choose_from_menu($imapoptions, "auth_imaptype", $config->auth_imaptype, "");
?>
</TD>
<TD>
<? print_string("auth_imaptype","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_imapport:</TD>
<TD>
<INPUT name=auth_imapport TYPE=text SIZE=6 VALUE="<?=$config->auth_imapport?>">
<? if (isset($err["auth_imapport"])) formerr($err["auth_imapport"]); ?>
</TD>
<TD>
<? print_string("auth_imapport","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+41
View File
@@ -0,0 +1,41 @@
<?PHP // $Id$
// Authentication by looking up an IMAP server
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
global $CFG;
switch ($CFG->auth_imaptype) {
case "imapssl":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/ssl}";
break;
case "imapcert":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/ssl/novalidate-cert}";
break;
case "imaptls":
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport/imap/notls}";
break;
default:
$host = "{".$CFG->auth_imaphost.":$CFG->auth_imapport}";
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
}
?>
+3
View File
@@ -0,0 +1,3 @@
LDAP-module README
Please read comments from lib.php
+216
View File
@@ -0,0 +1,216 @@
<?PHP
if (!isset($config->ldap_host_url)) {
$config->ldap_host_url = "";
}
if (!isset($config->ldap_contexts)) {
$config->ldap_contexts = "";
}
if (!isset($config->ldap_user_attribute)) {
$config->ldap_user_attribute = "";
}
if (!isset($config->ldap_search_sub)) {
$config->ldap_search_sub = "";
}
if (!isset($config->ldap_bind_dn)) {
$config->ldap_bind_dn = "";
}
if (!isset($config->ldap_bind_pw)) {
$config->ldap_bind_pw = "";
}
?>
<tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_host_url:</TD>
<TD>
<INPUT name=ldap_host_url TYPE=text SIZE=30 VALUE="<?=$config->ldap_host_url?>">
<? if (isset($err["ldap_host_url"])) formerr($err["ldap_host_url"]); ?>
</TD>
<TD>
<? print_string("auth_ldap_host_url","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_contexts:</TD>
<TD>
<INPUT name=ldap_contexts TYPE=text SIZE=30 VALUE="<?=$config->ldap_contexts?>">
<? if (isset($err["ldap_contexts"])) formerr($err["ldap_contexts"]); ?>
</TD>
<TD>
<? print_string("auth_ldap_contexts","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_user_attribute:</TD>
<TD>
<INPUT name=ldap_user_attribute TYPE=text SIZE=30 VALUE="<?=$config->ldap_user_attribute?>">
<? if (isset($err["ldap_user_attribute"])) formerr($err["ldap_user_attribute"]); ?>
</TD>
<TD>
<? print_string("auth_ldap_user_attribute","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_search_sub:</TD>
<TD>
<INPUT name=ldap_search_sub TYPE=text SIZE=1 VALUE="<?=$config->ldap_search_sub?>">
<? if (isset($err["ldap_search_sub"])) formerr($err["ldap_search_sub"]); ?>
</TD>
<TD>
<? print_string("auth_ldap_search_sub","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_bind_dn:</TD>
<TD>
<INPUT name=ldap_bind_dn TYPE=text SIZE=30 VALUE="<?=$config->ldap_bind_dn?>">
<? if (isset($err["ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
</TD><TD>
<? print_string("auth_ldap_bind_dn","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_bind_pw:</TD>
<TD>
<INPUT name=ldap_bind_pw TYPE=text SIZE=30 VALUE="<?=$config->ldap_bind_pw?>">
<? if (isset($err["ldap_bind_pw"])) formerr($err["ldap_bind_pw"]); ?>
</TD><TD>
<? print_string("auth_ldap_bind_pw","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_memberattribute:</TD>
<TD>
<INPUT name=ldap_memberattribute TYPE=text SIZE=30 VALUE="<?=$config->ldap_memberattribute?>">
<? if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
</TD><TD>
<? print_string("auth_ldap_memberattribute","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_creators:</TD>
<TD>
<INPUT name=ldap_creators TYPE=text SIZE=30 VALUE="<?=$config->ldap_creators?>">
<? if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
</TD><TD>
<? print_string("auth_ldap_creators","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>ldap_create_context:</TD>
<TD>
<INPUT name=ldap_create_context TYPE=text SIZE=30 VALUE="<?=$config->ldap_create_context?>">
<? if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
</TD><TD>
<? print_string("auth_ldap_create_context","auth") ?>
</TD>
</TR>
<TR>
<TD ALIGN=RIGHT><P><? print_string("firstname") ?>:</TD>
<TD>
<INPUT name="auth_user_firstname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_firstname?>">
</TD>
<TD rowspan=12 VALIGN=CENTER>
<? print_string("auth_ldapextrafields","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("lastname") ?>:</TD>
<TD>
<INPUT name="auth_user_lastname" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lastname?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("email") ?>:</TD>
<TD>
<INPUT name="auth_user_email" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_email?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("phone") ?> 1:</TD>
<TD>
<INPUT name="auth_user_phone1" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone1?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("phone") ?> 2:</TD>
<TD>
<INPUT name="auth_user_phone2" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_phone2?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("department") ?>:</TD>
<TD>
<INPUT name="auth_user_department" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_department?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("address") ?>:</TD>
<TD>
<INPUT name="auth_user_address" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_address?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("city") ?>:</TD>
<TD>
<INPUT name="auth_user_city" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_city?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("country") ?>:</TD>
<TD>
<INPUT name="auth_user_country" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_country?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("description") ?>:</TD>
<TD>
<INPUT name="auth_user_description" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_description?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("idnumber") ?>:</TD>
<TD>
<INPUT name="auth_user_idnumber" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_idnumber?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("language") ?>:</TD>
<TD>
<INPUT name="auth_user_lang" TYPE="text" SIZE="30" VALUE="<?=$config->auth_user_lang?>">
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+367
View File
@@ -0,0 +1,367 @@
<?PHP // $Id$
//CHANGELOG:
//24.02.2003 Added support for coursecreators
//20.02.2003 Added support for user creation
//12.10.2002 Reformatted source for consistency
//03.10.2002 First version to CVS
//29.09.2002 Clean up and splitted code to functions v. 0.02
//29.09.2002 LDAP authentication functions v. 0.01
//Distributed under GPL (c)Petri Asikainen 2002-2003
/* README!
Module is quite complete and most functinality can be configured from
configinterfave /admin/auth.php. Some of latest additions/features need to
be configured by modifying source code.
If you plan to use user creation feature, look function auth_user_create
and modify it for your needs.
You have to change all hardcoded attribute values to fit your LDAP-server.
User-creation makes posible that your current
users can authenticate with existings usernames/password and new users can
create own accounts to LDAP-directory. I'm using this feature and new users
are created to LDAP different context, without rights to other system. When
user-creation feature is set like that, there's no known security issues.
I write ldap-module on Novell E-directory / Linux & Solaris ,
so all default values are for it.
Any feedback is wellcome,
Petri Asikainen paca@sci.fi
*/
function auth_user_login ($username, $password) {
/// Returns true if the username and password work
/// and false if they don't
global $CFG;
if (!$username or !$password) { // Don't allow blank usernames or passwords
return false;
}
$ldap_connection = auth_ldap_connect();
if ($ldap_connection) {
$ldap_user_dn = auth_ldap_find_userdn($ldap_connection, $username);
//if ldap_user_dn is empty, user does not exist
if(!$ldap_user_dn){
ldap_close($ldap_connection);
return false;
}
// Try to bind with current username and password
$ldap_login = @ldap_bind($ldap_connection, $ldap_user_dn, $password);
ldap_close($ldap_connection);
if ($ldap_login) {
return true;
}
} else {
@ldap_close($ldap_connection);
error("LDAP-module cannot connect to server: $CFG->ldap_host_url");
}
return false;
}
function auth_get_userinfo($username){
/// reads userinformation from ldap and return it in array()
global $CFG;
$config = (array)$CFG;
$attrmap = auth_ldap_attributes();
$ldap_connection=auth_ldap_connect();
$result = array();
$search_attribs = array();
foreach ($attrmap as $key=>$value) {
array_push($search_attribs, $value);
}
$user_dn = auth_ldap_find_userdn($ldap_connection, $username);
if (! isset($CFG->ldap_objectclass)) {
$CFG->ldap_objectclass="objectClass=*";
}
$user_info_result = ldap_read($ldap_connection,$user_dn,$CFG->ldap_objectclass, $search_attribs);
if ($user_info_result) {
$user_entry = ldap_get_entries($ldap_connection, $user_info_result);
foreach ($attrmap as $key=>$value){
if(isset($user_entry[0][$value][0])){
$result[$key]=$user_entry[0][$value][0];
}
}
}
@ldap_close($ldap_connection);
return $result;
}
function auth_get_userlist () {
global $CFG;
return auth_ldap_get_userlist("($CFG->ldap_user_attribute=*)");
}
function auth_user_exists ($username) {
global $CFG;
//returns true if given usernname exist on ldap
$users = auth_ldap_get_userlist("($CFG->ldap_user_attribute=$username)");
return count($users);
}
function auth_user_create ($userobject,$plainpass) {
//create new user to ldap
//use auth_user_exists to prevent dublicate usernames
//return true if user is created, false on error
global $CFG;
$attrmap = auth_ldap_attributes();
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$newuser = array();
foreach ($attrmap as $key=>$value){
if(isset($userobject->$key) ){
$newuser[$value]=utf8_encode($userobject->$key);
}
}
//Following sets all mandatory and other forced attribute values
//this should be moved to config inteface ASAP
$newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top");
$newuser['uniqueId']= $userobject->username;
$newuser['logindisabled']="TRUE";
$newuser['userpassword']=$plainpass;
unset($newuser[country]);
$uadd = ldap_add($ldapconnect, $CFG->ldap_user_attribute."=$userobject->username,".$CFG->ldap_create_context, $newuser);
ldap_close($ldapconnect);
return $uadd;
}
function auth_user_activate ($username) {
//activate new ldap-user after email-address is confirmed
global $CFG;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
$newinfo['loginDisabled']="FALSE";
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
ldap_close($ldapconnect);
return $result;
}
function auth_user_disable ($username) {
//activate new ldap-user after email-address is confirmed
global $CFG;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
$userdn = auth_ldap_find_userdn($ldapconnect, $username);
$newinfo['loginDisabled']="TRUE";
$result = ldap_modify($ldapconnect, $userdn, $newinfo);
ldap_close($ldapconnect);
return $result;
}
function auth_iscreator($username=0) {
///if user is member of creator group return true
global $CFG, $USER;
$ldapconnect = auth_ldap_connect();
$ldapbind = auth_ldap_bind($ldapconnect);
if (! $username) {
$username=$USER->username;
}
if ((! $CFG->ldap_creators) OR (! $CFG->ldap_memberattribute)) {
return false;
} else {
$groups = explode(";",$CFG->ldap_creators);
}
//build filter
$filter = "(& ($CFG->ldap_user_attribute=$username)(|";
foreach ($groups as $group){
$filter .= "($CFG->ldap_memberattribute=$group)";
}
$filter .= "))";
//search
$result = auth_ldap_get_userlist($filter);
return count($result);
}
//PRIVATE FUNCTIONS starts
//private functions are named as auth_ldap*
function auth_ldap_connect(){
/// connects to ldap-server
global $CFG;
$result = ldap_connect($CFG->ldap_host_url);
if ($result) {
return $result;
} else {
error("LDAP-module cannot connect to server: $CFG->ldap_host_url");
return false;
}
}
function auth_ldap_bind($ldap_connection){
/// makes bind to ldap for searching users
/// uses ldap_bind_dn or anonymous bind
global $CFG;
if ($CFG->ldap_bind_dn){
//bind with search-user
if (!ldap_bind($ldap_connection, $CFG->ldap_bind_dn,$CFG->ldap_bind_pw)){
error("Error: could not bind ldap with ldap_bind_dn/pw");
return false;
}
} else {
//bind anonymously
if ( !ldap_bind($ldap_connection)){
error("Error: could not bind ldap anonymously");
return false;
}
}
return true;
}
function auth_ldap_find_userdn ($ldap_connection, $username){
/// return dn of username
/// like: cn=username,ou=suborg,o=org
/// or false if username not found
global $CFG;
//default return value
$ldap_user_dn = FALSE;
auth_ldap_bind($ldap_connection);
//get all contexts and look for first matching user
$ldap_contexts = explode(";",$CFG->ldap_contexts);
if (!empty($CFG->ldap_create_context)){
array_push($ldap_contexts, $CFG->ldap_create_context);
}
foreach ($ldap_contexts as $context) {
$context == trim($context);
if ($CFG->ldap_search_sub){
//use ldap_search to find first user from subtree
$ldap_result = ldap_search($ldap_connection, $context, "(".$CFG->ldap_user_attribute."=".$username.")");
} else {
//search only in this context
$ldap_result = ldap_list($ldap_connection, $context, "(".$CFG->ldap_user_attribute."=".$username.")");
}
$entry = ldap_first_entry($ldap_connection,$ldap_result);
if ($entry){
$ldap_user_dn = ldap_get_dn($ldap_connection, $entry);
break ;
}
}
return $ldap_user_dn;
}
function auth_ldap_attributes (){
//returns array containg attribute mappings between Moodle and ldap
global $CFG;
$config = (array)$CFG;
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang");
$moodleattributes = array();
foreach ($fields as $field) {
if ($config["auth_user_$field"]) {
$moodleattributes[$field] = $config["auth_user_$field"];
}
}
return $moodleattributes;
}
function auth_ldap_get_userlist($filter="*") {
/// returns all users from ldap servers
global $CFG;
$fresult = array();
$ldap_connection = auth_ldap_connect();
auth_ldap_bind($ldap_connection);
if (! isset($CFG->ldap_objectclass)) {
$CFG->ldap_objectclass="objectClass=*";
}
if ($filter=="*") {
$filter = "(&(".$CFG->ldap_user_attribute."=*)(".$CFG->ldap_objectclass."))";
}
$contexts = explode(";",$CFG->ldap_contexts);
if (!empty($CFG->ldap_create_context)){
array_push($contexts, $CFG->ldap_create_context);
}
foreach ($contexts as $context) {
if ($CFG->ldap_search_sub) {
//use ldap_search to find first user from subtree
$ldap_result = ldap_search($ldap_connection, $context,
$filter,
array($CFG->ldap_user_attribute));
} else {
//search only in this context
$ldap_result = ldap_list($ldap_connection, $context,
$filter,
array($CFG->ldap_user_attribute));
}
$users = ldap_get_entries($ldap_connection, $ldap_result);
//add found users to list
for ($i=0;$i<$users['count'];$i++) {
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
}
}
return $fresult;
}
?>
+11
View File
@@ -0,0 +1,11 @@
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+16
View File
@@ -0,0 +1,16 @@
<?PHP // $Id$
// manual method - Just does a simple check against the database
function auth_user_login ($username, $password) {
// Returns false if the username doesn't exist yet
// Returns true if the username and password work
if ($user = get_user_info_from_db("username", $username)) {
return ($user->password == md5($password));
}
return false;
}
?>
+41
View File
@@ -0,0 +1,41 @@
<?PHP
if (!isset($config->auth_nntphost)) {
$config->auth_nntphost = "127.0.0.1";
}
if (!isset($config->auth_nntpport)) {
$config->auth_nntpport = "119";
}
?>
<tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_nntphost:</TD>
<TD>
<INPUT name="auth_nntphost" TYPE="text" SIZE=30 VALUE="<?=$config->auth_nntphost?>">
<? if (isset($err["auth_nntphost"])) formerr($err["auth_nntphost"]); ?>
</TD>
<TD>
<? print_string("auth_nntphost","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_nntpport:</TD>
<TD>
<INPUT name=auth_nntpport TYPE=text SIZE=6 VALUE="<?=$config->auth_nntpport?>">
<? if (isset($err["auth_nntpport"])) formerr($err["auth_nntpport"]); ?>
</TD>
<TD>
<? print_string("auth_nntpport","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+27
View File
@@ -0,0 +1,27 @@
<?PHP // $Id$
// Authentication by looking up an NNTP server
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
global $CFG;
$host = "{".$CFG->auth_nntphost.":$CFG->auth_nntpport/nntp}";
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
}
?>
+1
View File
@@ -0,0 +1 @@
<!-- No config needed -->
+58
View File
@@ -0,0 +1,58 @@
<?PHP
if (!isset($config->auth_pop3host)) {
$config->auth_pop3host = "127.0.0.1";
}
if (!isset($config->auth_pop3type)) {
$config->auth_pop3type = "pop3";
}
if (!isset($config->auth_pop3port)) {
$config->auth_pop3port = "110";
}
?>
<tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_pop3host:</TD>
<TD>
<INPUT name=auth_pop3host TYPE=text SIZE=30 VALUE="<?=$config->auth_pop3host?>">
<? if (isset($err["auth_pop3host"])) formerr($err["auth_pop3host"]); ?>
</TD>
<TD>
<? print_string("auth_pop3host","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_pop3type:</TD>
<TD>
<? $pop3types = array("pop3","pop3cert");
foreach($pop3types as $pop3type) {
$pop3options[$pop3type] = $pop3type;
}
choose_from_menu($pop3options, "auth_pop3type", $config->auth_pop3type, "");
?>
</TD>
<TD>
<? print_string("auth_pop3type","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP BGCOLOR="<?=$THEME->cellheading2 ?>">
<TD ALIGN=RIGHT><P>auth_pop3port:</TD>
<TD>
<INPUT name=auth_pop3port TYPE=text SIZE=6 VALUE="<?=$config->auth_pop3port?>">
<? if (isset($err["auth_pop3port"])) formerr($err["auth_pop3port"]); ?>
</TD>
<TD>
<? print_string("auth_pop3port","auth") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P><? print_string("instructions", "auth") ?>:</TD>
<TD>
<TEXTAREA NAME=auth_instructions COLS=30 ROWS=10 WRAP=virtual><? p($config->auth_instructions) ?></TEXTAREA>
</TD>
<TD>
<? print_string("authinstructions","auth") ?>
<? helpbutton("text", get_string("helptext")) ?>
</TD>
</TR>
+33
View File
@@ -0,0 +1,33 @@
<?PHP // $Id$
// Authentication by looking up a POP3 server
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
global $CFG;
switch ($CFG->auth_pop3type) {
case "pop3":
$host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3}INBOX";
break;
case "pop3cert":
$host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX";
break;
}
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
}
?>
+33
View File
@@ -0,0 +1,33 @@
README $Id$
----------
This directory contains my try to create a backup/recover
admin option to moodle. I don't know when and how it'll be
finished, but I'going to try it, sure.
Some day, if this is fully functional, it could be integrated
into the main Moodle distribution (ask uncle Martin). :-)
Code here may not be tested - so there are no guarantees as
to the quality of the code in here, even if part of a stable
Moodle release.
Please, for any comment about this option, do it in Moodle
Developer Forum at:
http://moodle.org/mod/forum/view.php?id=55
(searching an "backup" topic)
or you can put tour comments in Moodel Bugs at:
http://moodle.org/bugs/bug.php?op=show&bugid=84.
All comments will be welcome. TIA.
To see the general status of the utility, take a look to
"STATUS.txt" in this directory.
And this is all, I start with it NOW.
Eloy (stronk7)
29-04-2003
+197
View File
@@ -0,0 +1,197 @@
STATUS $Id$
----------
This documment shows the current status of the backup/restore option.
Backup: WORKING. COMPLETED but only assignments, resources,
choices and surveys.
Restore: WORKING. NOT COMPLETED. Only course, users, user_files and
course_files. No logs, mods or final checks !!!!
========== ========== ========== ========== ========== ==========
Now I show the specific detailed status of every item in the process:
Backup Details:
===============
- Backup FrontEnd............................................DONE
- Check Security........................................DONE
- Select Info to Backup.(from mods).....................DONE
- Check (summary info)..................................DONE
- Check mods.......................................DONE
- Check logs.......................................DONE
- Check users......................................DONE
- Check User Files.................................DONE
- Check Course Files...............................DONE
- Launch Backup.........................................DONE
- Show progress.........................................DONE
- Determine Backup location.............................DONE
- Delete old entries at backup startup..................DONE
- From database....................................DONE
- From filesystem..................................DONE
- Backup Items:..............................................IN PROGRESS
- Backup Info data......................................DONE
- Course................................................IN PROGRESS
- Course Summary Data................................DONE
x course info.....................................DONE
x sections info...................................DONE
x mods info.......................................DONE
- User Accounts Info.................................DONE
x admins..........................................DONE
- All..........................................DONE
x course creators.................................DONE
- All..........................................DONE
x teachers........................................DONE
- Course.......................................DONE
- All..........................................DONE
x students........................................DONE
- Course.......................................DONE
- All..........................................DONE
- Logs...............................................DONE
- Mods Info..........................................IN PROGRESS
x assignments.....................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files........................................DONE
x choices.........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.....(NOT EXISTS).......................DONE
x forums..........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x journals........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x peer graded assignments.........................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x quizzes.........................................IN PROGRESS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x resources.......................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files..(ARE COURSE FILES !!!)................DONE
x surveys.........................................DONE
+ course data..................................DONE
+ user data....................................DONE
+ files.....(NOT EXISTS).......................DONE
x workshops.......................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x user files to temp..............................DONE
x course files to temp............................DONE
- Compress the backup (zip)..................................DONE. PROBLEMS PCLZIP/UNZIP
- XML File................................................DONE. PROBLEMS PCLZIP/UNZIP
- moddata files...........................................DONE. PROBLEMS PCLZIP/UNZIP
- Course Files............................................DONE. PROBLEMS PCLZIP/UNZIP
- User Files..............................................DONE. PROBLEMS PCLZIP/UNZIP
- Copy finished file to browseable dir.......................DONE
- Delete old entries at backup end...........................DONE
- From database...........................................DONE
- From filesystem.........................................DONE
- Browse backup files........................................DONE
- Download backup files......................................DONE
- Delete backup files........................................DONE
- Program automatic backups..................................NO EXISTS
Restore Details:
===============
- Delete old entries at restore start........................DONE
- From database...........................................DONE
- From filesystem.........................................DONE
- Restore FrontEnd...........................................DONE
- Check Security........................................DONE
- Select File to Restore................................DONE
- Uncompress the backup (unzip).........................DONE
- XML File..........................................DONE
- Course Files......................................DONE
- User Files........................................DONE
- Check file is a valid one.............................DONE
- Load info from file...................................DONE
- Load Backup Info......................................DONE
- Load Course Header....................................DONE
- Restore into feature..................................DONE
- New course (restore)...............................DONE
- Existing course (import)...........................DONE
- Select Info to Restore (depending from backup)........DONE
- Make decisions........................................DONE
- About existing users...............................DONE
- Launch Restore........................................DONE
- Show progress.........................................DONE
- Restore Items:.............................................IN PROGRESS
- Course................................................DONE
- Course Summary Data................................DONE
- Course Table....................................DONE
- Sections Table..................................DONE
- Modules Table...................................DONE
- User Accounts Info.................................DONE
x teacheras. .....................................DONE
- None .......................................DONE
- Course.......................................DONE
- All..........................................DONE
x students........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
x creators........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
x admins..........................................DONE
- None.........................................DONE
- Course.......................................DONE
- All..........................................DONE
- Mods Info..........................................NO EXISTS
x assignments.....................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x choices.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x forums..........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x journals........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x quizzes.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x resources.......................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
x surveys.........................................NO EXISTS
+ course data..................................NO EXISTS
+ user data....................................NO EXISTS
+ files........................................NO EXISTS
- User files from temp.......................................DONE
- Course files from temp.....................................DONE
- Log entries................................................NO EXISTS
- Readjust instance in course_modules........................NO EXISTS
- Readjust modinfo in course (serialize).....................NO EXISTS
- Delete old entries at restore end. .......................NO EXISTS
- From database...........................................NO EXISTS
- From filesystem.........................................NO EXISTS
- Upload backup files........................................DONE
========== ========== ========== =========== =========== =========== ===
This is all. It's no a little thing !!! :-)
Eloy (stronk7)
29-04-2003
+91
View File
@@ -0,0 +1,91 @@
<?PHP //$Id$
//This script is used to configure and execute the backup proccess.
//Define some globals for all the script
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
//ALL RELATIVE FROM THE LOCATION OF THE backup.php SCRIPT !!!
$moodle_home = "../../..";
$mods_home = "mod";
//END MUST CHANGE
//Units used
require_once ("$moodle_home/config.php");
require_once ("$moodle_home/version.php");
require_once ("backup_version.php");
require_once ("db/backup_$CFG->dbtype.php");
require_once ("lib.php");
require_once ("backuplib.php");
//Optional variables
optional_variable($id); // course id
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Check backup_version
upgrade_backup_db($backup_version,$backup_release,"backup.php");
//Get strings
$strcoursebackup = get_string("coursebackup");
$stradministration = get_string("administration");
//If no course has been selected or cancel button pressed
if (!$id or $cancel) {
print_header("$site->shortname: $strcoursebackup", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcoursebackup");
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"backup.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$moodle_home/$CFG->admin/index.php");
}
print_footer();
exit;
}
//Get and check course
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
//Print header
print_header("$site->shortname: $strcoursebackup", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"backup.php\">$strcoursebackup</A> -> $course->fullname ($course->shortname)");
//Print form
print_heading("$strcoursebackup: $course->fullname ($course->shortname)");
print_simple_box_start("center", "", "$THEME->cellheading");
//Call the form, depending the step we are
if (!$launch) {
include_once("backup_form.html");
} else if ($launch == "check") {
include_once("backup_check.html");
} else if ($launch == "execute") {
include_once("backup_execute.html");
}
print_simple_box_end();
//Print footer
print_footer();
?>
+214
View File
@@ -0,0 +1,214 @@
<?PHP //$Id$
//This page prints the backup todo list to see everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
if (!isset($backup_logs)) {
$backup_logs = 1;
}
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
if (!isset($backup_course_files)) {
$backup_course_files = 2;
}
if ($count == 0) {
notice("No backupable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
//Now print the Backup Name tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("name").":";
echo "</B></td><td>";
//Calculate the backup string
$backup_name = strtolower(get_string("backup"));
//If non-translated, use "backup"
if (substr($backup_name,0,1) == "[") {
$backup_name = "backup";
}
//Calculate the format string
$backup_name_format = get_string("backupnameformat");
//If non-translated, use "%Y%m%d-%H%M"
if (substr($backup_name_format,0,1) == "[") {
$backup_name_format = "%%Y%%m%%d-%%H%%M";
}
$backup_name .= "-".strtolower($course->shortname)."-".userdate(time(),$backup_name_format,99,false).".zip";
echo $backup_name;
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_name\" value=\"".$backup_name."\">";
echo "</td></tr>";
//Calculate the backup unique code to allow simultaneus backups (to define
//the temp-directory name and records in backup temp tables
$backup_unique_code = time();
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"".$backup_unique_code."\">";
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the To Do list
echo "<tr>";
echo "<td colspan=\"2\" align=\"center\"><P><B>";
echo get_string("backupdetails").":";
echo "</td></tr>";
//This is tha align to every ingo table
$table->align = array ("LEFT","RIGHT");
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
//Add hidden fields
$var = "backup_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
$var = "backup_user_info_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";
$var = "backup_".$modname;
//Only if selected
if ($$var == 1) {
//Print the full tr
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
//Print the mod name
echo "<li>".get_string("include")." ".get_string("modulenameplural",$modname)." ";
//Now look for user-data status
$backup_user_options[0] = get_string("withoutuserdata");
$backup_user_options[1] = get_string("withuserdata");
$var = "backup_user_info_".$modname;
//Print the user info
echo $backup_user_options[$$var]."<P>";
//Call the check function to show more info
$modcheckbackup = $modname."_check_backup_mods";
$table->data = $modcheckbackup($id,$$var,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
$user_options[0] = get_string("includeallusers");
$user_options[1] = get_string("includecourseusers");
///$user_options[2] = get_string("includeneededusers");--->NOT IMPLEMENTED
echo "<li>".$user_options[$backup_users]."<P>";
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_users\" value=\"".$backup_users."\">";
//Print info
$table->data = user_check_backup($id,$backup_unique_code,$backup_users);
print_table($table);
echo "</td></tr>";
//Now print the Logs tr conditionally
if ($backup_logs) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includelogentries")."<P>";
//Print info
$table->data = log_check_backup($id);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_logs\" value=\"".$backup_logs."\">";
//Now print the User Files tr conditionally
if ($backup_user_files) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includeuserfiles")."<P>";
//Print info
$table->data = user_files_check_backup($id,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_user_files\" value=\"".$backup_user_files."\">";
//Now print the Course Files tr conditionally
if ($backup_course_files) {
echo "<tr>";
echo "<td colspan=\"2\"><P><B>";
echo "<li>".get_string("includecoursefiles")."<P>";
//Print info
$table->data = course_files_check_backup($id,$backup_unique_code);
print_table($table);
echo "</td></tr>";
}
//Add as hidden name
echo "<input type=\"hidden\" name=\"backup_course_files\" value=\"".$backup_course_files."\">";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="execute">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+277
View File
@@ -0,0 +1,277 @@
<?PHP //$Id$
//This page prints the backup todo list to see everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
//Every undefined backup_XXXX isn't exported
$$var = 0;
}
//Now stores all the mods preferences into an array into preferences
$preferences->mods[$modname]->backup = $$var;
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Now stores all the mods preferences into an array into preferences
$preferences->mods[$modname]->userinfo = $$var;
//And the name of the mod
$preferences->mods[$modname]->name = $modname;
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
$preferences->backup_users = $backup_users;
if (!isset($backup_logs)) {
$backup_logs = 1;
}
$preferences->backup_logs = $backup_logs;
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
$preferences->backup_user_files = $backup_user_files;
if (!isset($backup_course_files)) {
$backup_course_files = 2;
}
$preferences->backup_course_files = $backup_course_files;
if (!isset($id)) {
error ("Course not specified");
}
$preferences->backup_course = $id;
if (!isset($backup_name)) {
error ("Backup name not specified");
}
$preferences->backup_name = $backup_name;
if (!isset($backup_unique_code)) {
error ("Backup unique code not specified");
}
$preferences->backup_unique_code = $backup_unique_code;
//Another Info
$preferences->moodle_version = $version;
$preferences->moodle_release = $release;
$preferences->backup_version = $backup_version;
$preferences->backup_release = $backup_release;
if ($count == 0) {
notice("No backupable modules are installed!");
}
//Start the main table
echo "<table cellpadding=5>";
//Now print the Backup Name tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("name").":";
echo "</B></td><td>";
echo $backup_name;
echo "</td></tr>";
//Start the main tr, where all the backup progress is done
echo "<tr>";
echo "<td colspan=\"2\">";
//Start the main ul
echo "<ul>";
//Check for temp and backup and backup_unique_code directory
//Create them as needed
echo "<li>Creating temporary structures";
$status = check_and_create_backup_dir($backup_unique_code);
//Empty dir
if ($status) {
$status = clear_backup_dir($backup_unique_code);
}
//Delete old_entries from backup tables
echo "<li>Deteting old data";
$status = backup_delete_old_data();
if (!$status) {
error ("An error has ocurred");
}
//Create the moodle.xml file
if ($status) {
echo "<li>Creating xml file";
//Begin a new list to xml contents
echo "<ul>";
echo "<li>Writing header";
//Obtain the xml file (create and open) and print prolog information
$backup_file = backup_open_xml($backup_unique_code);
echo "<li>Writing general info";
//Prints general info about backup to file
if ($backup_file) {
$status = backup_general_info($backup_file,$preferences);
}
echo "<li>Writing course data";
//Start new ul (for course)
echo "<ul>";
echo "<li>Course info";
//Prints course start (tag and general info)
if ($status) {
$status = backup_course_start($backup_file,$preferences);
}
echo "<li>Sections";
//Section info
if ($status) {
$status = backup_course_sections($backup_file,$preferences);
}
//End course contents (close ul)
echo "</ul>";
echo "<li>Writing users info";
//User info
if ($status) {
$status = backup_user_info($backup_file,$preferences);
}
//Print logs if selected
if ($status) {
if ($preferences->backup_logs) {
echo "<li>Writing logs info";
$status = backup_log_info($backup_file,$preferences);
}
}
//Module info, this unique function makes all the work!!
//db export and module fileis copy
if ($status) {
$mods_to_backup = false;
//Check if we have any mod to backup
foreach ($preferences->mods as $module) {
if ($module->backup) {
$mods_to_backup = true;
}
}
//If we have to backup some module
if ($mods_to_backup) {
echo "<li>Writing modules info";
//Start modules tag
$status = backup_modules_start ($backup_file,$preferences);
//Open ul for module list
echo "<ul>";
//Iterate over modules and call backupa
foreach ($preferences->mods as $module) {
if ($module->backup and $status) {
echo "<li>".$module->name;
$status = backup_module($backup_file,$preferences,$module->name);
}
}
//Close ul for module list
echo "</ul>";
//Close modules tag
$status = backup_modules_end ($backup_file,$preferences);
}
}
//Prints course end
if ($status) {
$status = backup_course_end($backup_file,$preferences);
}
//Close the xml file and xml data
if ($backup_file) {
backup_close_xml($backup_file);
}
//End xml contents (close ul)
echo "</ul>";
}
//Now, if selected, copy user files
if ($status) {
if ($preferences->backup_user_files) {
echo "<li>Copying user files";
$status = backup_copy_user_files ($preferences);
}
}
//Now, if selected, copy course files
if ($status) {
if ($preferences->backup_course_files) {
echo "<li>Copying course files";
$status = backup_copy_course_files ($preferences);
}
}
//Now, zip all the backup directory contents
if ($status) {
echo "<li>Zipping backup";
$status = backup_zip ($preferences,$moodle_home);
}
//Now, copy the zip file to course directory
if ($status) {
echo "<li>Copying zip file";
$status = copy_zip_to_course_dir ($preferences);
}
//Now, clean temporary data (db and filesystem)
if ($status) {
echo "<li>Cleaning up temp data";
$status = clean_temp_data ($preferences);
}
if (!$status) {
error ("An error has ocurred");
}
//Ends th main ul
echo "</ul>";
//End the main tr, where all the backup is done
echo "</td></tr>";
//End the main table
echo "</table>";
//Print final message
print_simple_box(get_string("backupfinished"),"CENTER");
print_continue($moodle_home."/files/index.php?id=".$preferences->backup_course."&wdir=/".get_string("backupdir"));
?>
+150
View File
@@ -0,0 +1,150 @@
<?PHP //$Id$
//This page prints the backup form to select everything
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to backup every mod
//And check if there is data about it
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/backuplib.php";
$modbackup = $modname."_backup_mods";
$modcheckbackup = $modname."_check_backup_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modbackup) and function_exists($modcheckbackup)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "backup_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "backup_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($backup_users)) {
$backup_users = 1;
}
if (!isset($backup_logs)) {
$backup_logs = 1;
}
if (!isset($backup_user_files)) {
$backup_user_files = 1;
}
if (!isset($backup_course_files)) {
$backup_course_files = 1;
}
if ($count == 0) {
notice("No backupable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
echo "</td><td>";
$backup_options[0] = get_string("no");
$backup_options[1] = get_string("yes");
$var = "backup_".$modname;
choose_from_menu($backup_options, $var, $$var, "");
$backup_user_options[0] = get_string("withoutuserdata");
$backup_user_options[1] = get_string("withuserdata");
$var = "backup_user_info_".$modname;
choose_from_menu($backup_user_options, $var, $$var, "");
echo "</td></tr>";
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("users").":";
echo "</td><td>";
$user_options[0] = get_string("all");
$user_options[1] = get_string("course");
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
choose_from_menu($user_options, "backup_users", $backup_users, "");
echo "</td></tr>";
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("logs").":";
echo "</td><td>";
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
choose_from_menu($log_options, "backup_logs", $backup_logs, "");
echo "</td></tr>";
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("userfiles").":";
echo "</td><td>";
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
choose_from_menu($user_file_options, "backup_user_files", $backup_user_files, "");
echo "</td></tr>";
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("coursefiles").":";
echo "</td><td>";
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
choose_from_menu($course_file_options, "backup_course_files", $backup_course_files, "");
echo "</td></tr>";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="check">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+10
View File
@@ -0,0 +1,10 @@
<?PHP //$Id$
// This file defines the current version of the
// backup/restore code that is being used. This can be
// compared against the values stored in the
// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$backup_version = 2003052000; // The current version is a date (YYYYMMDDXX)
$backup_release = "0.2.1 alpha"; // User-friendly version number
+883
View File
@@ -0,0 +1,883 @@
<?PHP //$Id$
//This file contains all the function needed in the backup utility
//except the mod-related funtions that are into every backuplib.php inside
//every mod directory
//Insert necessary category ids to backup_ids table
function insert_category_ids ($course,$backup_unique_code) {
global $CFG;
$status = true;
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id)
SELECT DISTINCT '$backup_unique_code','quiz_categories',t.category
FROM {$CFG->prefix}quiz_questions t,
{$CFG->prefix}quiz_question_grades g,
{$CFG->prefix}quiz q
WHERE q.course = '$course' AND
g.quiz = q.id AND
g.question = t.id",false);
return $status;
}
//Delete category ids from backup_ids table
function delete_category_ids ($backup_unique_code) {
global $CFG;
$status = true;
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = '$backup_unique_code'",false);
return $status;
}
//Calculate the number of users to backup and put their ids in backup_ids
//Return an array of info (name,value)
function user_check_backup($course,$backup_unique_code,$backup_users) {
//$backup_users=0-->all
// 1-->course
// 2-->needed-->NOT IMPLEMEMTED
global $CFG;
global $db;
$count_users = 0;
//Select all users from user
$users = get_records ("user");
//Iterate over users putting their roles
foreach ($users as $user) {
$user->info = "";
//Is Admin in tables (not is_admin()) !!
if (record_exists("user_admins","userid",$user->id)) {
$user->info .= "admin";
$user->role_admin = true;
}
//Is Course Creator in tables (not is_coursecreator()) !!
if (record_exists("user_coursecreators","userid",$user->id)) {
$user->info .= "coursecreator";
$user->role_coursecreator = true;
}
//Is Teacher in tables (not is_teacher()) !!
if (record_exists("user_teachers","course",$course,"userid",$user->id)) {
$user->info .= "teacher";
$user->role_teacher = true;
}
//Is Student in tables (not is_student()) !!
if (record_exists("user_students","course",$course,"userid",$user->id)) {
$user->info .= "student";
$user->role_student = true;
}
//Now create the backup_id record
$backupids_rec->backup_code = $backup_unique_code;
$backupids_rec->table_name = "user";
$backupids_rec->old_id = $user->id;
$backupids_rec->info = $user->info;
//Insert the record id. backup_users decide it.
//When all users
if ($backup_users == 0) {
$status = insert_record("backup_ids",$backupids_rec,false);
$count_users++;
//When course users
} else if ($backup_users == 1) {
//Only if user has any role
if ($backupids_rec->info) {
$status = insert_record("backup_ids",$backupids_rec,false);
$count_users++;
}
}
}
//Prepare Info
//Gets the user data
$info[0][0] = get_string("users");
$info[0][1] = $count_users;
return $info;
}
//Calculate the number of log entries to backup
//Return an array of info (name,value)
function log_check_backup($course) {
global $CFG;
//Execute the insert
$status = execute_sql($sql_insert,false);
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT l.id,l.course
FROM {$CFG->prefix}log l
WHERE l.course = '$course'");
//Gets the user data
$info[0][0] = get_string("logs");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Calculate the number of user files to backup
//Under $CFG->dataroot/users
//and put them (their path) in backup_ids
//Return an array of info (name,value)
function user_files_check_backup($course,$backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/users";
//Check if directory exists
if (is_dir($rootdir)) {
$coursedirs = get_directory_list($rootdir);
foreach ($coursedirs as $dir) {
//Extracts user id from file path
$tok = strtok($dir,"/");
if ($tok) {
$userid = $tok;
} else {
$tok = "";
}
//Insert them into backup_files
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path, old_id)
VALUES
('$backup_unique_code','user','$dir','$userid')",false);
}
}
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
FROM {$CFG->prefix}backup_files b
WHERE backup_code = '$backup_unique_code' AND
file_type = 'user'");
//Gets the user data
$info[0][0] = get_string("files");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Calculate the number of course files to backup
//under $CFG->dataroot/$course, except $CFG->moddata, and get_string("backupdir)
//and put them (their path) in backup_ids
//Return an array of info (name,value)
function course_files_check_backup($course,$backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/$course";
//Check if directory exists
if (is_dir($rootdir)) {
$coursedirs = get_directory_list($rootdir,$CFG->moddata);
$backupdir = get_string("backupdir");
foreach ($coursedirs as $dir) {
//Check it isn't backupdir
if (strpos($dir,$backupdir)!==0) {
//Insert them into backup_files
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path)
VALUES
('$backup_unique_code','course','$dir')",false);
}
}
}
//Now execute the select
$ids = get_records_sql("SELECT DISTINCT b.path, b.old_id
FROM {$CFG->prefix}backup_files b
WHERE backup_code = '$backup_unique_code' AND
file_type = 'course'");
//Gets the user data
$info[0][0] = get_string("files");
if ($ids) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
//Function to check and create the needed moddata dir to
//save all the mod backup files. We always name it moddata
//to be able to restore it, but in restore we check for
//$CFG->moddata !!
function check_and_create_moddata_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/moddata",true);
return $status;
}
//Function to check and create the "user_files" dir to
//save all the user files we need from "users" dir
function check_and_create_user_files_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/user_files",true);
return $status;
}
//Function to check and create the "course_files" dir to
//save all the course files we need from "CFG->datadir/course" dir
function check_and_create_course_files_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code."/course_files",true);
return $status;
}
//Function to create, open and write header of the xml file
function backup_open_xml($backup_unique_code) {
global $CFG;
$status = true;
//Open for writing
$file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
$backup_file = fopen($file,"w");
//Writes the header
$status = fwrite ($backup_file,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
if ($status) {
$status = fwrite ($backup_file,start_tag("MOODLE_BACKUP",0,true));
}
if ($status) {
return $backup_file;
} else {
return false;
}
}
//Close the file
function backup_close_xml($backup_file) {
$status = fwrite ($backup_file,end_tag("MOODLE_BACKUP",0,true));
return fclose($backup_file);
}
//Return the xml start tag
function start_tag($tag,$level=0,$endline=false) {
if ($endline) {
$endchar = "\n";
} else {
$endchar = "";
}
return str_repeat(" ",$level*2)."<".strtoupper($tag).">".$endchar;
}
//Return the xml end tag
function end_tag($tag,$level=0,$endline=true) {
if ($endline) {
$endchar = "\n";
} else {
$endchar = "";
}
return str_repeat(" ",$level*2)."</".strtoupper($tag).">".$endchar;
}
//Return the start tag, the contents and the end tag
function full_tag($tag,$level=0,$endline=true,$content,$to_utf=true) {
$st = start_tag($tag,$level,$endline);
$co="";
if ($to_utf) {
$co = utf8_encode(htmlspecialchars($content));
} else {
$co = htmlspecialchars($content);
}
$et = end_tag($tag,0,true);
return $st.$co.$et;
}
//Prints General info about the course
//name, moodle_version (internal and release), backup_version, date, info in file...
function backup_general_info ($bf,$preferences) {
global $CFG;
fwrite ($bf,start_tag("INFO",1,true));
//The name of the backup
fwrite ($bf,full_tag("NAME",2,false,$preferences->backup_name));
//The moodle_version
fwrite ($bf,full_tag("MOODLE_VERSION",2,false,$preferences->moodle_version));
fwrite ($bf,full_tag("MOODLE_RELEASE",2,false,$preferences->moodle_release));
//The backup_version
fwrite ($bf,full_tag("BACKUP_VERSION",2,false,$preferences->backup_version));
fwrite ($bf,full_tag("BACKUP_RELEASE",2,false,$preferences->backup_release));
//The date
fwrite ($bf,full_tag("DATE",2,false,$preferences->backup_unique_code));
//Te includes tag
fwrite ($bf,start_tag("DETAILS",2,true));
//Now, go to mod element of preferences to print its status
foreach ($preferences->mods as $element) {
//Calculate info
$included = "false";
$userinfo = "false";
if ($element->backup) {
$included = "true";
if ($element->userinfo) {
$userinfo = "true";
}
}
//Prints the mod start
fwrite ($bf,start_tag("MOD",3,true));
fwrite ($bf,full_tag("NAME",4,false,$element->name));
fwrite ($bf,full_tag("INCLUDED",4,false,$included));
fwrite ($bf,full_tag("USERINFO",4,false,$userinfo));
//Print the end
fwrite ($bf,end_tag("MOD",3,true));
}
//The user in backup
if ($preferences->backup_users == 1) {
fwrite ($bf,full_tag("USERS",3,false,"course"));
} else {
fwrite ($bf,full_tag("USERS",3,false,"all"));
}
//The logs in backup
if ($preferences->backup_logs == 1) {
fwrite ($bf,full_tag("LOGS",3,false,"true"));
} else {
fwrite ($bf,full_tag("LOGS",3,false,"false"));
}
//The user files
if ($preferences->backup_user_files == 1) {
fwrite ($bf,full_tag("USERFILES",3,false,"true"));
} else {
fwrite ($bf,full_tag("USERFILES",3,false,"false"));
}
//The course files
if ($preferences->backup_course_files == 1) {
fwrite ($bf,full_tag("COURSEFILES",3,false,"true"));
} else {
fwrite ($bf,full_tag("COURSEFILES",3,false,"false"));
}
fwrite ($bf,end_tag("DETAILS",2,true));
$status = fwrite ($bf,end_tag("INFO",1,true));
return $status;
}
//Prints course's general info (table course)
function backup_course_start ($bf,$preferences) {
global $CFG;
$status = true;
//Course open tag
fwrite ($bf,start_tag("COURSE",1,true));
//Header open tag
fwrite ($bf,start_tag("HEADER",2,true));
//Get info from course
$course=false;
if ($courses = get_records("course","id",$preferences->backup_course)) {
$course = $courses[$preferences->backup_course];
}
if ($course) {
//Prints course info
fwrite ($bf,full_tag("ID",3,false,$course->id));
//Obtain the category
$category = false;
if ($categories = get_records("course_categories","id","$course->category")) {
$category = $categories[$course->category];
}
if ($category) {
//Prints category info
fwrite ($bf,start_tag("CATEGORY",3,true));
fwrite ($bf,full_tag("ID",4,false,$course->category));
fwrite ($bf,full_tag("NAME",4,false,$category->name));
fwrite ($bf,end_tag("CATEGORY",3,true));
}
//Continues with the course
fwrite ($bf,full_tag("PASSWORD",3,false,$course->password));
fwrite ($bf,full_tag("FULLNAME",3,false,$course->fullname));
fwrite ($bf,full_tag("SHORTNAME",3,false,$course->shortname));
fwrite ($bf,full_tag("SUMMARY",3,false,$course->summary));
fwrite ($bf,full_tag("FORMAT",3,false,$course->format));
fwrite ($bf,full_tag("NEWSITEMS",3,false,$course->newsitems));
fwrite ($bf,full_tag("TEACHER",3,false,$course->teacher));
fwrite ($bf,full_tag("TEACHERS",3,false,$course->teachers));
fwrite ($bf,full_tag("STUDENT",3,false,$course->student));
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
fwrite ($bf,full_tag("STARDATE",3,false,$course->stardate));
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent));
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
fwrite ($bf,full_tag("TIMECREATED",3,false,$course->timecreated));
$status = fwrite ($bf,full_tag("TIMEMODIFIED",3,false,$course->timemodified));
//Print header end
fwrite ($bf,end_tag("HEADER",2,true));
} else {
$status = false;
}
return $status;
}
//Prints course's end tag
function backup_course_end ($bf,$preferences) {
//Course end tag
$status = fwrite ($bf,end_tag("COURSE",1,true));
return $status;
}
//Prints course's sections info (table course_sections)
function backup_course_sections ($bf,$preferences) {
global $CFG;
$status = true;
//Get info from sections
$section=false;
if ($sections = get_records("course_sections","course",$preferences->backup_course,"section")) {
//Section open tag
fwrite ($bf,start_tag("SECTIONS",2,true));
//Iterate over every section (ordered by section)
foreach ($sections as $section) {
//Begin Section
fwrite ($bf,start_tag("SECTION",3,true));
fwrite ($bf,full_tag("ID",4,false,$section->id));
fwrite ($bf,full_tag("NUMBER",4,false,$section->section));
fwrite ($bf,full_tag("SUMMARY",4,false,$section->summary));
fwrite ($bf,full_tag("VISIBLE",4,false,$section->visible));
//Now print the mods in section
backup_course_modules ($bf,$preferences,$section);
//End section
fwrite ($bf,end_tag("SECTION",3,true));
}
//Section close tag
$status = fwrite ($bf,end_tag("SECTIONS",2,true));
}
return $status;
}
//Prints course's modules info (table course_modules)
//Only for selected mods in preferences
function backup_course_modules ($bf,$preferences,$section) {
global $CFG;
$status = true;
$first_record = true;
//Now print the mods in section
//Extracts mod id from sequence
$tok = strtok($section->sequence,",");
while ($tok) {
//Get module's type
$moduletype = get_module_type ($preferences->backup_course,$tok);
//Check if we've selected to backup that type
if ($moduletype and $preferences->mods[$moduletype]->backup) {
$selected = true;
} else {
$selected = false;
}
if ($selected) {
//Gets course_module data from db
$course_module = get_records ("course_modules","id",$tok);
//If it's the first, pring MODS tag
if ($first_record) {
fwrite ($bf,start_tag("MODS",4,true));
$first_record = false;
}
//Print mod info from course_modules
fwrite ($bf,start_tag("MOD",5,true));
//Save neccesary info to backup_ids
fwrite ($bf,full_tag("ID",6,false,$tok));
fwrite ($bf,full_tag("TYPE",6,false,$moduletype));
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module[$tok]->instance));
fwrite ($bf,full_tag("ADDED",6,false,$course_module[$tok]->added));
fwrite ($bf,full_tag("DELETED",6,false,$course_module[$tok]->deleted));
fwrite ($bf,full_tag("SCORE",6,false,$course_module[$tok]->score));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
fwrite ($bf,end_tag("MOD",5,true));
}
//check for next
$tok = strtok(",");
}
//Si ha habido modulos, final de MODS
if (!$first_record) {
$status =fwrite ($bf,end_tag("MODS",4,true));
}
return $status;
}
//Print users to xml
//Only users previously calculated in backup_ids will output
//
function backup_user_info ($bf,$preferences) {
global $CFG;
$status = true;
$users = get_records_sql("SELECT u.old_id, u.table_name,u.info
FROM {$CFG->prefix}backup_ids u
WHERE u.backup_code = '$preferences->backup_unique_code' AND
u.table_name = 'user'");
//If we have users to backup
if ($users) {
//Begin Users tag
fwrite ($bf,start_tag("USERS",2,true));
//With every user
foreach ($users as $user) {
//Get user data from table
$user_data = get_record("user","id",$user->old_id);
//Begin User tag
fwrite ($bf,start_tag("USER",3,true));
//Output all user data
fwrite ($bf,full_tag("ID",4,false,$user_data->id));
fwrite ($bf,full_tag("CONFIRMED",4,false,$user_data->confirmed));
fwrite ($bf,full_tag("DELETED",4,false,$user_data->deleted));
fwrite ($bf,full_tag("USERNAME",4,false,$user_data->username));
fwrite ($bf,full_tag("PASSWORD",4,false,$user_data->password));
fwrite ($bf,full_tag("IDNUMBER",4,false,$user_data->idnumber));
fwrite ($bf,full_tag("FIRSTNAME",4,false,$user_data->firstname));
fwrite ($bf,full_tag("LASTNAME",4,false,$user_data->lastname));
fwrite ($bf,full_tag("EMAIL",4,false,$user_data->email));
fwrite ($bf,full_tag("ICQ",4,false,$user_data->icq));
fwrite ($bf,full_tag("PHONE1",4,false,$user_data->phone1));
fwrite ($bf,full_tag("PHONE2",4,false,$user_data->phone2));
fwrite ($bf,full_tag("INSTITUTION",4,false,$user_data->institution));
fwrite ($bf,full_tag("DEPARTMENT",4,false,$user_data->department));
fwrite ($bf,full_tag("ADDRESS",4,false,$user_data->address));
fwrite ($bf,full_tag("CITY",4,false,$user_data->city));
fwrite ($bf,full_tag("COUNTRY",4,false,$user_data->country));
fwrite ($bf,full_tag("LANG",4,false,$user_data->lang));
fwrite ($bf,full_tag("TIMEZONE",4,false,$user_data->timezone));
fwrite ($bf,full_tag("FIRSTACCESS",4,false,$user_data->firstaccess));
fwrite ($bf,full_tag("LASTACCESS",4,false,$user_data->lastaccess));
fwrite ($bf,full_tag("LASTLOGIN",4,false,$user_data->lastlogin));
fwrite ($bf,full_tag("CURRENTLOGIN",4,false,$user_data->currentlogin));
fwrite ($bf,full_tag("LASTIP",4,false,$user_data->lastIP));
fwrite ($bf,full_tag("SECRET",4,false,$user_data->secret));
fwrite ($bf,full_tag("PICTURE",4,false,$user_data->picture));
fwrite ($bf,full_tag("URL",4,false,$user_data->url));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$user_data->description));
fwrite ($bf,full_tag("MAILFORMAT",4,false,$user_data->mailformat));
fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user_data->timemodified));
//Output every user role (with its associated info)
$user->isadmin = strpos($user->info,"admin");
$user->iscoursecreator = strpos($user->info,"coursecreator");
$user->isteacher = strpos($user->info,"teacher");
$user->isstudent = strpos($user->info,"student");
if ($user->isadmin!==false or
$user->iscoursecreator!==false or
$user->isteacher!==false or
$user->isstudent!==false) {
//Begin ROLES tag
fwrite ($bf,start_tag("ROLES",4,true));
//PRINT ROLE INFO
//Admins
if ($user->isadmin!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"admin"));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//CourseCreator
if ($user->iscoursecreator!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"coursecreator"));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//Teacher
if ($user->isteacher!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"teacher"));
//Get specific info for teachers
$tea = get_record("user_teachers","userid",$user->old_id,"course",$preferences->backup_course);
fwrite ($bf,full_tag("AUTHORITY",6,false,$tea->authority));
fwrite ($bf,full_tag("TEA_ROLE",6,false,$tea->role));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//Student
if ($user->isstudent!==false) {
//Print ROLE start
fwrite ($bf,start_tag("ROLE",5,true));
//Print Role info
fwrite ($bf,full_tag("TYPE",6,false,"student"));
//Get specific info for students
$stu = get_record("user_students","userid",$user->old_id,"course",$preferences->backup_course);
fwrite ($bf,full_tag("TIMESTART",6,false,$stu->timestart));
fwrite ($bf,full_tag("TIMEEND",6,false,$stu->timeend));
fwrite ($bf,full_tag("TIME",6,false,$stu->time));
//Print ROLE end
fwrite ($bf,end_tag("ROLE",5,true));
}
//End ROLES tag
fwrite ($bf,end_tag("ROLES",4,true));
}
//End User tag
fwrite ($bf,end_tag("USER",3,true));
}
//End Users tag
fwrite ($bf,end_tag("USERS",2,true));
} else {
//There isn't users. Impossible !!
$status = false;
}
return $status;
}
//Backup log info (time ordered)
function backup_log_info($bf,$preferences) {
global $CFG;
$status = true;
$logs = get_records ("log","course",$preferences->backup_course,"time");
//We have logs
if ($logs) {
//Pring logs header
fwrite ($bf,start_tag("LOGS",2,true));
//Iterate
foreach ($logs as $log) {
//See if it is a valid module to backup
if ($log->module == "course" or
$log->module == "user" or
$preferences->mods[$log->module]->backup == 1) {
//Begin log tag
fwrite ($bf,start_tag("LOG",3,true));
//Output log tag
fwrite ($bf,full_tag("ID",4,false,$log->id));
fwrite ($bf,full_tag("TIME",4,false,$log->time));
fwrite ($bf,full_tag("USERID",4,false,$log->userid));
fwrite ($bf,full_tag("IP",4,false,$log->ip));
fwrite ($bf,full_tag("MODULE",4,false,$log->module));
fwrite ($bf,full_tag("ACTION",4,false,$log->action));
fwrite ($bf,full_tag("URL",4,false,$log->url));
fwrite ($bf,full_tag("INFO",4,false,$log->info));
//End log tag
fwrite ($bf,end_tag("LOG",3,true));
}
}
//End logs tag
$status = fwrite ($bf,end_tag("LOGS",2,true));
}
return $status;
}
//Start the modules tag
function backup_modules_start ($bf,$preferences) {
return fwrite ($bf,start_tag("MODULES",2,true));
}
//End the modules tag
function backup_modules_end ($bf,$preferences) {
return fwrite ($bf,end_tag("MODULES",2,true));
}
//This function makes all the necesary calls to every mod
//to export itself and its files !!!
function backup_module($bf,$preferences,$module) {
global $CFG;
$status = true;
//First, re-check if necessary functions exists
$modbackup = $module."_backup_mods";
if (function_exists($modbackup)) {
//Call the function
$status = $modbackup($bf,$preferences);
} else {
//Something was wrong. Function should exist.
$status = false;
}
return $status;
}
//This function copies all the needed files under the "users" directory to the "user_files"
//directory under temp/backup
function backup_copy_user_files ($preferences) {
global $CFG;
$status = true;
//First we check to "user_files" exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_user_files_dir($preferences->backup_unique_code);
//Now iterate over directories under "users" to check if that user must be
//copied to backup
$rootdir = $CFG->dataroot."/users";
//Check if directory exists
if (is_dir($rootdir)) {
$list = list_directories ($rootdir);
if ($list) {
//Iterate
foreach ($list as $dir) {
//Look for dir like username in backup_ids
$data = get_record ("backup_ids","backup_code",$preferences->backup_unique_code,
"table_name","user",
"old_id",$dir);
//If exists, copy it
if ($data) {
$status = backup_copy_file($rootdir."/".$dir,
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/user_files/".$dir);
}
}
}
}
return $status;
}
//This function copies all the course files under the course directory (except the moddata
//directory to the "course_files" directory under temp/backup
function backup_copy_course_files ($preferences) {
global $CFG;
$status = true;
//First we check to "course_files" exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_course_files_dir($preferences->backup_unique_code);
//Now iterate over files and directories except $CFG->moddata and get_string("backupdir") to be
//copied to backup
$rootdir = $CFG->dataroot."/".$preferences->backup_course;
$name_moddata = $CFG->moddata;
$name_backupdata = get_string("backupdir");
//Check if directory exists
if (is_dir($rootdir)) {
$list = list_directories_and_files ($rootdir);
if ($list) {
//Iterate
foreach ($list as $dir) {
if ($dir !== $name_moddata and $dir !== $name_backupdata) {
$status = backup_copy_file($rootdir."/".$dir,
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/course_files/".$dir);
}
}
}
}
return $status;
}
//This function creates the zip file containing all the backup info
//moodle.xml, moddata, user_files, course_files.
//The zipped file is created in the backup directory and named with
//the "oficial" name of the backup
//It uses "pclzip" if available or system "zip" (unix only)
function backup_zip ($preferences,$moodle_home) {
global $CFG;
$status = true;
//Base dir where everything happens
$basedir = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
//Backup zip file name
$name = $preferences->backup_name;
//List base_dir files and directories
$filelist = list_directories_and_files ($basedir);
if (empty($CFG->zip)) { // Use built-in php-based zip function
$files = array();
foreach ($filelist as $file) {
//If directory, append "/"
if (is_dir($basedir."/".$file)) {
$file = $file."/";
}
//Include into array
$files[] = $basedir."/".$file;
}
include_once($moodle_home."/lib/pclzip/pclzip.lib.php");
$archive = new PclZip("$basedir/$name");
if (($list = $archive->create($files,PCLZIP_OPT_REMOVE_PATH,$basedir)) == 0) {
error($archive->errorInfo(true));
$status = false;
}
} else { // Use external zip program
$files = "";
foreach ($filelist as $file) {
$files .= basename($file);
$files .= " ";
}
$command = "cd $basedir ; $CFG->zip -r $name $files";
$status = Exec($command);
}
return $status;
}
//This function copies the final zip to the course dir
function copy_zip_to_course_dir ($preferences) {
global $CFG;
//Backup zip file name
$from_zip_file = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/".$preferences->backup_name;
$to_zip_file = $CFG->dataroot."/".$preferences->backup_course."/".get_string("backupdir")."/".$preferences->backup_name;
//Check to directory
$status = check_dir_exists(dirname($to_zip_file),true);
//Copy zip file
if ($status) {
$status = backup_copy_file ($from_zip_file,$to_zip_file);
}
return $status;
}
?>
+69
View File
@@ -0,0 +1,69 @@
<?PHP //$Id$
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
//
// This file is tailored to MySQL
function backup_upgrade($oldversion=0) {
global $CFG;
$result = true;
if ($oldversion < 2003050300 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
`backup_code` INT(12) UNSIGNED NOT NULL,
`table_name` VARCHAR(30) NOT NULL,
`old_id` INT(10) UNSIGNED NOT NULL,
`new_id` INT(10) UNSIGNED,
PRIMARY KEY (`backup_code`, `table_name`, `old_id`)
)
COMMENT = 'To store and convert ids in backup/restore'");
}
if ($oldversion < 2003050301 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
ADD `info` VARCHAR(30)");
}
if ($oldversion < 2003050400 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
MODIFY `info` VARCHAR(255)");
}
if ($oldversion < 2003050401 and $result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_files` (
`backup_code` INT( 10 ) UNSIGNED NOT NULL ,
`file_type` VARCHAR( 10 ) NOT NULL ,
`path` VARCHAR( 255 ) NOT NULL ,
`old_id` INT( 10 ) UNSIGNED,
`new_id` INT( 10 ) UNSIGNED,
PRIMARY KEY ( `backup_code` , `file_type` , `path` )
) COMMENT = 'To store and recode ids to user & course files.'");
}
if ($oldversion < 2003052000 and $result) {
$result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
MODIFY `info` TEXT");
}
//Finally, return result
return $result;
}
?>
+351
View File
@@ -0,0 +1,351 @@
<?PHP //$Id$
//This file contains all the general function needed (file manipulation...)
//not directly part of the backup/restore utility
//Delete old data in backup tables (if exists)
//Two days seems to be apropiate
function backup_delete_old_data() {
global $CFG;
//Change this if you want !!
$days = 2;
//End change this
$seconds = $days * 24 * 60 * 60;
$delete_from = time()-$seconds;
//Now delete from tables
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code < '$delete_from'",false);
if ($status) {
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
WHERE backup_code < '$delete_from'",false);
}
//Now, delete old directory (if exists)
if ($status) {
$status = backup_delete_old_dirs($delete_from);
}
return($status);
}
//Function to delete dirs/files into temp/backup directory
//older than $delete_from
function backup_delete_old_dirs($delete_from) {
global $CFG;
$status = true;
$list = get_directory_list($CFG->dataroot."/temp/backup", "", false);
foreach ($list as $file) {
$file_path = $CFG->dataroot."/temp/backup/".$file;
$moddate = filemtime($file_path);
if ($status and $moddate < $delete_from) {
//If directory, recurse
if (is_dir($file_path)) {
$status = delete_dir_contents($file_path);
//There is nothing, delete the directory itself
if ($status) {
$status = rmdir($file_path);
}
//If file
} else {
unlink("$file_path");
}
}
}
return $status;
}
//Function to check if a directory exists
//and, optionally, create it
function check_dir_exists($dir,$create=false) {
global $CFG;
$status = true;
if(!is_dir($dir)) {
if (!$create) {
$status = false;
} else {
umask(0000);
$status = mkdir ($dir,$CFG->directorypermissions);
}
}
return $status;
}
//Function to check and create the needed dir to
//save all the backup
function check_and_create_backup_dir($backup_unique_code) {
global $CFG;
$status = check_dir_exists($CFG->dataroot."/temp",true);
if ($status) {
$status = check_dir_exists($CFG->dataroot."/temp/backup",true);
}
if ($status) {
$status = check_dir_exists($CFG->dataroot."/temp/backup/".$backup_unique_code,true);
}
return $status;
}
//Function to delete all the directory contents recursively
//Copied from admin/delete.php
function delete_dir_contents ($rootdir) {
$dir = opendir($rootdir);
$status = true;
while ($file = readdir($dir)) {
if ($file != "." and $file != "..") {
$fullfile = "$rootdir/$file";
if (filetype($fullfile) == "dir") {
delete_dir_contents($fullfile);
if (!rmdir($fullfile)) {
$status = false;
}
} else {
if (!unlink("$fullfile")) {
$status = false;
}
}
}
}
closedir($dir);
return $status;
}
//Function to clear (empty) the contents of the backup_dir
//Copied from admin/delete.php
function clear_backup_dir($backup_unique_code) {
global $CFG;
$rootdir = $CFG->dataroot."/temp/backup/".$backup_unique_code;
//Delete recursively
$status = delete_dir_contents($rootdir);
return $status;
}
//Returns the module type of a course_module's id in a course
function get_module_type ($courseid,$moduleid) {
global $CFG;
$results = get_records_sql ("SELECT cm.id, m.name
FROM {$CFG->prefix}course_modules cm,
{$CFG->prefix}modules m
WHERE cm.course = '$courseid' AND
cm.id = '$moduleid' AND
m.id = cm.module");
if ($results) {
$name = $results[$moduleid]->name;
} else {
$name = false;
}
return $name;
}
//This function return the names of all directories under a give directory
//Not recursive
function list_directories ($rootdir) {
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
if (is_dir($rootdir."/".$file)) {
$results[$file] = $file;
}
}
closedir($dir);
return $results;
}
//This function return the names of all directories and files under a give directory
//Not recursive
function list_directories_and_files ($rootdir) {
$dir = opendir($rootdir);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
$results[$file] = $file;
}
closedir($dir);
return $results;
}
//This function clean data from backup tables and
//delete all temp files used
function clean_temp_data ($preferences) {
global $CFG;
$status = true;
//true->do it, false->don't do it. To debug if necessary.
if (true) {
//Now delete from tables
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = '$preferences->backup_unique_code'",false);
if ($status) {
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_files
WHERE backup_code = '$preferences->backup_unique_code'",false);
}
//Now, delete temp directory (if exists)
$file_path = $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code;
if (is_dir($file_path)) {
$status = delete_dir_contents($file_path);
//There is nothing, delete the directory itself
if ($status) {
$status = rmdir($file_path);
}
}
}
return $status;
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//This functions are used to copy any file or directory ($from_file)
//to a new file or directory ($to_file). It works recursively and
//mantains file perms.
//I've copied it from: http://www.php.net/manual/en/function.copy.php
//Little modifications done
function backup_copy_file ($from_file,$to_file) {
if (is_file($from_file)) {
$perms=fileperms($from_file);
return copy($from_file,$to_file) && chmod($to_file,$perms);
}
else if (is_dir($from_file)) {
return backup_copy_dir($from_file,$to_file);
}
else{
return false;
}
}
function backup_copy_dir($from_file,$to_file) {
if (!is_dir($to_file)) {
mkdir($to_file);
chmod("$to_file",0777);
}
$dir = opendir($from_file);
while ($file=readdir($dir)) {
if ($file=="." || $file=="..") {
continue;
}
$status = backup_copy_file ("$from_file/$file","$to_file/$file");
}
closedir($dir);
return $status;
}
///Ends copy file/dirs functions
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//This function upgrades, if necesary, the backup-restore tables
//It's called from backup.php and restore.php
function upgrade_backup_db($updgradeto,$backup_release,$continueto) {
global $CFG,$db;
//Check backup_version
if ($CFG->backup_version) {
if ($updgradeto > $CFG->backup_version) { // upgrade
$a->oldversion = $CFG->backup_version;
$a->newversion = $updgradeto;
$strdatabasechecking = get_string("databasechecking", "", $a);
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
print_heading($strdatabasechecking);
$db->debug=true;
if (backup_upgrade($a->oldversion)) {
$db->debug=false;
if (set_config("backup_version", $a->newversion)) {
notify($strdatabasesuccess, "green");
notify("You are running Backup/Recovery version ".$backup_release,"black");
print_continue($continueto);
die;
} else {
notify("Upgrade failed! (Could not update version in config table)");
die;
}
} else {
$db->debug=false;
notify("Upgrade failed! See backup_version.php");
die;
}
} else if ($updgradeto < $CFG->backup_version) {
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
}
//Not exists. Starting installation
} else {
$strdatabaseupgrades = get_string("databaseupgrades");
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
if (set_config("backup_version", "2003010100")) {
print_heading("You are currently going to install the needed structures to Backup/Recover");
print_continue($continue_to);
die;
}
}
}
//This function is used to insert records in the backup_ids table
function backup_putid ($backup_unique_code, $table, $old_id, $new_id, $info="") {
global $CFG;
$status = true;
//First delete to avoid PK duplicates
$status = backup_delid($backup_unique_code, $table, $old_id);
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id, new_id, info)
VALUES
($backup_unique_code, '$table', '$old_id', '$new_id', '$info')",false);
return $status;
}
//This function is used to delete recods from the backup_ids table
function backup_delid ($backup_unique_code, $table, $old_id) {
global $CFG;
$status = true;
$status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids
WHERE backup_code = $backup_unique_code AND
table_name = '$table' AND
old_id = '$old_id'",false);
return $status;
}
//This function is used to get a record from the backup_ids table
function backup_getid ($backup_unique_code, $table, $old_id) {
global $CFG;
$status = true;
$status = get_record ("backup_ids","backup_code",$backup_unique_code,
"table_name",$table,
"old_id", $old_id);
return $status;
}
?>
+171
View File
@@ -0,0 +1,171 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//assignment mods
//This is the "graphical" structure of the assignment mod:
//
// assignment
// (CL,pk->id)
// |
// |
// |
// assignment_submisions
// (UL,pk->id, fk->assignment,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function assignment_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over assignment table
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
if ($assignments) {
foreach ($assignments as $assignment) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
//if we've selected to backup users info, then execute backup_assignment_submisions
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
//if we've selected to backup users info, then backup files too
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_files($bf,$preferences);
}
return $status;
}
//Backup assignment_submissions contents (executed from assignment_backup_mods)
function backup_assignment_submissions ($bf,$preferences,$assignment) {
global $CFG;
$status = true;
$assignment_submissions = get_records("assignment_submissions","assignment",$assignment,"id");
//If there is submissions
if ($assignment_submissions) {
//Write start tag
$status =fwrite ($bf,start_tag("SUBMISSIONS",4,true));
//Iterate over each submission
foreach ($assignment_submissions as $ass_sub) {
//Start submission
$status =fwrite ($bf,start_tag("SUBMISSION",5,true));
//Print submission contents
fwrite ($bf,full_tag("ID",6,false,$ass_sub->id));
fwrite ($bf,full_tag("USERID",6,false,$ass_sub->userid));
fwrite ($bf,full_tag("TIMECREATED",6,false,$ass_sub->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$ass_sub->timemodified));
fwrite ($bf,full_tag("NUMFILES",6,false,$ass_sub->numfiles));
fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade));
fwrite ($bf,full_tag("COMMENT",6,false,$ass_sub->comment));
fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher));
fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked));
fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed));
//End submission
$status =fwrite ($bf,end_tag("SUBMISSION",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("SUBMISSIONS",4,true));
}
return $status;
}
//Backup assignment files because we've selected to backup user info
//and files are user info's level
function backup_assignment_files($bf,$preferences) {
global $CFG;
$status = true;
//First we check to moddata exists and create it as necessary
//in temp/backup/$backup_code dir
$status = check_and_create_moddata_dir($preferences->backup_unique_code);
//Now copy the assignment dir
if ($status) {
$status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment",
$CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/assignment");
}
return $status;
}
//Return an array of info (name,value)
function assignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","assignment");
if ($ids = assignment_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("submissions","assignment");
if ($ids = assignment_submission_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of assignments id
function assignment_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}assignment a
WHERE a.course = '$course'");
}
//Returns an array of assignment_submissions id
function assignment_submission_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.assignment
FROM {$CFG->prefix}assignment_submissions s,
{$CFG->prefix}assignment a
WHERE a.course = '$course' AND
s.assignment = a.id");
}
?>
+64
View File
@@ -0,0 +1,64 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//assignment mods
//This is the "graphical" structure of the assignment mod:
//
// assignment
// (CL,pk->id)
// |
// |
// |
// assignment_submisions
// (UL,pk->id, fk->assignment,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function assignment_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over assignment table
$assignments = get_records ("assignment","course",$preferences->backup_course,"id");
if ($assignments) {
foreach ($assignments as $assignment) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$assignment->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"assignment"));
fwrite ($bf,full_tag("NAME",4,false,$assignment->name));
fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description));
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
fwrite ($bf,full_tag("TYPE",4,false,$assignment->type));
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
fwrite ($bf,full_tag("GRADE",4,false,$assignment->grade));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$assignment->timemodified));
//if we've selected to backup users info, then execute backup_assignment_submisions
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_submissions($bf,$preferences,$assignment->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
//if we've selected to backup users info, then backup files too
if ($preferences->mods["assignment"]->userinfo) {
$status = backup_assignment_files($bf,$preferences);
}
return $status;
}
?>
+141
View File
@@ -0,0 +1,141 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//choice mods
//This is the "graphical" structure of the choice mod:
//
// choice
// (CL,pk->id)
// |
// |
// |
// choice_answers
// (UL,pk->id, fk->choice)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function choice_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over choice table
$choices = get_records ("choice","course",$preferences->backup_course,"id");
if ($choices) {
foreach ($choices as $choice) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$choice->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
//if we've selected to backup users info, then execute backup_choice_answers
if ($preferences->mods["choice"]->userinfo) {
$status = backup_choice_answers($bf,$preferences,$choice->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
//Backup choice_answers contents (executed from choice_backup_mods)
function backup_choice_answers ($bf,$preferences,$choice) {
global $CFG;
$status = true;
$choice_answers = get_records("choice_answers","choice",$choice,"id");
//If there is submissions
if ($choice_answers) {
//Write start tag
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
//Iterate over each answer
foreach ($choice_answers as $cho_ans) {
//Start answer
$status =fwrite ($bf,start_tag("ANSWER",5,true));
//Print submission contents
fwrite ($bf,full_tag("ID",6,false,$cho_ans->id));
fwrite ($bf,full_tag("USERID",6,false,$cho_ans->userid));
fwrite ($bf,full_tag("CHOICE_ANSWER",6,false,$cho_ans->answer));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$cho_ans->timemodified));
//End answer
$status =fwrite ($bf,end_tag("ANSWER",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
}
return $status;
}
////Return an array of info (name,value)
function choice_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","choice");
if ($ids = choice_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("responses","choice");
if ($ids = choice_answer_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of choices id
function choice_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}choice a
WHERE a.course = '$course'");
}
//Returns an array of choice_answers id
function choice_answer_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.choice
FROM {$CFG->prefix}choice_answers s,
{$CFG->prefix}choice a
WHERE a.course = '$course' AND
s.choice = a.id");
}
?>
+61
View File
@@ -0,0 +1,61 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//choice mods
//This is the "graphical" structure of the choice mod:
//
// choice
// (CL,pk->id)
// |
// |
// |
// choice_answers
// (UL,pk->id, fk->choice)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function choice_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over choice table
$choices = get_records ("choice","course",$preferences->backup_course,"id");
if ($choices) {
foreach ($choices as $choice) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$choice->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"choice"));
fwrite ($bf,full_tag("NAME",4,false,$choice->name));
fwrite ($bf,full_tag("TEXT",4,false,$choice->text));
fwrite ($bf,full_tag("FORMAT",4,false,$choice->format));
fwrite ($bf,full_tag("ANSWER1",4,false,$choice->answer1));
fwrite ($bf,full_tag("ANSWER2",4,false,$choice->answer2));
fwrite ($bf,full_tag("ANSWER3",4,false,$choice->answer3));
fwrite ($bf,full_tag("ANSWER4",4,false,$choice->answer4));
fwrite ($bf,full_tag("ANSWER5",4,false,$choice->answer5));
fwrite ($bf,full_tag("ANSWER6",4,false,$choice->answer6));
fwrite ($bf,full_tag("PUBLISH",4,false,$choice->publish));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$choice->timemodified));
//if we've selected to backup users info, then execute backup_choice_answers
if ($preferences->mods["choice"]->userinfo) {
$status = backup_choice_answers($bf,$preferences,$choice->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
?>
+152
View File
@@ -0,0 +1,152 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//forum mods
//This is the "graphical" structure of the forum mod:
//
// forum
// (CL,pk->id)
// |
// -----------------------------------
// | |
// subscriptions forum_discussions
// (UL,pk->id, fk->forum) (UL,pk->id, fk->forum)
// |
// |
// |
// forum_posts
// (UL,pk->id,fk->discussion,nt->parent,files)
// |
// |
// |
// forum_ratings
// (UL,pk->id,fk->post)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function forum_backup_mods() {
print "hola";
}
////Return an array of info (name,value)
function NO_forum_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","forum");
if ($ids = forum_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Subscriptions
$info[1][0] = get_string("subscriptions","forum");
if ($ids = forum_subscription_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Discussions
$info[2][0] = get_string("discussions","forum");
if ($ids = forum_discussion_ids_by_course ($course)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Posts
$info[3][0] = get_string("posts","forum");
if ($ids = forum_post_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
//Ratings
$info[4][0] = get_string("ratings","forum");
if ($ids = forum_rating_ids_by_course ($course)) {
$info[4][1] = count($ids);
} else {
$info[4][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of forums id
function forum_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}forum a
WHERE a.course = '$course'");
}
//Returns an array of forum subscriptions id
function forum_subscription_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.forum
FROM {$CFG->prefix}forum_subscriptions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id");
}
//Returns an array of forum discussions id
function forum_discussion_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.forum
FROM {$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id");
}
//Returns an array of forum posts id
function forum_post_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT p.id , p.discussion, s.forum
FROM {$CFG->prefix}forum_posts p,
{$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id AND
p.discussion = s.id");
}
//Returns an array of ratings posts id
function forum_rating_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT r.id, r.post, p.discussion, s.forum
FROM {$CFG->prefix}forum_ratings r,
{$CFG->prefix}forum_posts p,
{$CFG->prefix}forum_discussions s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.forum = a.id AND
p.discussion = s.id AND
r.post = p.id");
}
?>
+78
View File
@@ -0,0 +1,78 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//journal mods
//This is the "graphical" structure of the journal mod:
//
// journal
// (CL,pk->id)
// |
// |
// |
// journal_entries
// (UL,pk->id, fk->journal)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function journal_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function NO_journal_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","journal");
if ($ids = journal_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
$info[1][0] = get_string("entries","journal");
if ($ids = journal_entry_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of journals id
function journal_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}journal a
WHERE a.course = '$course'");
}
//Returns an array of journal entries id
function journal_entry_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.journal
FROM {$CFG->prefix}journal_entries s,
{$CFG->prefix}journal a
WHERE a.course = '$course' AND
s.journal = a.id");
}
?>
+125
View File
@@ -0,0 +1,125 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//pgassignment mods
//This is the "graphical" structure of the pgassignment mod:
//
// pgassignment
// (CL,pk->id)
// |
// -----------------------------------
// | |
// pgassignment_elements pgassignment_submissions
// (CL,pk->id, fk->pgassignment) (UL,pk->id, fk->pgassignment,files)
// |
// |
// |
// pgasignments_grades
// (UL,pk->id,fk->submission)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function NO_pgassignment_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function pgassignment_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","pgassignment");
if ($ids = pgassignment_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Elements
$info[1][0] = get_string("elements","pgassignment");
if ($ids = pgassignment_element_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Submissions
$info[2][0] = get_string("submissions","pgassignment");
if ($ids = pgassignment_submission_ids_by_course ($course)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Grades
$info[3][0] = get_string("grades","pgassignment");
if ($ids = pgassignment_grade_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of pgassignments id
function pgassignment_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}pgassignment a
WHERE a.course = '$course'");
}
//Returns an array of pgassignment elements id
function pgassignment_element_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.pgassignment
FROM {$CFG->prefix}pgassignment_elements s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id");
}
//Returns an array of pgassignment submissions id
function pgassignment_submission_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.pgassignment
FROM {$CFG->prefix}pgassignment_submissions s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id");
}
//Returns an array of pgassignment grades id
function pgassignment_grade_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT g.id , g.submission, s.pgassignment
FROM {$CFG->prefix}pgassignment_grades g,
{$CFG->prefix}pgassignment_submissions s,
{$CFG->prefix}pgassignment a
WHERE a.course = '$course' AND
s.pgassignment = a.id AND
g.submission = s.id");
}
?>
+148
View File
@@ -0,0 +1,148 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//quiz mods
//To see, put your terminal to 132cc
//This is the "graphical" structure of the quiz mod:
//
// quiz quiz_categories
// (CL,pk->id) (CL,pk->id)
// | |
// ----------------------------------------------- |
// | | | |
// | | | |
// | | | |
// quiz_attemps quiz_grades quiz_question_grades |
// (UL,pk->id, fk->quiz) (UL,pk->id,fk->quiz) (UL,pk->id,fk->quiz) |
// | | |
// | | |
// | | |
// quiz_responses | quiz_questions
// (UL,pk->id, fk->attempt)----------------------------------------------------(CL,pk->id,fk->category,files)
// |
// |
// |
// ------------------------------------------------------------------------------------------------------
// | | | |
// | | | |
// | | | | quiz_randomsamatch
// quiz_truefalse quiz_shortanswer quiz_multichoice |---------(CL,pl->id,fk->question)
// (CL,pl->id,fk->question) (CL,pl->id,fk->question) (CL,pl->id,fk->question) |
// . . . |
// . . . |
// . . . | quiz_match
// .................................................... |---------(CL,pl->id,fk->question)
// . | .
// . | .
// . | .
// quiz_answers | quiz_match_sub
// (CL,pk->id,fk->question)----------------------------|---------(CL,pl->id,fk->question)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files
//
//-----------------------------------------------------------
//THIS MOD BACKUP NEEDS TO USE THE mdl_backup_ids TABLE
function quiz_backup_mods($course,$user_data=false,$backup_unique_code) {
print "hola";
}
////Return an array of info (name,value)
function NO_quiz_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//Deletes data from mdl_backup_ids (categories section)
delete_category_ids ($backup_unique_code);
//Create date into mdl_backup_ids (categories section)
insert_category_ids ($course,$backup_unique_code);
//First the course data
$info[0][0] = get_string("modulenameplural","quiz");
if ($ids = quiz_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Categories
$info[1][0] = get_string("categories","quiz");
if ($ids = quiz_category_ids_by_backup ($backup_unique_code)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
//Questions
$info[2][0] = get_string("questions","quiz");
if ($ids = quiz_question_ids_by_backup ($backup_unique_code)) {
$info[2][1] = count($ids);
} else {
$info[2][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Grades
$info[3][0] = get_string("grades","quiz");
if ($ids = quiz_grade_ids_by_course ($course)) {
$info[3][1] = count($ids);
} else {
$info[3][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of quiz id
function quiz_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}quiz a
WHERE a.course = '$course'");
}
//Returns an array of categories id
function quiz_category_ids_by_backup ($backup_unique_code) {
global $CFG;
return get_records_sql ("SELECT a.old_id, a.backup_code
FROM {$CFG->prefix}backup_ids a
WHERE a.backup_code = '$backup_unique_code'");
}
function quiz_question_ids_by_backup ($backup_unique_code) {
global $CFG;
return get_records_sql ("SELECT q.id, q.category
FROM {$CFG->prefix}backup_ids a,
{$CFG->prefix}quiz_questions q
WHERE a.backup_code = '$backup_unique_code' and
q.category = a.old_id");
}
function quiz_grade_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT g.id, g.quiz
FROM {$CFG->prefix}quiz a,
{$CFG->prefix}quiz_grades g
WHERE a.course = '$course' and
g.quiz = a.id");
}
?>
+77
View File
@@ -0,0 +1,77 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//resource mods
//This is the "graphical" structure of the resource mod:
//
// resource
// (CL,pk->id,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the backup procedure about this mod
function resource_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
////Iterate over resource table
$resources = get_records ("resource","course",$preferences->backup_course,"id");
if ($resources) {
foreach ($resources as $resource) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$resource->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
//End mod
$status = fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
////Return an array of info (name,value)
function resource_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","resource");
if ($ids = resource_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of resources id
function resource_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}resource a
WHERE a.course = '$course'");
}
?>
+47
View File
@@ -0,0 +1,47 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//resource mods
//This is the "graphical" structure of the resource mod:
//
// resource
// (CL,pk->id,files)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
//This function executes all the restore procedure about this mod
function resource_restore_mods($bf,$preferences) {
global $CFG;
$status = true;
////Iterate over resource table
$resources = get_records ("resource","course",$preferences->backup_course,"id");
if ($resources) {
foreach ($resources as $resource) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print assignment data
fwrite ($bf,full_tag("ID",4,false,$resource->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"resource"));
fwrite ($bf,full_tag("NAME",4,false,$resource->name));
fwrite ($bf,full_tag("TYPE",4,false,$resource->type));
fwrite ($bf,full_tag("REFERENCE",4,false,$resource->reference));
fwrite ($bf,full_tag("SUMMARY",4,false,$resource->summary));
fwrite ($bf,full_tag("ALLTEXT",4,false,$resource->alltext));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$resource->timemodified));
//End mod
$status = fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
?>
+174
View File
@@ -0,0 +1,174 @@
<?PHP //$Id$
//This php script contains all the stuff to backup/restore
//survey mods
//This is the "graphical" structure of the survey mod:
// --------------------
// survey | survey_questions |
// (CL,pk->id) |(CL,pk->id,?????) |
// | --------------------
// |
// -----------------------------------
// | |
// survey_analysis survey_answers
// (UL,pk->id, fk->survey) (UL,pk->id, fk->survey)
//
// Meaning: pk->primary key field of the table
// fk->foreign key to link with parent
// nt->nested field (recursive data)
// CL->course level info
// UL->user level info
// files->table may have files)
//
//-----------------------------------------------------------
function survey_backup_mods($bf,$preferences) {
global $CFG;
$status = true;
//Iterate over survey table
$surveys = get_records ("survey","course",$preferences->backup_course,"id");
if ($surveys) {
foreach ($surveys as $survey) {
//Start mod
fwrite ($bf,start_tag("MOD",3,true));
//Print choice data
fwrite ($bf,full_tag("ID",4,false,$survey->id));
fwrite ($bf,full_tag("MODTYPE",4,false,"survey"));
fwrite ($bf,full_tag("TEMPLATE",4,false,$survey->template));
fwrite ($bf,full_tag("DAYS",4,false,$survey->days));
fwrite ($bf,full_tag("TIMECREATED",4,false,$survey->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$survey->timemodified));
fwrite ($bf,full_tag("NAME",4,false,$survey->name));
fwrite ($bf,full_tag("INTRO",4,false,$survey->intro));
fwrite ($bf,full_tag("QUESTIONS",4,false,$survey->questions));
//if we've selected to backup users info, then execute backup_survey_answers and
//backup_survey_analysis
if ($preferences->mods["survey"]->userinfo) {
$status = backup_survey_answers($bf,$preferences,$survey->id);
$status = backup_survey_analysis($bf,$preferences,$survey->id);
}
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
}
}
return $status;
}
//Backup survey_answers contents (executed from survey_backup_mods)
function backup_survey_answers ($bf,$preferences,$survey) {
global $CFG;
$status = true;
$survey_answers = get_records("survey_answers","survey",$survey,"id");
//If there is answers
if ($survey_answers) {
//Write start tag
$status =fwrite ($bf,start_tag("ANSWERS",4,true));
//Iterate over each answer
foreach ($survey_answers as $sur_ans) {
//Start answer
$status =fwrite ($bf,start_tag("ANSWER",5,true));
//Print survey_answers contents
fwrite ($bf,full_tag("ID",6,false,$sur_ans->id));
fwrite ($bf,full_tag("USERID",6,false,$sur_ans->userid));
fwrite ($bf,full_tag("QUESTION",6,false,$sur_ans->question));
fwrite ($bf,full_tag("TIME",6,false,$sur_ans->time));
fwrite ($bf,full_tag("ANSWER1",6,false,$sur_ans->answer1));
fwrite ($bf,full_tag("ANSWER2",6,false,$sur_ans->answer2));
//End answer
$status =fwrite ($bf,end_tag("ANSWER",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANSWERS",4,true));
}
return $status;
}
//Backup survey_analysis contents (executed from survey_backup_mods)
function backup_survey_analysis ($bf,$preferences,$survey) {
global $CFG;
$status = true;
$survey_analysis = get_records("survey_analysis","survey",$survey,"id");
//If there is analysis
if ($survey_analysis) {
//Write start tag
$status =fwrite ($bf,start_tag("ANALYSIS",4,true));
//Iterate over each analysis
foreach ($survey_analysis as $sur_ana) {
//Start answer
$status =fwrite ($bf,start_tag("ANALYS",5,true));
//Print survey_analysis contents
fwrite ($bf,full_tag("ID",6,false,$sur_ana->id));
fwrite ($bf,full_tag("USERID",6,false,$sur_ana->userid));
fwrite ($bf,full_tag("NOTES",6,false,$sur_ana->notes));
//End answer
$status =fwrite ($bf,end_tag("ANALYS",5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag("ANALYSIS",4,true));
}
return $status;
}
////Return an array of info (name,value)
function survey_check_backup_mods($course,$user_data=false,$backup_unique_code) {
//First the course data
$info[0][0] = get_string("modulenameplural","survey");
if ($ids = survey_ids ($course)) {
$info[0][1] = count($ids);
} else {
$info[0][1] = 0;
}
//Now, if requested, the user_data
if ($user_data) {
//Subscriptions
$info[1][0] = get_string("answers","survey");
if ($ids = survey_answer_ids_by_course ($course)) {
$info[1][1] = count($ids);
} else {
$info[1][1] = 0;
}
}
return $info;
}
// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
//Returns an array of surveys id
function survey_ids ($course) {
global $CFG;
return get_records_sql ("SELECT a.id, a.course
FROM {$CFG->prefix}survey a
WHERE a.course = '$course'");
}
//Returns an array of survey answer id
function survey_answer_ids_by_course ($course) {
global $CFG;
return get_records_sql ("SELECT s.id , s.survey
FROM {$CFG->prefix}survey_answers s,
{$CFG->prefix}forum a
WHERE a.course = '$course' AND
s.survey = a.id");
}
?>
+90
View File
@@ -0,0 +1,90 @@
<?PHP //$Id$
//This script is used to configure and execute the restore proccess.
//Define some globals for all the script
//MUST CHANGE WITH FINAL BACKUP LOCATION !! WITHOUT TRAILING SLASH !!
//ALL RELATIVE FROM THE LOCATION OF THE restore.php SCRIPT !!!
$moodle_home = "../../..";
$mods_home = "mod";
//END MUST CHANGE
//Units used
require_once ("$moodle_home/config.php");
require_once ("$moodle_home/version.php");
require_once ("backup_version.php");
require_once ("db/backup_$CFG->dbtype.php");
require_once ("lib.php");
require_once ("restorelib.php");
//Optional
optional_variable($file);
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Check backup_version
upgrade_backup_db($backup_version,$backup_release,"restore.php");
//Get strings
$strcourserestore = get_string("courserestore");
$stradministration = get_string("administration");
//If no file has been selected from the FileManager, inform and end
if (!$file) {
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
print_heading(get_string("nofilesselected"));
print_continue("$moodle_home/$CFG->admin/index.php");
print_footer();
exit;
}
//If cancel has been selected, inform and end
if ($cancel) {
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> -> $strcourserestore");
print_heading(get_string("restorecancelled"));
print_continue("$moodle_home/$CFG->admin/index.php");
print_footer();
exit;
}
//We are here, so me have a file.
//Print header
print_header("$site->shortname: $strcourserestore", $site->fullname,
"<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
$strcourserestore -> ".basename($file));
//Print form
print_heading("$strcourserestore: ".basename($file));
print_simple_box_start("center", "", "$THEME->cellheading");
//Call the form, depending the step we are
if (!$launch) {
include_once("restore_precheck.html");
} else if ($launch == "form") {
include_once("restore_form.html");
} else if ($launch == "check") {
include_once("restore_check.html");
} else if ($launch == "execute") {
include_once("restore_execute.html");
}
print_simple_box_end();
//Print footer
print_footer();
?>
+171
View File
@@ -0,0 +1,171 @@
<?PHP //$Id$
//This page receive all the restore_form data. Then, if existing course
//has been selected, shows a list of courses to select one.
//It cheks that the parammeter from restore_form are coherent.
//It puts all the restore info in the session.
//Finally, it calls restore_execute to do the hard work
//Get objects from session
if ($SESSION) {
$info = $SESSION->info;
$course_header = $SESSION->course_header;
$restore = $SESSION->restore;
}
//If restore session info exists, but we are posting parameters
//manually, this has prioriry
if ($restore and isset($restore_restoreto)) {
unset($restore);
}
//Check required objects from session
//info
require_variable($info);
//course_header
require_variable($course_header);
//If the restore object doesn't exist, we are going
//to check every variable individually and create it
if (!$restore) {
//Check that we have all we need
//backup_unique_code
require_variable($backup_unique_code);
//file
require_variable($file);
//Checks for the required restoremod parameters
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$var = "restore_".$modname;
require_variable($$var);
$var = "restore_user_info_".$modname;
require_variable($$var);
}
}
//restoreto
require_variable($restore_restoreto);
//restore_users
require_variable($restore_users);
//restore_logs
require_variable($restore_logs);
//restore_user_files
require_variable($restore_user_files);
//restore_course_files
require_variable($restore_course_files);
//restore_course_files
require_variable($restore_course_files);
//Check we've selected a course
if (!isset($course_id)) {
$course_id = 0;
}
//We are here, having all we need !!
//Create the restore object and put it in the session
$restore->backup_unique_code = $backup_unique_code;
$restore->file = $file;
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$var = "restore_".$modname;
$restore->mods[$modname]->restore=$$var;
$var = "restore_user_info_".$modname;
$restore->mods[$modname]->userinfo=$$var;
}
}
$restore->restoreto=$restore_restoreto;
$restore->users=$restore_users;
$restore->logs=$restore_logs;
$restore->user_files=$restore_user_files;
$restore->course_files=$restore_course_files;
$restore->course_id=$course_id;
} else {
//We have the object, so check if we have a new course_id
//passed as parammeter
if ($course_id) {
$restore->course_id=$course_id;
}
}
//We have the object with data, put it in the session
$SESSION->restore = $restore;
//From here to the wnd of the script, only use the $restore object
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Depending the selected restoreto:
// 0-Existing course: Select the destination course and launch the check again.
// 1-New course: Create the restore object (checking everything) and launch the execute.
//Select course
if (($restore->restoreto == 0) and ($restore->course_id == 0)) {
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"restore.php?course_id=$course->id&launch=check&file=$file\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$moodle_home/$CFG->admin/index.php");
}
//Checks everything and execute restore
} else if ((($restore->restoreto == 0) and ($restore->course_id != 0)) or ($restore->restoreto == 1)) {
$show_continue_button = true;
//Check if we've selected any mod's user info and restore->users
//is set to none. Change it to course and inform.
if ($restore->users == 2) {
$changed = false;
$mods = $restore->mods;
foreach ($mods as $mod) {
if ($mod->userinfo) {
$changed = true;
}
}
if ($changed) {
echo get_string ("noteuserschangednonetocourse");
echo "<hr noshade size=\"1\">";
$restore->users = 1;
}
}
//Save the restore session object
$SESSION->restore = $restore;
if ($show_continue_button) {
//Print the continue button to execute the restore NOW !!!!
//All is prepared !!!
echo "<CENTER>";
echo get_string("presscontinuetolaunchrestore");
echo "<br>";
$hidden["launch"] = "execute";
$hidden["file"] = $file;
print_single_button("restore.php", $hidden, get_string("continue"),"post");
echo "</CENTER>";
} else {
//Show error
error ("Something was wrong checking restore preferences");
}
//If we are here. Something must be wrong. Debug !!!
} else {
print_object($restore);
print_object($info);
print_object($course_header);
error ("Something must be wrong");
}
?>
+195
View File
@@ -0,0 +1,195 @@
<?PHP //$Id$
//This page receives the required info and executes the restore
//with the parameters suplied. Whe finished, delete temporary
//data from backup_tables and temp directory
//Get objects from session
if ($SESSION) {
$info = $SESSION->info;
$course_header = $SESSION->course_header;
$restore = $SESSION->restore;
}
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Start the main table
echo "<table cellpadding=5>";
echo "<tr><td>";
//Start the main ul
echo "<ul>";
//Init status
$status = true;
//Localtion of the xml file
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
//If we've selected to restore into new course
//create it (course)
//Saving conversion id variables into backup_tables
if ($restore->restoreto ==1) {
echo "<li>Creating new course";
$status = restore_create_new_course($restore,&$course_header);
//Print course fullname and shortname and category
if ($status) {
echo "<ul>";
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")";
echo "<li>".get_string("category").": ".$course_header->category->name;
echo "</ul>";
//Put the destination course_id
$restore->course_id = $course_header->course_id;
}
} else {
$course = get_record("course","id",$restore->course_id);
if ($course) {
echo "<li>Using existing course";
echo "<ul>";
echo "<li>From: ".$course_header->course_fullname." (".$course_header->course_shortname.")";
echo "<li>To: ".$course->fullname." (".$course->shortname.")";
echo "</ul>";
}
}
//Now create the course_sections and their associated course_modules
if ($status) {
if ($restore->restoreto == 1) {
echo "<li>Creating sections";
$status = restore_create_sections($restore,$xml_file);
} else if ($restore->restoreto == 0) {
echo "<li>Checking sections";
$status = restore_create_sections($restore,$xml_file);
} else {
$status = false;
}
}
//Now create users as needed
if ($status and ($restore->users == 0 or $restore->users == 1)) {
echo "<li>Creating users";
$status = restore_create_users($restore,$xml_file);
//Now print info about the work done
if ($status) {
$recs = get_records_sql("select old_id, info from {$CFG->prefix}backup_ids
where backup_code = '$restore->backup_unique_code' and
table_name = 'user'");
//We've records
if ($recs) {
$new_count = 0;
$exists_count = 0;
$student_count = 0;
$teacher_count = 0;
$coursecreator_count = 0;
$admin_count = 0;
$other_count = 0;
//Iterate, filling counters
foreach ($recs as $rec) {
if (strpos($rec->info,"new") !== false) {
$new_count++;
}
if (strpos($rec->info,"exists") !== false) {
$exists_count++;
}
if (strpos($rec->info,"admin")) {
$admin_count++;
} else if (strpos($rec->info,"coursecreator")) {
$coursecreator_count++;
} else if (strpos($rec->info,"teacher")) {
$teacher_count++;
} else if (strpos($rec->info,"student")) {
$student_count++;
} else if ($rec->info == "new" or $rec->info == "exists") {
$other_count++;
}
}
//Now print information gathered
echo " (new: ".$new_count.", existing: ".$exists_count.")";
echo "<ul>";
echo "<li>Students: ".$student_count;
echo "<li>Teachers: ".$teacher_count;
echo "<li>Course Creators: ".$coursecreator_count;
echo "<li>Admins: ".$admin_count;
echo "<li>Other: ".$other_count;
echo "</ul>";
} else {
//Something is wrong. There is no users !!
$status = false;
}
}
}
//Now create user_files as needed
if ($status and ($restore->user_files)) {
echo "<li>Copying User Files";
$status = restore_user_files($restore);
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>User Zones: ".$status;
echo "</ul>";
}
}
//Now create course files as needed
if ($status and ($restore->course_files)) {
echo "<li>Copying Course Files";
$status = restore_course_files($restore);
//If all is ok (and we have a counter)
if ($status and ($status !== true)) {
//Inform about user dirs created from backup
echo "<ul>";
echo "<li>Main Files/Folders: ".$status;
echo "</ul>";
}
}
//Now create log entries as needed
if ($status and ($restore->logs)) {
echo "<li>Creating Log Entries <b>(not implemented)</b>. Execute after everything...";
}
//Now, if all is OK, adjust the instance field in course_modules !!
//Now if all is OK, update course modinfo field !!
//End the main ul
echo "</ul>";
//End the main table
echo "</tr></td>";
echo "</table>";
if (!$status) {
error ("An error has ocurred");
}
?>
+226
View File
@@ -0,0 +1,226 @@
<?PHP //$Id$
//This page prints the restore form to select everything yo want
//to restore. Form is dinamically buid, depending of "info" object
//that contains the backup contents and depending of every mod
//capabilities.
//Get objects from session
$info = $SESSION->info;
$course_header = $SESSION->course_header;
//Check that we have all we need
//backup_unique_code
require_variable($backup_unique_code);
//file
require_variable($file);
//info
require_variable($info);
//course_header
require_variable($course_header);
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Checks for the required files/functions to restore every mod
$count = 0;
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "$mods_home/$modname/restorelib.php";
$modrestore = $modname."_restore_mods";
if (file_exists($modfile)) {
include_once($modfile);
if (function_exists($modrestore)) {
$var = "exists_".$modname;
$$var = true;
$count++;
}
}
//Check data
//Check module info
$var = "restore_".$modname;
if (!isset($$var)) {
$$var = 1;
}
//Check include user info
$var = "restore_user_info_".$modname;
if (!isset($$var)) {
$$var = 1;
}
}
}
//Check other parameters
if (!isset($restore_users)) {
$restore_users = 1;
}
if (!isset($restore_logs)) {
$restore_logs = 1;
}
if (!isset($restore_user_files)) {
$restore_user_files = 1;
}
if (!isset($restore_course_files)) {
$restore_course_files = 1;
}
if (!isset($restore_restoreto)) {
$restore_restoreto = 1;
}
if ($count == 0) {
notice("No restorable modules are installed!");
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
<table cellpadding=5>
<?
//First, course destination
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><b>";
echo get_string("restoreto").":</b>";
echo "</td><td>";
$restore_restoreto_options[0] = get_string("existingcourse");
$restore_restoreto_options[1] = get_string("newcourse");
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
echo "</td></tr>";
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now, check modules and info and show posibilities
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modrestore = $modname."_restore_mods";
//If exists the lib & function
$exist = "exists_".$modname;
$restore_var = "restore_".$modname;
$user_info_var = "restore_user_info_".$modname;
if ($$exist) {
//Now check that we have that module info in the backup file
if ($info->mods[$modname]->backup == "true") {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("include")." ". get_string("modulenameplural",$modname).":";
echo "</td><td>";
$restore_options[0] = get_string("no");
$restore_options[1] = get_string("yes");
choose_from_menu($restore_options, $restore_var, $$restore_var, "");
//If backup contains user data, then show menu, else fix it to
//without user data
if ($info->mods[$modname]->userinfo == "true") {
$restore_user_options[0] = get_string("withoutuserdata");
$restore_user_options[1] = get_string("withuserdata");
choose_from_menu($restore_user_options, $user_info_var, $$user_info_var, "");
} else {
//Module haven't userdata
echo get_string("withoutuserdata");
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
echo "</td></tr>";
} else {
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
} else {
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
}
//Line
echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("users").":";
echo "</td><td>";
//If all users are in the backup file
if ($info->backup_users == "all") {
$user_options[0] = get_string("all");
}
$user_options[1] = get_string("course");
$user_options[2] = get_string("none");
//$user_options[2] = get_string("needed");-->NOT IMPLEMENTED
choose_from_menu($user_options, "restore_users", $restore_users, "");
echo "</td></tr>";
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string("logs").":";
echo "</td><td>";
//If logs are in the backup file, show menu, else fixed to no
if ($info->backup_logs == "true") {
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
choose_from_menu($log_options, "restore_logs", $restore_logs, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_logs\" value=\"0\">";
}
echo "</td></tr>";
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("userfiles").":";
echo "</td><td>";
//If user files are in the backup file, show menu, else fixed to no
if ($info->backup_user_files == "true") {
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
choose_from_menu($user_file_options, "restore_user_files", $restore_user_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_user_files\" value=\"0\">";
}
echo "</td></tr>";
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";
echo get_string ("coursefiles").":";
echo "</td><td>";
//If course files are in the backup file, show menu, else fixed to no
if ($info->backup_course_files == "true") {
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
choose_from_menu($course_file_options, "restore_course_files", $restore_course_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_course_files\" value=\"0\">";
}
echo "</td></tr>";
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"$backup_unique_code\">";
echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";
}
?>
</table>
<BR>
<CENTER>
<input type="hidden" name=id value="<? p($id) ?>">
<input type="hidden" name=launch value="check">
<input type="submit" value="<? print_string("continue") ?>">
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
</CENTER>
</FORM>
+130
View File
@@ -0,0 +1,130 @@
<?PHP // $Id$
//This page copies th zip to the temp directory,
//unzip it, check that it is a valid backup file
//inform about its contents and fill all the necesary
//variables to continue with the restore.
//Checks we have the file variable
if (!isset($file)) {
error ("File not specified");
}
//Check login
require_login();
//Check admin
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
//Check site
if (!$site = get_site()) {
error("Site not found!");
}
//Prepend dataroot to variable to have the absolute path
$file = $CFG->dataroot."/".$file;
//Start the main table
echo "<table cellpadding=5>";
echo "<tr><td>";
//Start the mail ul
echo "<ul>";
//Check the file exists
if (!is_file($file)) {
error ("File not exists ($file)");
}
//Check the file name ends with .zip
if (!substr($file,-4) == ".zip") {
error ("File has an incorrect extension");
}
//Now calculate the unique_code for this restore
$backup_unique_code = time();
//Now check and create the backup dir (if it doesn't exist)
$status = check_and_create_backup_dir($backup_unique_code);
//Empty dir
if ($status) {
echo "<li>Creating temp dir";
$status = clear_backup_dir($backup_unique_code);
}
//Now delete old data and directories under dataroot/temp/backup
if ($status) {
echo "<li>Cleaning old data";
$status = backup_delete_old_data();
}
//Now copy he zip file to dataroot/temp/backup/backup_unique_code
if ($status) {
$status = backup_copy_file($file,$CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file));
}
//Now unzip the file
if ($status) {
echo "<li>Retrieving backup file";
$status = restore_unzip ($CFG->dataroot."/temp/backup/".$backup_unique_code."/".basename($file),$moodle_home);
}
//Now check for the moodle.xml file
if ($status) {
$xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
echo "<li>Checking backup file";
$status = restore_check_moodle_file ($xml_file);
}
$info = "";
$course_header = "";
//Now read the info tag (all)
if ($status) {
echo "<li>Reading info from file";
//Reading info from file
$info = restore_read_xml_info ($xml_file);
//Reading course_header from file
$course_header = restore_read_xml_course_header ($xml_file);
}
//End the main ul
echo "</ul>";
//End the main table
echo "</tr></td>";
echo "</table>";
//Now we print in other table, the backup and the course it contains info
if ($info and $course_header and $status) {
//First, the course info
$status = restore_print_course_header($course_header);
//Now, the backup info
if ($status) {
$status = restore_print_info($info);
}
}
//Save course header and info into php session
if ($status) {
$SESSION->info = $info;
$SESSION->course_header = $course_header;
}
//Finally, a little form to continue
//with some hidden fields
if ($status) {
echo "<br><CENTER>";
$hidden["backup_unique_code"] = $backup_unique_code;
$hidden["launch"] = "form";
$hidden["file"] = $file;
print_single_button("restore.php", $hidden, get_string("continue"),"post");
echo "</CENTER>";
}
if (!$status) {
error ("An error has ocurred");
}
?>
File diff suppressed because it is too large Load Diff
+141 -76
View File
@@ -1,76 +1,141 @@
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// Moodle configuration file //
// //
// This file should be renamed "config.php" in the top-level directory //
// //
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-2002 Martin Dougiamas http://dougiamas.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. If you specify mysql //
// then Moodle can set up all your tables for you. If you try to use //
// a different database you will need to set up all your tables by hand //
// which could be a big job. See doc/install.html //
$CFG->dbtype = "mysql"; // eg mysql (postgres7, oracle, access etc)
$CFG->dbhost = "localhost"; // eg localhost
$CFG->dbname = "moodle"; // eg moodle
$CFG->dbuser = "username";
$CFG->dbpass = "password";
///////////////////////////////////////////////////////////////////////////
// Now you need to tell Moodle where it is located. Specify the full
// web address where moodle has been installed (without trailing slash)
$CFG->wwwroot = "http://example.com/moodle";
///////////////////////////////////////////////////////////////////////////
// Next, specify the full OS directory path to this same location
// For Windows this might be something like "C:\apache\htdocs\moodle"
$CFG->dirroot = "/web/moodle";
///////////////////////////////////////////////////////////////////////////
// Now you need a place where Moodle can save uploaded files. This
// directory should be writeable by the web server user (usually 'nobody'
// or 'apache'), but it should not be accessible directly via the web.
$CFG->dataroot = "/home/moodledata";
///////////////////////////////////////////////////////////////////////////
// To continue the setup, use your web browser to go to your Moodle page //
///////////////////////////////////////////////////////////////////////////
$CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
require("$CFG->libdir/setup.php"); // Do not change this
?>
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// Moodle configuration file //
// //
// This file should be renamed "config.php" in the top-level directory //
// //
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
unset($CFG); // Ignore this line
//=========================================================================
// 1. DATABASE SETUP
//=========================================================================
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. //
// //
// mysql - the prefix is optional, but useful when installing //
// into databases that already contain tables. //
//
// postgres7 - the prefix is REQUIRED, regardless of whether the //
// database already contains tables. //
$CFG->dbtype = 'mysql'; // mysql or postgres7 (for now)
$CFG->dbhost = 'localhost'; // eg localhost or db.isp.com
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'username'; // your database username
$CFG->dbpass = 'password'; // your database password
$CFG->dbpersist = true; // Use persistent database connection?
// (should be 'true' for 99% of sites)
$CFG->prefix = 'mdl_'; // Prefix to use for all table names
//=========================================================================
// 2. WEB SITE LOCATION
//=========================================================================
// Now you need to tell Moodle where it is located. Specify the full
// web address to where moodle has been installed. If your web site
// is accessible via multiple URLs then choose the most natural one
// that your students would use. Do not include a trailing slash.
$CFG->wwwroot = 'http://example.com/moodle';
//=========================================================================
// 3. SERVER FILES LOCATION
//=========================================================================
// Next, specify the full OS directory path to this same location
// Make sure the upper/lower case is correct. Some examples:
//
// $CFG->dirroot = 'C:\FoxServ\www\moodle'; // Windows
// $CFG->dirroot = '/var/www/html/moodle'; // Redhat Linux
$CFG->dirroot = '/var/www/html/moodle';
//=========================================================================
// 4. DATA FILES LOCATION
//=========================================================================
// Now you need a place where Moodle can save uploaded files. This
// directory should be readable AND WRITEABLE by the web server user
// (usually 'nobody' or 'apache'), but it should not be accessible
// directly via the web.
//
// - On hosting systems you might need to make sure that your "group" has
// no permissions at all, but that "others" have full permissions.
//
// - On Windows systems you might specify something like 'C:\moodledata'
$CFG->dataroot = '/home/moodledata';
//=========================================================================
// 5. DATA FILES PERMISSIONS
//=========================================================================
// The following parameter sets the permissions of new directories
// created by Moodle within the data directory. The format is in
// octal format (as used by the Unix utility chmod, for example).
// The default is usually OK, but you may want to change it to 0750
// if you are concerned about world-access to the files (you will need
// to make sure the web server process (eg Apache) can access the files.
// NOTE: the prefixed 0 is important, and don't use quotes.
$CFG->directorypermissions = 0777;
//=========================================================================
// 6. DIRECTORY LOCATION (most people can just ignore this setting)
//=========================================================================
// A very few webhosts use /admin as a special URL for you to access a
// control panel or something. Unfortunately this conflicts with the
// standard location for the Moodle admin pages. You can fix this by
// renaming the admin directory in your installation, and putting that
// new name here. eg "moodleadmin". This will fix admin links in Moodle.
$CFG->admin = 'admin';
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
//=========================================================================
if (! @include_once("$CFG->dirroot/lib/setup.php")) { // Do not edit
if ($CFG->dirroot == dirname(__FILE__)) {
echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>";
echo "<p>Are you sure all your files have been uploaded?</p>";
} else {
echo "<p>Error detected in config.php</p>";
echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";
echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';</p>";
}
die;
}
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>
+34 -16
View File
@@ -1,8 +1,10 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_login();
if (!isadmin()) {
error("Only administrators can use this course!");
@@ -24,30 +26,46 @@
$straction = get_string("action");
$stradd = get_string("add");
print_header("$site->fullname: $strcategories", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strcategories");
print_header("$site->shortname: $strcategories", "$site->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strcategories");
print_heading($strcategories);
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
if ($form = data_submitted()) {
$categories = array();
// Peel out all the data from variable names.
foreach ($HTTP_POST_VARS as $key => $val) {
if ($key == "new" and $val != "") {
$cat->name = $val;
if (!insert_record("course_categories", $cat)) {
error("Could not insert the new category '$val'");
} else {
notify(get_string("categoryadded", "", $val));
foreach ($form as $key => $val) {
if ($key == "new") {
if (!empty($val)) {
if (get_records("course_categories", "name", $val)) {
notify(get_string("categoryduplicate", "", $val));
} else {
$cat->name = $val;
if (!insert_record("course_categories", $cat)) {
error("Could not insert the new category '$val'");
} else {
notify(get_string("categoryadded", "", $val));
}
}
}
} else {
$cat->id = substr($key,1);
$cat->id = substr($key,1);
$cat->name = $val;
if ($existingcats = get_records("course_categories", "name", $val)) {
foreach($existingcats as $existingcat) {
if ($existingcat->id != $cat->id) {
notify(get_string("categoryduplicate", "", $val));
continue 2;
}
}
}
if (!update_record("course_categories", $cat)) {
error("Could not update the category '$val'");
}
@@ -57,7 +75,7 @@
/// Get the existing categories
if (!$categories = get_all_categories()) {
if (!$categories = get_categories()) {
// Try and make one
$cat->name = get_string("miscellaneous");
if ($cat->id = insert_record("course_categories", $cat)) {
@@ -86,7 +104,7 @@
}
/// Find any orphan courses that don't yet have a valid category and set to default
if ($courses = get_records_sql("SELECT * FROM course WHERE category > 0")) {
if ($courses = get_courses()) {
foreach ($courses as $course) {
if (!isset( $categories[$course->category] )) {
set_field("course", "category", $default, "id", $course->id);
@@ -98,7 +116,7 @@
/// Print the table of all categories
$table->head = array ($strcategory, $strcourses, $straction);
$table->align = array ("LEFT", "CENTER", "CENTER");
$table->size = array ("50", "20", "20");
$table->size = array ("80", "50", "50");
$table->width = 100;
echo "<FORM ACTION=categories.php METHOD=post>";
+12 -12
View File
@@ -1,7 +1,7 @@
<?PHP // $Id$
// Admin-only code to delete a course utterly
require("../config.php");
require_once("../config.php");
optional_variable($id); // course id
optional_variable($delete); // delete confirmation
@@ -20,19 +20,19 @@
$stradministration = get_string("administration");
if (!$id) {
print_header("$site->fullname : $strdeletecourse", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strdeletecourse");
print_header("$site->shortname: $strdeletecourse", $site->fullname,
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strdeletecourse");
if ($courses = get_records_sql("SELECT * from course WHERE category > 0 ORDER BY fullname")) {
if ($courses = get_courses()) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname</A><BR>";
echo "<A HREF=\"delete.php?id=$course->id\">$course->fullname ($course->shortname)</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$CFG->wwwroot/admin/");
print_continue("../$CFG->admin/index.php");
}
print_footer();
exit;
@@ -45,11 +45,11 @@
if (! $delete) {
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
$strdeletecoursecheck = get_string("deletecoursecheck");
print_header("$site->fullname : $strdeletecheck", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
print_header("$site->shortname: $strdeletecheck", $site->fullname,
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletecheck");
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname",
notice_yesno("$strdeletecoursecheck<BR><BR>$course->fullname ($course->shortname)",
"delete.php?id=$course->id&delete=".md5($course->timemodified),
"delete.php");
exit;
@@ -62,8 +62,8 @@
// OK checks done, delete the course now.
$strdeletingcourse = get_string("deletingcourse", "", $course->shortname);
print_header("$site->fullname : $strdeletingcourse", $site->fullname,
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
print_header("$site->shortname: $strdeletingcourse", $site->fullname,
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletingcourse");
print_heading($strdeletingcourse);
@@ -71,7 +71,7 @@
$strdeleted = get_string("deleted");
// First delete every instance of every module
if ($allmods = get_records_sql("SELECT * FROM modules") ) {
if ($allmods = get_records("modules") ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
$modfile = "../mod/$modname/lib.php";
+30 -21
View File
@@ -2,30 +2,30 @@
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td><P><? print_string("fullname") ?>:</td>
<td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
<td><input type="text" name="fullname" maxlength="254" size=50 value="<? p($form->fullname) ?>">
<? helpbutton("coursefullname", get_string("fullname")) ?>
<? formerr($err["fullname"]) ?>
<? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("shortname") ?>:</td>
<td><input type="text" name="shortname" size=10 value="<? p($form->shortname) ?>">
<td><input type="text" name="shortname" maxlength="15" size="10" value="<? p($form->shortname) ?>">
<? helpbutton("courseshortname", get_string("shortname")) ?>
<? formerr($err["shortname"]) ?>
<? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("summary") ?>:</td>
<td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
<? helpbutton("text", get_string("helptext")) ?>
<? formerr($err["summary"]) ?>
<? if (isset($err["summary"])) formerr($err["summary"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("enrolmentkey") ?>:</td>
<td><input type="text" name="password" size=25 value="<? p($form->password) ?>">
<? helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
<? formerr($err["password"]) ?>
<? if (isset($err["password"])) formerr($err["password"]); ?>
</td>
</tr>
<tr valign=top>
@@ -43,7 +43,6 @@
<td><?
choose_from_menu ($form->categories, "category", "$form->category", "");
helpbutton("coursecategory", get_string("category"));
formerr($err["category"]);
?>
</td>
</tr>
@@ -52,7 +51,6 @@
<td><?
choose_from_menu ($form->courseformats, "format", "$form->format", "");
helpbutton("courseformats", get_string("courseformats"));
formerr($err["format"]);
?>
</td>
</tr>
@@ -75,7 +73,6 @@
"10" => "10 $newsitems");
choose_from_menu ($options, "newsitems", "$form->newsitems", "");
helpbutton("coursenewsitems", get_string("newsitemsnumber"));
formerr($err["newsitems"]);
?>
</td>
</tr>
@@ -84,7 +81,6 @@
<td><?
print_date_selector("startday", "startmonth", "startyear", $form->startdate);
helpbutton("coursestartdate", get_string("startdate"));
formerr($err["startdate"]);
?></td>
</tr>
<tr valign=top>
@@ -93,38 +89,51 @@
for ($i=1; $i<=52; $i++) {
$sectionmenu[$i] = "$i";
}
choose_from_menu ($sectionmenu, "numsections", "$form->numsections");
choose_from_menu ($sectionmenu, "numsections", "$form->numsections", "");
helpbutton("coursenumsections", get_string("numberweeks"));
formerr($err["numsections"]);
?></td>
</tr>
<tr valign=top>
<td><P><? print_string("showrecent") ?>:</td>
<td><?
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "showrecent", $form->showrecent, "");
helpbutton("courserecent", get_string("showrecent")); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
(<? print_string("wordforteachereg") ?>) <? formerr($err["teacher"]) ?>
<td><input type="text" name="teacher" maxlength="100" size=25 value="<? p($form->teacher) ?>">
(<? print_string("wordforteachereg") ?>)
<? if (isset($err["teacher"])) formerr($err["teacher"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforteachers") ?>:</td>
<td><input type="text" name="teachers" size=25 value="<? p($form->teachers) ?>">
(<? print_string("wordforteacherseg") ?>) <? formerr($err["teachers"]) ?>
<td><input type="text" name="teachers" maxlength="100" size=25 value="<? p($form->teachers) ?>">
(<? print_string("wordforteacherseg") ?>)
<? if (isset($err["teachers"])) formerr($err["teachers"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
(<? print_string("wordforstudenteg") ?>) <? formerr($err["student"]) ?>
<td><input type="text" name="student" maxlength="100" size=25 value="<? p($form->student) ?>">
(<? print_string("wordforstudenteg") ?>)
<? if (isset($err["student"])) formerr($err["student"]); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforstudents") ?>:</td>
<td><input type="text" name="students" size=25 value="<? p($form->students) ?>">
(<? print_string("wordforstudentseg") ?>) <? formerr($err["students"]) ?>
<td><input type="text" name="students" maxlength="100" size=25 value="<? p($form->students) ?>">
(<? print_string("wordforstudentseg") ?>)
<? if (isset($err["students"])) formerr($err["students"]); ?>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
</TABLE>
<INPUT type="hidden" name="id" value="<?=$course->id ?>">
<INPUT type="hidden" name="id" value="<?=$form->id ?>">
</FORM>
+65 -23
View File
@@ -1,39 +1,40 @@
<?PHP // $Id$
// Edit course settings
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
optional_variable($id, 0); // course id
require_login();
if ($id) {
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
} else { // Admin is creating a new course
require_login();
if (!isadmin()) {
error("Only administrators can use this page");
if (!iscreator()) {
error("Only administrators and teachers can use this page");
}
$course = NULL;
}
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/");
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
$form = (object)$HTTP_POST_VARS;
if ($form = data_submitted()) {
$form->startdate = make_timestamp($form->startyear, $form->startmonth, $form->startday);
@@ -43,7 +44,7 @@
$form->timemodified = time();
if ($course) {
if (!empty($course)) {
if (update_record("course", $form)) {
add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
redirect("view.php?id=$course->id", get_string("changessaved"));
@@ -53,14 +54,33 @@
} else {
$form->timecreated = time();
if ($newid = insert_record("course", $form)) { // Set up new course
$section->course = $newid; // Create a default section.
if ($newcourseid = insert_record("course", $form)) { // Set up new course
$section = NULL;
$section->course = $newcourseid; // Create a default section.
$section->section = 0;
$section->timemodified = time();
$section->id = insert_record("course_sections", $section);
add_to_log($newid, "course", "new", "view.php?id=$newid", "");
redirect("teacher.php?id=$newid", get_string("changessaved"));
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "");
if (isadmin()) { // Redirect admin to add teachers
redirect("../$CFG->admin/teacher.php?id=$newcourseid", get_string("changessaved"));
} else { // Add current teacher and send to course
$newteacher = NULL;
$newteacher->userid = $USER->id;
$newteacher->course = $newcourseid;
$newteacher->authority = 1; // First teacher is the main teacher
if (!$newteacher->id = insert_record("user_teachers", $newteacher)) {
error("Could not add you to this new course!");
}
$USER->teacher[$newcourseid] = true;
redirect("view.php?id=$newcourseid", get_string("changessaved"));
}
} else {
error("Serious Error! Could not create the new course!");
}
@@ -76,8 +96,8 @@
/// Otherwise fill and print the form.
if (!$form) {
if ($course) {
if (empty($form)) {
if (!empty($course)) {
$form = $course;
} else {
$form->startdate = time() + 3600 * 24;
@@ -89,13 +109,21 @@
$form->students = get_string("defaultcoursestudents");
$form->summary = get_string("defaultcoursesummary");
$form->format = "weeks";
$form->password = "";
$form->guest = 0;
$form->numsections = 10;
$form->newsitems = 5;
$form->showrecent = 1;
$form->category = 1;
$form->id = "";
}
}
$form->categories = get_records_sql_menu("SELECT id,name FROM course_categories");
if (empty($focus)) {
$focus = "";
}
$form->categories = get_records_select_menu("course_categories", "", "name", "id,name");
$form->courseformats = array (
"weeks" => get_string("formatweeks"),
@@ -107,13 +135,13 @@
$straddnewcourse = get_string("addnewcourse");
$stradministration = get_string("administration");
if (isset($course)) {
if (!empty($course)) {
print_header($streditcoursesettings, "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $streditcoursesettings", $focus);
} else {
print_header("$site->shortname : $straddnewcourse", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A>
print_header("$site->shortname: $straddnewcourse", "$site->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A>
-> $straddnewcourse", $focus);
}
@@ -136,6 +164,20 @@ function validate_form($course, &$form, &$err) {
if (empty($form->shortname))
$err["shortname"] = get_string("missingshortname");
if ($foundcourses = get_records("course", "shortname", $form->shortname)) {
if (!empty($course->id)) {
unset($foundcourses[$course->id]);
}
if (!empty($foundcourses)) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
$foundcoursenamestring = addslashes(implode(',', $foundcoursenames));
$err["shortname"] = get_string("shortnametaken", "", $foundcoursenamestring);
}
}
if (empty($form->summary))
$err["summary"] = get_string("missingsummary");
+26 -2
View File
@@ -1,7 +1,26 @@
<BLOCKQUOTE>
<FORM name="form" method="post" action="editsection.php">
<FORM name="theform" method="post" <?=$onsubmit ?> action="editsection.php">
<TABLE BORDER=0 cellpadding=0 cellspacing=0>
<TR>
<TD align=top>
<P><B><? print_string("summaryof", "", "$sectionname $form->section") ?></B></P>
<TEXTAREA NAME=summary COLS=60 ROWS=4 WRAP=virtual><?=$form->summary ?></TEXTAREA>
</TD>
<TD align=top width=100>
&nbsp;
</TD>
<TD align=top>
<FONT SIZE=-1>
<? helpbutton("summaries", get_string("helpsummaries"), "moodle", true, true);
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</FONT>
</TD>
</TR></TABLE>
<? print_textarea($usehtmleditor, 4, 60, 595, 200, "summary", $form->summary); ?>
<P>
<INPUT type="hidden" name=id value="<?=$form->id ?>">
<INPUT type="submit" value="<? print_string("savechanges") ?>">
@@ -9,3 +28,8 @@
</P>
</FORM>
</BLOCKQUOTE>
<?
if ($usehtmleditor) {
print_richedit_javascript("theform", "summary", "no");
}
?>
+16 -8
View File
@@ -1,11 +1,13 @@
<?PHP // $Id$
// Edit the introduction of a section
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); // Week ID
require_login();
if (! $section = get_record("course_sections", "id", $id)) {
error("Course section is incorrect");
}
@@ -14,8 +16,6 @@
error("Could not find the course!");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit this!");
}
@@ -23,11 +23,11 @@
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
if ($form = data_submitted()) {
$timenow = time();
if (! set_field("course_sections", "summary", $summary, "id", $section->id)) {
if (! set_field("course_sections", "summary", $form->summary, "id", $section->id)) {
error("Could not update the summary!");
}
@@ -39,14 +39,22 @@
/// Otherwise fill and print the form.
if (! $form ) {
if (empty($form)) {
$form = $section;
}
if ($usehtmleditor = can_use_richtext_editor()) {
$onsubmit = "onsubmit=\"copyrichtext(theform.summary);\"";
} else {
$onsubmit = "";
}
$sectionname = get_string("name$course->format");
$stredit = get_string("edit", "", " $sectionname $section->section");
print_header($stredit, $stredit, "", "form.summary");
print_header("$course->shortname: $stredit", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $stredit", "form.summary");
include("editsection.html");
+8 -10
View File
@@ -1,24 +1,26 @@
<?PHP // $Id$
// Asks for a course pass key, once only, and enrols that user
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id);
require_login();
require_variable($id);
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
if (match_referer() && isset($HTTP_POST_VARS)) { // form submitted
if ($form = data_submitted()) {
if ($password == $course->password) {
if ($form->password == $course->password) {
if (isguest()) {
add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$REMOTE_ADDR, $REMOTE_HOST");
} else {
} else if (!record_exists("user_students", "userid", $USER->id, "course", $course->id)) {
if (! enrol_student($USER->id, $course->id)) {
error("An error occurred while trying to enrol you.");
}
@@ -38,12 +40,10 @@
}
$USER->student["$id"] = true;
save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
@@ -72,12 +72,10 @@
}
$USER->student["$id"] = true;
save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
+107
View File
@@ -0,0 +1,107 @@
<?PHP // $Id$
// Displays all grades for a student in a course
require_once("../config.php");
require_once("lib.php");
require_variable($id); // course id
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
$strgrades = get_string("grades");
$strgrade = get_string("grade");
$strmax = get_string("maximumshort");
$stractivityreport = get_string("activityreport");
/// Get a list of all students
$columnhtml = array(); // Accumulate column html in this array.
$grades = array(); // Collect all grades in this array
$maxgrades = array(); // Collect all max grades in this array
$totalgrade = 0;
$totalmaxgrade = 0;
/// Collect modules data
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
/// Search through all the modules, pulling out grade data
$sections = get_all_sections($course->id); // Sort everything the same as the course
for ($i=0; $i<=$course->numsections; $i++) {
if (isset($sections[$i])) { // should always be true
$section = $sections[$i];
if (!empty($section->sequence)) {
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
$mod = $mods[$sectionmod];
if ($mod->visible) {
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
$gradefunction = $mod->modname."_grades";
if (function_exists($gradefunction)) { // Skip modules without grade function
if ($modgrades = $gradefunction($mod->instance)) {
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
" TITLE=\"$mod->modfullname\">".
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>";
if (empty($modgrades->grades[$USER->id])) {
$grades[] = "";
} else {
$grades[] = $modgrades->grades[$USER->id];
$totalgrade += (float)$modgrades->grades[$USER->id];
}
if (empty($modgrades->maxgrade)) {
$maxgrades[] = "";
} else {
$maxgrades[] = $modgrades->maxgrade;
$totalmaxgrade += $modgrades->maxgrade;
}
}
}
}
}
}
}
}
}
/// OK, we have all the data, now present it to the user
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
print_heading($strgrades);
$table->head = array( get_string("activity"), get_string("maximumgrade"), get_string("grade"));
$table->align = array("LEFT", "RIGHT", "RIGHT");
foreach ($grades as $key => $grade) {
$table->data[] = array($columnhtml[$key], $maxgrades[$key], $grade);
}
$table->data[] = array(get_string("total"), $totalmaxgrade, $totalgrade);
print_table($table);
print_continue("view.php?id=$course->id");
print_footer($course);
?>
+239
View File
@@ -0,0 +1,239 @@
<?PHP // $Id$
// Displays all grades for a course
require_once("../config.php");
require_once("lib.php");
require_once("../lib/psxlsgen.php");
require_variable($id); // course id
optional_variable($download, ""); // to download data
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
if (!isteacher($course->id)) {
error("Only teachers can use this page!");
}
$strgrades = get_string("grades");
$strgrade = get_string("grade");
$strmax = get_string("maximumshort");
$stractivityreport = get_string("activityreport");
/// Get a list of all students
if (!$students = get_course_students($course->id, "u.lastname ASC")) {
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
print_heading(get_string("nostudentsyet"));
print_footer($course);
exit;
}
foreach ($students as $student) {
$grades[$student->id] = array(); // Collect all grades in this array
$gradeshtml[$student->id] = array(); // Collect all grades html formatted in this array
$totals[$student->id] = array(); // Collect all totals in this array
}
$columns = array(); // Accumulate column names in this array.
$columnhtml = array(); // Accumulate column html in this array.
/// Collect modules data
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
/// Search through all the modules, pulling out grade data
$sections = get_all_sections($course->id); // Sort everything the same as the course
for ($i=0; $i<=$course->numsections; $i++) {
if (isset($sections[$i])) { // should always be true
$section = $sections[$i];
if ($section->sequence) {
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
$mod = $mods[$sectionmod];
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
if (file_exists($libfile)) {
require_once($libfile);
$gradefunction = $mod->modname."_grades";
if (function_exists($gradefunction)) { // Skip modules without grade function
if ($modgrades = $gradefunction($mod->instance)) {
if (!empty($modgrades->maxgrade)) {
if ($mod->visible) {
$maxgrade = "$strmax: $modgrades->maxgrade";
$maxgradehtml = "<BR>$strmax: $modgrades->maxgrade";
} else {
$maxgrade = "$strmax: $modgrades->maxgrade";
$maxgradehtml = "<BR><FONT class=\"dimmed_text\">$strmax: $modgrades->maxgrade</FONT>";
}
} else {
$maxgrade = "";
$maxgradehtml = "";
}
$image = "<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\"".
" TITLE=\"$mod->modfullname\">".
"<IMG BORDER=0 VALIGN=absmiddle SRC=\"../mod/$mod->modname/icon.gif\" ".
"HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"></A>";
if ($mod->visible) {
$columnhtml[] = "$image ".
"<A HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>$maxgradehtml";
} else {
$columnhtml[] = "$image ".
"<A CLASS=\"dimmed\" HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
"$instance->name".
"</A>$maxgradehtml";
}
$columns[] = "$mod->modfullname: $instance->name - $maxgrade";
foreach ($students as $student) {
if (!empty($modgrades->grades[$student->id])) {
$grades[$student->id][] = $currentstudentgrade = $modgrades->grades[$student->id];
if ($mod->visible) {
$gradeshtml[$student->id][] = $modgrades->grades[$student->id];
} else {
$gradeshtml[$student->id][] = "<FONT class=\"dimmed_text\">".
$modgrades->grades[$student->id].
"</FONT>";
}
} else {
$grades[$student->id][] = $currentstudentgrade = "";
$gradeshtml[$student->id][] = "";
}
if (!empty($modgrades->maxgrade)) {
$totals[$student->id] = (float)($totals[$student->id]) + (float)($currentstudentgrade);
} else {
$totals[$student->id] = (float)($totals[$student->id]) + 0;
}
}
}
}
}
}
}
}
} // a new Moodle nesting record? ;-)
/// OK, we have all the data, now present it to the user
if ($download == "xls") {
$myxls = new PhpSimpleXlsGen();
$myxls->totalcol = count($columns) + 5;
/// Print names of all the fields
$myxls->ChangePos(0,0);
$myxls->InsertText(get_string("firstname"));
$myxls->InsertText(get_string("lastname"));
foreach ($columns as $column) {
$myxls->InsertText($column);
}
$myxls->InsertText(get_string("total"));
/// Print all the lines of data.
$i = 0;
foreach ($grades as $studentid => $studentgrades) {
$i++;
$student = $students[$studentid];
$myxls->ChangePos($i,0);
$myxls->InsertText($student->firstname);
$myxls->InsertText($student->lastname);
foreach ($studentgrades as $grade) {
$myxls->InsertText($grade);
}
$myxls->InsertNumber($totals[$student->id]);
}
$myxls->SendFileName("$course->shortname $strgrades");
exit;
} else if ($download == "txt") {
/// Print header to force download
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"$course->shortname $strgrades.txt\"");
/// Print names of all the fields
echo get_string("firstname")."\t".get_string("lastname");
foreach ($columns as $column) {
echo "\t$column";
}
echo "\t".get_string("total")."\n";
/// Print all the lines of data.
foreach ($grades as $studentid => $studentgrades) {
$student = $students[$studentid];
echo "$student->firstname\t$student->lastname";
foreach ($studentgrades as $grade) {
echo "\t$grade";
}
echo "\t".$totals[$student->id];
echo "\n";
}
exit;
} else { // Just print the web page
print_header("$course->shortname: $strgrades", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> $strgrades");
print_heading($strgrades);
$table->head = array_merge(array ("", get_string("firstname"), get_string("lastname")), $columnhtml, get_string("total"));
$table->width = array(35, "");
$table->align = array("LEFT", "RIGHT", "LEFT");
foreach ($columns as $column) {
$table->width[] = "";
$table->align[] = "CENTER";
}
$table->width[] = "";
$table->align[] = "CENTER";
foreach ($students as $key => $student) {
$studentgrades = $gradeshtml[$student->id];
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
$name = array ("$picture", "$student->firstname", "$student->lastname");
$total = array ($totals[$student->id]);
$table->data[] = array_merge($name, $studentgrades, $total);
}
print_table($table);
echo "<TABLE BORDER=0 ALIGN=CENTER><TR>";
echo "<TD>";
$options["id"] = "$course->id";
$options["download"] = "xls";
print_single_button("grades.php", $options, get_string("downloadexcel"));
echo "<TD>";
$options["download"] = "txt";
print_single_button("grades.php", $options, get_string("downloadtext"));
echo "</TABLE>";
print_footer($course);
}
?>
+8 -9
View File
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Display list of all courses
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
optional_variable($category, "");
@@ -11,7 +11,7 @@
$strmycourses = get_string("mycourses");
$strfulllistofcourses = get_string("fulllistofcourses");
if (!$categories = get_all_categories()) {
if (!$categories = get_categories()) {
error("Could not find any course categories!");
}
@@ -32,11 +32,10 @@
$showcategories = (count($categories) > 1);
if ($showcategories) {
echo "<TABLE WIDTH=\"100%\" CELLPADDING=10 BORDER=0>";
echo "<TR><TD WIDTH=180 VALIGN=TOP>";
print_simple_box($strcategories, "CENTER", 180, $THEME->cellheading);
print_course_categories($categories, $category, 180);
echo "</TD><TD WIDTH=\"100%\" VALIGN=TOP>";
echo "<TABLE WIDTH=\"100%\" CELLPADDING=\"8\" BORDER=\"0\">";
echo "<TR><TD WIDTH=\"200\" VALIGN=\"TOP\">";
print_course_categories($categories, $category, 200);
echo "</TD><TD WIDTH=\"*\" VALIGN=\"TOP\">";
} else {
echo "<TABLE WIDTH=80% ALIGN=CENTER><TR><TD VALIGN=top>";
$category="all";
@@ -45,7 +44,7 @@
if ($category) {
if (isset($title)) {
print_simple_box($title, "CENTER", "100%", $THEME->cellheading);
print_heading_block($title);
}
echo "<BR>";
print_all_courses($category);
+590 -291
View File
File diff suppressed because it is too large Load Diff
+23 -11
View File
@@ -1,14 +1,14 @@
<?PHP // $Id$
// Displays different views of the logs.
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); // Course ID
optional_variable($user); // User to display
optional_variable($date); // Date to display
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
require_login($id);
require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
@@ -26,6 +26,7 @@
}
$strlogs = get_string("logs");
$stradministration = get_string("administration");
if ($user || $date) {
@@ -39,12 +40,18 @@
$userinfo = "$u->firstname $u->lastname";
}
if ($date) {
$dateinfo = userdate($date, "%A, %e %B %Y");
$dateinfo = userdate($date, get_string("strftimedaydate"));
}
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
if ($course->category) {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> ->
<A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
}
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
@@ -53,8 +60,13 @@
print_log($course, $user, $date, "ORDER BY l.time DESC");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
if ($course->category) {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
} else {
print_header("$course->shortname: $strlogs", "$course->fullname",
"<A HREF=\"../$CFG->admin/index.php\">$stradministration</A> -> $strlogs", "");
}
print_heading(get_string("chooselogs").":");
+35 -23
View File
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Produces a graph of log accesses
require("../config.php");
require("lib.php");
require("$CFG->libdir/graphlib.php");
require_once("../config.php");
require_once("lib.php");
require_once("$CFG->libdir/graphlib.php");
require_variable($id); // Course ID
require_variable($type); // Graph Type
@@ -34,27 +34,36 @@
switch ($type) {
case "usercourse.png":
$COURSE_MAX_LOG_DISPLAY = $COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
if ($timenow - $course->startdate > $COURSE_MAX_LOG_DISPLAY) {
$course->startdate = $timenow - $COURSE_MAX_LOG_DISPLAY;
$maxseconds = COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
if ($timenow - $course->startdate > $maxseconds) {
$course->startdate = $timenow - $maxseconds;
}
$timestart = $coursestart = usergetmidnight($course->startdate);
if ((($timenow - $timestart)/86400.0) > 40) {
$reducedays = 7;
} else {
$reducedays = 0;
}
$i = 0;
while ($timestart < $timenow) {
$timefinish = $timestart + 86400;
$days[$i] = userdate($timestart, "%a %e %b");
if ($reducedays) {
if ($i % $reducedays) {
$days[$i] = "";
} else {
$days[$i] = userdate($timestart, "%a %d %b");
}
} else {
$days[$i] = userdate($timestart, "%a %d %b");
}
$logs[$i] = 0;
$i++;
$timestart = $timefinish;
}
if ($rawlogs = get_records_sql("SELECT floor((`time` - $coursestart)/86400) as day,
count(*) as num FROM log
WHERE user = '$user->id'
AND course = '$course->id'
AND `time` > '$coursestart'
GROUP BY day ")) {
if ($rawlogs = get_logs_usercourse($user->id, $course->id, $coursestart)) {
foreach ($rawlogs as $rawlog) {
$logs[$rawlog->day] = $rawlog->num;
}
@@ -64,13 +73,16 @@
$graph = new graph(750, 400);
$graph->parameter['title'] = "Hits on $course->shortname by $user->firstname $user->lastname";
$a->coursename = $course->shortname;
$a->username = "$user->firstname $user->lastname";
$graph->parameter['title'] = get_string("hitsoncourse", "", $a);
$graph->x_data = $days;
$graph->y_data['logs'] = $logs;
$graph->y_format['logs'] = array('colour' => 'blue','line' => 'line');
$graph->y_label_left = "Hits";
$graph->y_label_left = get_string("hits");
$graph->label_size = "6";
$graph->y_order = array('logs');
@@ -78,6 +90,7 @@
$graph->parameter['shadow'] = 'none';
error_reporting(5); // ignore most warnings such as font problems etc
$graph->draw_stack();
break;
@@ -98,12 +111,7 @@
$hours[$i] = userdate($hour, "$hh %p");
}
if ($rawlogs = get_records_sql("SELECT floor((`time` - $daystart)/3600) as hour,
count(*) as num FROM log
WHERE user = '$user->id'
AND course = '$course->id'
AND `time` > '$daystart'
GROUP BY hour ")) {
if ($rawlogs = get_logs_userday($user->id, $course->id, $daystart)) {
foreach ($rawlogs as $rawlog) {
$logs[$rawlog->hour] = $rawlog->num;
}
@@ -112,13 +120,16 @@
$maxlogs = max($logs);
$graph = new graph(750, 400);
$graph->parameter['title'] = "Today's hits on $course->shortname by $user->firstname $user->lastname";
$a->coursename = $course->shortname;
$a->username = "$user->firstname $user->lastname";
$graph->parameter['title'] = get_string("hitsoncoursetoday", "", $a);
$graph->x_data = $hours;
$graph->y_data['logs'] = $logs;
$graph->y_format['logs'] = array('colour' => 'blue','bar' => 'fill','legend' =>'actual','bar_size' => 0.9);
$graph->y_label_left = "Hits";
$graph->y_label_left = get_string("hits");
$graph->label_size = "6";
$graph->y_order = array('logs');
@@ -126,6 +137,7 @@
$graph->parameter['shadow'] = 'none';
error_reporting(5); // ignore most warnings such as font problems etc
$graph->draw_stack();
break;
+14 -4
View File
@@ -1,11 +1,12 @@
<?PHP // $Id$
// Allows a teacher/admin to login as another user (in stealth mode)
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); // course id
require_variable($user); // login as this user
optional_variable($user); // login as this user
optional_variable($return); // return to being the real user again
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
@@ -13,6 +14,16 @@
require_login($course->id);
if ($return and $USER->realuser) {
$USER = get_user_info_from_db("id", $USER->realuser);
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
redirect($_SERVER["HTTP_REFERER"]);
exit;
}
// $user must be defined to go on
if (!isteacher($course->id)) {
error("Only teachers can use this page!");
}
@@ -30,7 +41,6 @@
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $teacher_id;
save_session("USER");
set_moodle_cookie($USER->username);
$student_name = "$USER->firstname $USER->lastname";
+7 -5
View File
@@ -1,10 +1,12 @@
<?PHP // $Id$
// Displays live view of recent logs
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_login($id);
require_variable($id);
require_login();
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
@@ -15,10 +17,10 @@
}
$strlivelogs = get_string("livelogs");
$strupdatesevery = get_string("updatesevery", "moodle", $COURSE_LIVELOG_REFRESH);
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "",
"<META HTTP-EQUIV='Refresh' CONTENT='$COURSE_LIVELOG_REFRESH; URL=loglive.php?id=$id'>");
"<META HTTP-EQUIV='Refresh' CONTENT='".COURSE_LIVELOG_REFRESH."; URL=loglive.php?id=$id'>");
$user=0;
$date=time() - 3600;
+122 -24
View File
@@ -5,10 +5,27 @@
require("../config.php");
require("lib.php");
if (isset($course) && isset($HTTP_POST_VARS)) { // add or update form submitted
$mod = (object)$HTTP_POST_VARS;
require_login();
require_login($mod->course);
if (isset($cancel)) {
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
redirect($return);
} else {
redirect("view.php?id=$mod->course");
}
}
if (isset($_POST["course"])) { // add or update form submitted
if (isset($SESSION->modform)) { // Variables are stored in the session
$mod = $SESSION->modform;
unset($SESSION->modform);
} else {
$mod = (object)$_POST;
}
if (!isteacher($mod->course)) {
error("You can't modify this course!");
@@ -16,7 +33,7 @@
$modlib = "../mod/$mod->modulename/lib.php";
if (file_exists($modlib)) {
include($modlib);
include_once($modlib);
} else {
error("This module is missing important code! ($modlib)");
}
@@ -29,7 +46,9 @@
if (! $updateinstancefunction($mod)) {
error("Could not update the $mod->modulename");
}
add_to_log($mod->course, "course", "update mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "update mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
break;
case "add":
@@ -48,7 +67,9 @@
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct section");
}
add_to_log($mod->course, "course", "add mod", "../mod/$mod->modulename/view.php?id=$mod->coursemodule", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "add mod",
"../mod/$mod->modulename/view.php?id=$mod->coursemodule",
"$mod->modulename $mod->instance");
break;
case "delete":
if (! $deleteinstancefunction($mod->instance)) {
@@ -60,17 +81,20 @@
if (! delete_mod_from_section($mod->coursemodule, "$mod->section")) {
notify("Could not delete the $mod->modulename from that section");
}
add_to_log($mod->course, "course", "delete mod", "view.php?id=$mod->course", "$mod->modulename $mod->instance");
add_to_log($mod->course, "course", "delete mod",
"view.php?id=$mod->course",
"$mod->modulename $mod->instance");
break;
default:
error("No mode defined");
}
if ($SESSION->returnpage) {
rebuild_course_cache($mod->course);
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
save_session("SESSION");
redirect($return);
} else {
redirect("view.php?id=$mod->course");
@@ -78,18 +102,83 @@
exit;
}
if (isset($return)) {
$SESSION->returnpage = $HTTP_REFERER;
save_session("SESSION");
}
if (isset($move)) {
require_variable($id);
move_module($id, $move);
if (! $cm = get_record("course_modules", "id", $id)) {
error("This course module doesn't exist");
}
redirect($HTTP_REFERER);
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
move_module($cm, $move);
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($hide)) {
if (! $cm = get_record("course_modules", "id", $hide)) {
error("This course module doesn't exist");
}
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
hide_course_module($cm->id);
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($show)) {
if (! $cm = get_record("course_modules", "id", $show)) {
error("This course module doesn't exist");
}
if (!isteacher($cm->course)) {
error("You can't modify this course!");
}
if (! $section = get_record("course_sections", "id", $cm->section)) {
error("This module doesn't exist");
}
if (! $module = get_record("modules", "id", $cm->module)) {
error("This module doesn't exist");
}
$site = get_site();
if ($module->visible and ($section->visible or ($site->id == $cm->course))) {
show_course_module($cm->id);
rebuild_course_cache($cm->course);
}
if ($site->id == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
}
exit;
} else if (isset($delete)) { // value = course module
@@ -102,8 +191,6 @@
error("This course doesn't exist");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
@@ -134,7 +221,7 @@
$form->fullmodulename = $fullmodulename;
$form->instancename = $instance->name;
include("mod_delete.html");
include_once("mod_delete.html");
exit;
@@ -149,6 +236,10 @@
error("This course doesn't exist");
}
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
if (! $module = get_record("modules", "id", $cm->module)) {
error("This module doesn't exist");
}
@@ -161,6 +252,10 @@
error("This course section doesn't exist");
}
if (isset($return)) {
$SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
}
$form->coursemodule = $cm->id;
$form->section = $cm->section; // The section ID
$form->course = $course->id;
@@ -184,7 +279,7 @@
} else if (isset($add)) {
if (!$add) {
redirect($HTTP_REFERER);
redirect($_SERVER["HTTP_REFERER"]);
die;
}
@@ -203,7 +298,8 @@
$form->course = $course->id;
$form->module = $module->id;
$form->modulename = $module->name;
$form->instance = $cm->instance;
$form->instance = "";
$form->coursemodule = "";
$form->mode = "add";
$sectionname = get_string("name$course->format");
@@ -221,34 +317,36 @@
error("No action was specfied");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
$streditinga = get_string("editinga", "moodle", $fullmodulename);
$strmodulenameplural = get_string("modulenameplural", $module->name);
if ($course->category) {
print_header("$course->shortname: $streditinga", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"$CFG->wwwroot/mod/$module->name/index.php?id=$course->id\">$strmodulenameplural</A> ->
$streditinga", "form.name", "", false);
} else {
print_header("$course->shortname: $streditinga", "$course->fullname",
"$streditinga", "form.name", "", false);
}
unset($SESSION->modform); // Clear any old ones that may be hanging around.
$modform = "../mod/$module->name/mod.html";
if (file_exists($modform)) {
print_heading($pageheading);
print_simple_box_start("center", "", "$THEME->cellheading");
include($modform);
include_once($modform);
print_simple_box_end();
} else {
notice("This module cannot be added to this course yet!", "$CFG->wwwroot/course/view.php?id=$course->id");
notice("This module cannot be added to this course yet! (No file found at: $modform)", "$CFG->wwwroot/course/view.php?id=$course->id");
}
print_footer($course);
+2 -1
View File
@@ -9,7 +9,8 @@
<input type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
<input type="hidden" name=modulename value="<? p($form->modulename) ?>">
<input type="hidden" name=instance value="<? p($form->instance) ?>">
<input type="submit" value=" Yes "> <input type=button value=" No " onclick="javascript:history.go(-1);">
<input type="submit" value=" <? print_string("yes")?> ">
<input type=button value=" <? print_string("no")?> " onclick="javascript:history.go(-1);">
</FORM>
</td></tr></table>
+45 -47
View File
@@ -1,79 +1,77 @@
<? // $Id$
<?php // $Id$
// social.php - course format featuring social forum
// included from view.php
include_once("../mod/forum/lib.php");
include_once("../mod/reading/lib.php");
require_once("$CFG->dirroot/mod/forum/lib.php");
require_once("$CFG->dirroot/mod/resource/lib.php");
$leftwidth = 210;
?>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<TR>
<TD WIDTH="200" VALIGN="TOP">
<?
print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td width="<?php echo $leftwidth?>" valign="top">
<?php
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".
get_string("editmyprofile")."</A>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile.$blinker;
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
print_side_block("", $moddata, "", $modicon);
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
// Then, print all the available resources (Section 0)
print_simple_box(get_string("resources"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_section($site->id, $sections[0], $mods, $modnamesused, true);
/// Then, print all the available resources (Section 0)
print_section_block(get_string("activities"), $course, $sections[0],
$mods, $modnames, $modnamesused, true, "100%", isediting($course->id));
if (isediting($site->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=",
$modnames, "section0", "", get_string("add")."...");
echo "</DIV>";
}
/// Print all the recent activity
// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
print_recent_activity($course);
echo "</TD></TR></TABLE>";
echo "<BR>";
// Print a form to search forums
print_simple_box(get_string("search","forum"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo "<DIV ALIGN=CENTER>";
forum_print_search_form($course);
echo "</DIV>";
// Admin links and controls
if (isteacher($course->id)) {
print_course_admin_links($course, "100%");
if ($course->showrecent) {
print_side_block_start(get_string("recentactivity"), $leftwidth, "sideblockrecentactivity");
print_recent_activity($course);
print_side_block_end();
}
echo "</TD>";
echo "<TD WIDTH=\"100%\" VALIGN=\"TOP\">";
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
/// Admin links and controls
print_course_admin_links($course);
echo "</td>";
echo "<td width=\"*\" valign=\"top\">";
if ($social = forum_get_course_forum($course->id, "social")) {
if (forum_is_subscribed($USER->id, $social->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
$headertext = "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td>".
get_string("socialheadline").
"</td><td align=right><font size=1>".
"<a href=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</a></td>".
"</tr></table>";
print_heading_block($headertext);
echo "<img alt=\"\" height=7 src=\"../pix/spacer.gif\"><br>";
forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
forum_print_latest_discussions($social->id, 10, "plain", "", false);
} else {
notify("Could not find or create a social forum here");
}
?>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
-192
View File
@@ -1,192 +0,0 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
require("../config.php");
require("../user/lib.php");
optional_variable($id); // course id
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
$strassignteachers = get_string("assignteachers");
$stradministration = get_string("administration");
$strexistingteachers = get_string("existingteachers");
$strnoexistingteachers = get_string("noexistingteachers");
$strpotentialteachers = get_string("potentialteachers");
$strnopotentialteachers = get_string("nopotentialteachers");
$straddteacher = get_string("addteacher");
$strremoveteacher = get_string("removeteacher");
$strsearch = get_string("search");
$strsearchagain = get_string("searchagain");
$strtoomanytoshow = get_string("toomanytoshow");
if (!$id) {
print_header("$site->fullname: $strassignteachers", "$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strassignteachers");
if ($courses = get_records_sql("SELECT * from course WHERE category > 0 ORDER BY fullname")) {
print_heading(get_string("choosecourse"));
print_simple_box_start("CENTER");
foreach ($courses as $course) {
echo "<A HREF=\"teacher.php?id=$course->id\">$course->fullname</A><BR>";
}
print_simple_box_end();
} else {
print_heading(get_string("nocoursesyet"));
print_continue("$CFG->wwwroot/admin/");
}
print_footer();
exit;
}
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect (can't find it)");
}
print_header("$site->fullname: $course->shortname: $strassignteachers",
"$site->fullname",
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
<A HREF=\"teacher.php\">$strassignteachers</A> ->
$course->shortname", "");
print_heading("<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>");
/// Get all existing teachers for this course.
$teachers = get_course_teachers($course->id);
/// Add a teacher if one is specified
if ($add) {
if (! $user = get_record("user", "id", $add)) {
error("That teacher (id = $add) doesn't exist", "teacher.php?id=$course->id");
}
if ($teachers) {
foreach ($teachers as $tt) {
if ($tt->id == $user->id) {
error("That user is already a teacher for this course.", "teacher.php?id=$course->id");
}
}
}
$teacher->user = $user->id;
$teacher->course = $course->id;
if ($teachers) {
$teacher->authority = 2;
} else {
$teacher->authority = 1; // First teacher is the main teacher
}
$teacher->id = insert_record("user_teachers", $teacher);
if (! $teacher->id) {
error("Could not add that teacher to this course!");
}
$teachers[] = $user;
}
/// Remove a teacher if one is specified.
if ($remove) {
if (! $user = get_record("user", "id", $remove)) {
error("That teacher (id = $remove) doesn't exist", "teacher.php?id=$course->id");
}
if ($teachers) {
foreach ($teachers as $key => $tt) {
if ($tt->id == $user->id) {
remove_teacher($user->id, $course->id);
unset($teachers[$key]);
}
}
}
}
/// Print the lists of existing and potential teachers
echo "<TABLE CELLPADDING=2 CELLSPACING=10 ALIGN=CENTER>";
echo "<TR><TH WIDTH=50%>$strexistingteachers</TH><TH WIDTH=50%>$strpotentialteachers</TH></TR>";
echo "<TR><TD WIDTH=50% NOWRAP VALIGN=TOP>";
/// First, show existing teachers for this course
if (! $teachers) {
echo "<P ALIGN=CENTER>$strnoexistingteachers</A>";
} else {
foreach ($teachers as $teacher) {
echo "<P ALIGN=right>$teacher->firstname $teacher->lastname, $teacher->email &nbsp;&nbsp; <A HREF=\"teacher.php?id=$course->id&remove=$teacher->id\" TITLE=\"$strremoveteacher\"><IMG SRC=\"../pix/t/right.gif\" BORDER=0></A></P>";
}
}
echo "<TD WIDTH=50% NOWRAP VALIGN=TOP>";
/// Print list of potential teachers
if ($search) {
$users = get_records_sql("SELECT * from user WHERE confirmed = 1 AND deleted = 0
AND (firstname LIKE '%$search%' OR
lastname LIKE '%$search%' OR
email LIKE '%$search%')
AND username <> 'guest' AND username <> 'changeme'");
} else {
$users = get_records_sql("SELECT * from user WHERE confirmed = 1 AND deleted = 0
AND username <> 'guest' AND username <> 'changeme'");
}
if ($users) {
foreach ($users as $user) { // Remove users who are already teachers
if ($teachers) {
foreach ($teachers as $teacher) {
if ($teacher->id == $user->id) {
continue 2;
}
}
}
$potential[] = $user;
}
}
if (! $potential) {
echo "<P ALIGN=CENTER>$strnopotentialteachers</A>";
if ($search) {
echo "<FORM ACTION=teacher.php METHOD=GET>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearchagain\">";
echo "</FORM>";
}
} else {
if ($search) {
echo "<P ALIGN=CENTER>($strsearchresults)</P>";
}
if (count($potential) <= 20) {
foreach ($potential as $user) {
echo "<P ALIGN=LEFT><A HREF=\"teacher.php?id=$course->id&add=$user->id\" TITLE=\"$straddteacher\"><IMG SRC=\"../pix/t/left.gif\" BORDER=0></A>&nbsp;&nbsp;$user->firstname $user->lastname, $user->email";
}
} else {
echo "<P ALIGN=CENTER>There are too many users to show.<BR>";
echo "Enter a search word here.";
echo "<FORM ACTION=teacher.php METHOD=GET>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\">";
echo "<INPUT TYPE=text NAME=search SIZE=20>";
echo "<INPUT TYPE=submit VALUE=\"$strsearch\">";
echo "</FORM>";
}
}
echo "</TR></TABLE>";
print_footer();
?>
+9 -9
View File
@@ -1,17 +1,17 @@
<?PHP // $Id$
// Allows a teacher to edit teacher order and roles for a course
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); // course id
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course ID was incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("Only teachers can edit the course!");
}
@@ -19,12 +19,12 @@
/// If data submitted, then process and store.
if (match_referer() && isset($HTTP_POST_VARS)) {
if ($form = data_submitted()) {
$rank = array();
// Peel out all the data from variable names.
foreach ($HTTP_POST_VARS as $key => $val) {
foreach ($form as $key => $val) {
if ($key <> "id") {
$type = substr($key,0,1);
$num = substr($key,1);
@@ -33,11 +33,11 @@
}
foreach ($rank as $num => $vals) {
if (! $teacher = get_record_sql("SELECT * FROM user_teachers WHERE course='$course->id' and user='$num'")) {
if (! $teacher = get_record("user_teachers", "course", "$course->id", "userid", "$num")) {
error("No such teacher in course $course->shortname with user id $num");
}
$teacher->role = $vals[r];
$teacher->authority = $vals[a];
$teacher->role = $vals['r'];
$teacher->authority = $vals['a'];
if (!update_record("user_teachers", $teacher)) {
error("Could not update teacher entry id = $teacher->id");
}
+182 -115
View File
@@ -6,24 +6,16 @@
// courses that aren't so rigidly defined by time.
// Included from "view.php"
include_once("../mod/forum/lib.php");
require_once("$CFG->dirroot/mod/forum/lib.php");
if (! $sections = get_all_sections($course->id) ) {
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->id = insert_record("course_sections", $section);
if (! $sections = get_all_sections($course->id) ) {
error("Error finding or creating section structures for this course");
}
}
if (isset($topic)) {
if ($topic == "all") {
unset($USER->topic);
$displaysection = course_set_display($course->id, $topic);
} else {
if (isset($USER->display[$course->id])) { // for admins, mostly
$displaysection = $USER->display[$course->id];
} else {
$USER->topic = $topic;
$displaysection = course_set_display($course->id, 0);
}
save_session("USER");
}
if (isteacher($course->id) and isset($marker)) {
@@ -33,163 +25,238 @@
}
}
if ($course->newsitems) {
$news = forum_get_course_forum($course->id, "news");
}
// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$strshowalltopics = get_string("showalltopics");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strtopichide = get_string("topichide", "", $strstudents);
$strtopicshow = get_string("topicshow", "", $strstudents);
$strmarkthistopic = get_string("markthistopic");
$strmarkedthistopic = get_string("markedthistopic");
}
/// Layout the whole page as three big columns.
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
echo "<tr valign=top><td valign=top width=180>";
// Layout the left column
// Links to people
$blinker = " <BLINK>*</BLINK>";
print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
/// Links to people
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile.$blinker;
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
print_side_block("", $moddata, "", $modicon);
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
// Then all the links to module types
/// Links to all activity modules by type
$moddata = array();
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_simple_box("Activities", $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $moddata, "", $modicon);
print_side_block($stractivities, "", $moddata, $modicon);
// Print a form to search forums
print_simple_box(get_string("search","forum"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo "<DIV ALIGN=CENTER>";
forum_print_search_form($course);
echo "</DIV>";
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform);
// Admin links and controls
if (isteacher($course->id)) {
print_course_admin_links($course);
/// Admin links and controls
print_course_admin_links($course);
/// Start main column
echo "</td><td width=\"*\">";
print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock");
print_spacer(8, 1, true);
echo "<table class=\"topicsoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
/// Print Section 0
$section = 0;
$thissection = $sections[$section];
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img src=\"$pixpath/t/edit.gif\" ".
"height=11 width=11 border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>";
echo "&nbsp;</td></tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
// Start main column
echo "</TD><TD WIDTH=\"*\">";
print_simple_box(get_string("topicoutline"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
// Everything below uses "section" terminology - each "section" is a topic.
/// Now all the normal modules by topic
/// Everything below uses "section" terminology - each "section" is a topic.
// Now all the sectionly modules
$timenow = time();
$section = 1;
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
while ($section <= $course->numsections) {
if (isset($USER->topic)) { // Just display a single topic
if ($USER->topic != $section) {
$section++;
continue;
}
if (!empty($displaysection) and $displaysection != $section) {
$section++;
continue;
}
$currenttopic = ($course->marker == $section);
if (!empty($sections[$section])) {
$thissection = $sections[$section];
if ($currenttopic) {
$highlightcolor = $THEME->cellheading2;
} else {
$highlightcolor = $THEME->cellheading;
}
echo "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$section</B></FONT></P>";
echo "</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" WIDTH=\"100%\">";
if (! $thissection = $sections[$section]) {
unset($thissection);
$thissection->course = $course->id; // Create a new section structure
$thissection->section = $section;
$thissection->summary = "";
$thissection->visible = 1;
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new topic!");
}
}
if (isediting($course->id)) {
$thissection->summary .= "&nbsp;<A HREF=editsection.php?id=$thissection->id><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
$currenttopic = ($course->marker == $section);
if (!$thissection->visible) {
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"topicsoutlinesidehidden\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthidden\"";
} else if ($currenttopic) {
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"topicsoutlinesidehighlight\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthighlight\"";
} else {
$colorsides = "bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\"";
}
echo text_to_html($thissection->summary);
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo "<td valign=top align=center $colormain width=\"100%\">";
echo get_string("notavailable");
echo "</td>";
print_section($course->id, $thissection, $mods, $modnamesused);
} else {
echo "<td valign=top $colormain width=\"100%\">";
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</DIV>";
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
"<img src=\"$pixpath/t/edit.gif\" border=0 height=11 width=11></a>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
}
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->topic)) {
$strshowalltopics = get_string("showalltopics");
echo "<A HREF=\"view.php?id=$course->id&topic=all\" TITLE=\"$strshowalltopics\"><IMG SRC=../pix/i/all.gif BORDER=0></A><BR><BR>";
if ($displaysection == $section) { // Show the zoom boxes
echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlytopic = get_string("showonlytopic", "", $section);
echo "<A HREF=\"view.php?id=$course->id&topic=$section\" TITLE=\"$strshowonlytopic\"><IMG SRC=../pix/i/one.gif BORDER=0></A><BR><BR>";
echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id) and $course->marker != $section) {
$strmarkthistopic = get_string("markthistopic");
echo "<A HREF=\"view.php?id=$course->id&marker=$section\" TITLE=\"$strmarkthistopic\"><IMG SRC=../pix/i/marker.gif BORDER=0></A><BR><BR>";
if (isediting($course->id)) {
if ($course->marker == $section) { // Show the "light globe" on/off
echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
"<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
"<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
$section++;
}
echo "</TABLE>";
echo "</table>";
echo "</TD><TD WIDTH=210>";
if ($news or $course->showrecent) {
echo "</td><td width=210>";
// Print all the news items.
/// Print all the news items.
if ($course->newsitems) {
if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
if ($news) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</font>";
print_side_block_end();
}
// Print all the recent activity
if ($course->showrecent) {
print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
print_recent_activity($course);
print_side_block_end();
}
echo "<BR>";
}
// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
print_spacer(1, 120, true);
}
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>
+2 -3
View File
@@ -5,8 +5,8 @@
// but will remove them from the student list and prevent
// any course email being sent to them.
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
require_variable($id); //course
optional_variable($user, $USER->id); //user
@@ -34,7 +34,6 @@
if ($user->id == $USER->id) {
unset($USER->student["$id"]);
save_session("USER");
redirect("$CFG->wwwroot");
}
+19 -16
View File
@@ -2,30 +2,29 @@
// Display user activity reports for a course
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
$modes = array("outline", "complete", "todaylogs", "alllogs");
require_variable($id); // course id
require_variable($user); // user id
optional_variable($mode, "outline");
$modes = array("outline", "complete", "todaylogs", "alllogs");
require_login();
if (! $course = get_record("course", "id", $id)) {
error("Course id is incorrect.");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You are not allowed to look at this page");
}
if (! $user = get_record("user", "id", $user)) {
error("User ID is incorrect");
}
if (!isteacher($course->id) and $user->id != $USER->id ) {
error("You are not allowed to look at this page");
}
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
$stractivityreport = get_string("activityreport");
@@ -49,19 +48,20 @@
}
print_heading("$user->firstname $user->lastname");
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
echo "<TD>Reports: </TD>";
echo "<table cellpadding=10 align=center><tr>";
echo "<td>reports: </td>";
foreach ($modes as $listmode) {
$strmode = get_string($listmode);
if ($mode == $listmode) {
echo "<TD><U>$strmode</U></TD>";
echo "<td><u>$strmode</u></td>";
} else {
echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
echo "<td><a href=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</a></td>";
}
}
echo "</TR></TABLE>";
echo "</tr></table>";
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
switch ($mode) {
case "todaylogs" :
@@ -107,6 +107,9 @@
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $sectionmod) {
if (empty($mods[$sectionmod])) {
continue;
}
$mod = $mods[$sectionmod];
$instance = get_record("$mod->modname", "id", "$mod->instance");
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
@@ -175,7 +178,7 @@ function print_outline_row($mod, $instance, $result) {
echo "<TD>&nbsp;&nbsp;&nbsp;</TD>";
if (isset($result->time)) {
$timeago = format_time(time() - $result->time);
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago ago)</TD>";
echo "<TD VALIGN=top NOWRAP>".userdate($result->time)." ($timeago)</TD>";
}
echo "</TR>";
}
+44 -19
View File
@@ -2,8 +2,8 @@
// Display the course home page.
require("../config.php");
require("lib.php");
require_once("../config.php");
require_once("lib.php");
optional_variable($id);
optional_variable($name);
@@ -22,39 +22,64 @@
}
}
require_login($id);
require_login($course->id);
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
if ( isteacher($course->id) ) {
if ($edit == "on") {
$USER->editing = true;
} else if ($edit == "off") {
$USER->editing = false;
if (isteacher($course->id)) {
if (isset($edit)) {
if ($edit == "on") {
$USER->editing = true;
} else if ($edit == "off") {
$USER->editing = false;
}
}
if (isset($hide)) {
set_section_visible($course->id, $hide, "0");
}
if (isset($show)) {
set_section_visible($course->id, $show, "1");
}
}
if ($help == "on") {
$USER->help = true;
} else if ($help == "off") {
$USER->help = false;
}
save_session("USER");
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
save_session("SESSION");
if (! $course->category) { // This course is not a real course.
redirect("$CFG->wwwroot/");
}
if (empty($THEME->custompix)) {
$pixpath = "../pix";
$modpixpath = "../mod";
} else {
$pixpath = "../theme/$CFG->theme/pix";
$modpixpath = "../theme/$CFG->theme/pix/mod";
}
$courseword = get_string("course");
print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,
update_course_icon($course->id));
$loggedinas = "<p class=\"logininfo\">".user_login_string($course, $USER)."</p>";
print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,
update_course_icon($course->id), $loggedinas);
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
if (! $sections = get_all_sections($course->id)) { // No sections found
// Double-check to be extra sure
if (! $section = get_record("course_sections", "course", $course->id, "section", 0)) {
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->visible = 1;
$section->id = insert_record("course_sections", $section);
}
if (! $sections = get_all_sections($course->id) ) { // Try again
error("Error finding or creating section structures for this course");
}
}
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
$sections = get_all_sections($course->id);
switch ($course->format) {
case "weeks":
+190 -125
View File
@@ -2,188 +2,253 @@
// Display the whole course as "weeks" made of of modules
// Included from "view.php"
include_once("../mod/forum/lib.php");
require_once("$CFG->dirroot/mod/forum/lib.php");
if (! $sections = get_all_sections($course->id)) {
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->id = insert_record("course_sections", $section);
if (! $sections = get_all_sections($course->id) ) {
error("Error finding or creating section structures for this course");
}
}
if (isset($week)) {
if ($week == "all") {
unset($USER->section);
$displaysection = course_set_display($course->id, $week);
} else {
if (isset($USER->display[$course->id])) {
$displaysection = $USER->display[$course->id];
} else {
$USER->section = $week;
$displaysection = course_set_display($course->id, 0);
}
save_session("USER");
}
if ($course->newsitems) {
$news = forum_get_course_forum($course->id, "news");
}
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$stractivities = get_string("activities");
$strshowallweeks = get_string("showallweeks");
if (isediting($course->id)) {
$strstudents = moodle_strtolower($course->students);
$strweekhide = get_string("weekhide", "", $strstudents);
$strweekshow = get_string("weekshow", "", $strstudents);
}
// Layout the whole page as three big columns.
echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>";
echo "<TR VALIGN=top><TD VALIGN=top WIDTH=180>";
// Layout the left column
/// Layout the whole page as three big columns.
echo "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
/// The left column ...
// Links to people
echo "<tr valign=top><td valign=top width=180>";
print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</A>";
/// Links to people
$moddata[]="<a title=\"".get_string("listofallpeople")."\" href=\"../user/index.php?id=$course->id\">".get_string("participants")."</a>";
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$editmyprofile = "<a title=\"$USER->firstname $USER->lastname\" href=\"../user/edit.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile")."</a>";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile.$blinker;
$moddata[]= $editmyprofile." <blink>*</blink>";
}
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
print_side_block("", $moddata, "", $modicon);
$modicon[]="<img src=\"$pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
print_side_block(get_string("people"), "", $moddata, $modicon);
// Then all the links to module types
/// Then all the links to activities by type
$moddata = array();
$modicon = array();
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
$moddata[] = "<A HREF=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</A>";
$modicon[] = "<IMG SRC=\"../mod/$modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[] = "<a href=\"../mod/$modname/index.php?id=$course->id\">".$modnamesplural[$modname]."</a>";
$modicon[] = "<img src=\"$modpixpath/$modname/icon.gif\" height=16 width=16 alt=\"\">";
}
}
print_simple_box(get_string("activities"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $moddata, "", $modicon);
print_side_block($stractivities, "", $moddata, $modicon);
// Print a form to search forums
print_simple_box(get_string("search","forum"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo "<DIV ALIGN=CENTER>";
forum_print_search_form($course);
echo "</DIV>";
/// Print a form to search forums
$searchform = forum_print_search_form($course, "", true);
$searchform = "<div align=\"center\">$searchform</div>";
print_side_block(get_string("search","forum"), $searchform);
// Admin links and controls
if (isteacher($course->id)) {
print_course_admin_links($course);
/// Admin links and controls
print_course_admin_links($course);
/// Start main column
echo "</td><td width=\"*\">";
print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
print_spacer(8, 1, true);
echo "<table class=\"weeklyoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
/// Print Section 0 with general activities
$section = 0;
$thissection = $sections[$section];
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo "<tr>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top width=20>&nbsp;</td>";
echo "<td valign=top bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" ".
"href=\"editsection.php?id=$thissection->id\"><img height=11 width=11 src=\"$pixpath/t/edit.gif\" ".
"border=0 alt=\"$streditsummary\"></a></p>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo "</div>";
}
echo "</td>";
echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\" valign=top align=center width=10>";
echo "&nbsp;</td></tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
// Start main column
echo "</TD><TD WIDTH=\"*\">";
print_simple_box(get_string("weeklyoutline"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
// Now all the weekly modules
/// Now all the weekly sections
$timenow = time();
$weekdate = $course->startdate; // this should be 0:00 Monday of that week
$week = 1;
$section = 1;
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
$streditsummary = get_string("editsummary");
$stradd = get_string("add");
$strftimedateshort = " ".get_string("strftimedateshort");
echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
while ($weekdate < $course->enddate) {
$nextweekdate = $weekdate + ($weekofseconds);
$weekday = userdate($weekdate, $strftimedateshort);
$endweekday = userdate($weekdate+518400, $strftimedateshort);
if (isset($USER->section)) { // Just display a single week
if ($USER->section != $week) {
$week++;
$weekdate = $nextweekdate;
continue;
}
if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
$section++;
$weekdate = $nextweekdate;
continue;
}
$thisweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
if (!empty($sections[$section])) {
$thissection = $sections[$section];
$weekday = date("j F", $weekdate);
$endweekday = date("j F", $weekdate+(6*24*3600));
if ($thisweek) {
$highlightcolor = $THEME->cellheading2;
} else {
$highlightcolor = $THEME->cellheading;
}
echo "<TR>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top WIDTH=20>";
echo "<P ALIGN=CENTER><FONT SIZE=3><B>$week</B></FONT></P>";
echo "</TD>";
echo "<TD VALIGN=top BGCOLOR=\"$THEME->cellcontent\" WIDTH=\"100%\">";
echo "<P><FONT SIZE=3 COLOR=\"$THEME->cellheading2\">$weekday - $endweekday</FONT></P>";
if (! $thisweek = $sections[$week]) {
$thisweek->course = $course->id; // Create a new week structure
$thisweek->section = $week;
$thisweek->summary = "";
if (!$thisweek->id = insert_record("course_sections", $thisweek)) {
unset($thissection);
$thissection->course = $course->id; // Create a new week structure
$thissection->section = $section;
$thissection->summary = "";
$thissection->visible = 1;
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new week!");
}
}
if (isediting($course->id)) {
$thisweek->summary .= "&nbsp;<A TITLE=\"$streditsummary\" HREF=\"editsection.php?id=$thisweek->id\"><IMG SRC=\"../pix/t/edit.gif\" BORDER=0 ALT=\"$streditsummary\"></A></P>";
}
$currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
echo text_to_html($thisweek->summary);
print_section($course->id, $thisweek, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=",
$modnames, "section$week", "", "$stradd...");
echo "</DIV>";
}
echo "</TD>";
echo "<TD NOWRAP BGCOLOR=\"$highlightcolor\" VALIGN=top ALIGN=CENTER WIDTH=10>";
echo "<FONT SIZE=1>";
if (isset($USER->section)) {
$strshowallweeks = get_string("showallweeks");
echo "<A HREF=\"view.php?id=$course->id&week=all\" TITLE=\"$strshowallweeks\"><IMG SRC=../pix/i/all.gif BORDER=0></A></FONT>";
if (!$thissection->visible) {
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"weeklyoutlinesidehidden\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthidden\"";
} else if ($currentweek) {
$colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"weeklyoutlinesidehighlight\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthighlight\"";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $week);
echo "<A HREF=\"view.php?id=$course->id&week=$week\" TITLE=\"$strshowonlyweek\"><IMG SRC=../pix/i/one.gif BORDER=0></A></FONT>";
$colorsides = "bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\"";
}
echo "</TD>";
echo "</TR>";
echo "<TR><TD COLSPAN=3><IMG SRC=\"../pix/spacer.gif\" WIDTH=1 HEIGHT=1></TD></TR>";
$week++;
echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";
echo "<td valign=top $colormain width=\"100%\">";
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo "<p class=\"weeklydatetext\">$weekday - $endweekday ";
echo "(".get_string("notavailable").")";
echo "</p>";
echo "</td>";
} else {
echo "<p class=\"weeklydatetext\">$weekday - $endweekday</p>";
if (isediting($course->id)) {
$thissection->summary .= " <a title=\"$streditsummary\" href=\"editsection.php?id=$thissection->id\">".
"<img src=\"$pixpath/t/edit.gif\" height=11 width=11 border=0></a></p>";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "<div align=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&amp;section=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo "</div>";
}
echo "</td>";
}
echo "<td nowrap $colorsides valign=top align=center width=10>";
echo "<font size=1>";
if ($displaysection == $section) {
echo "<a href=\"view.php?id=$course->id&week=all\" title=\"$strshowallweeks\">".
"<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $section);
echo "<a href=\"view.php?id=$course->id&week=$section\" title=\"$strshowonlyweek\">".
"<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
if (isediting($course->id)) {
if ($thissection->visible) { // Show the hide/show eye
echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strweekhide\">".
"<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
} else {
echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strweekshow\">".
"<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
}
}
echo "</td>";
echo "</tr>";
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
$section++;
$weekdate = $nextweekdate;
}
echo "</TABLE>";
echo "</table>";
if (!empty($news) or !empty($course->showrecent)) {
echo "</td><td width=210>";
echo "</TD><TD WIDTH=210>";
// Print all the news items.
// Print all the news items.
if ($course->newsitems) {
if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
if (!empty($news)) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<font size=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "</font>";
print_side_block_end();
}
// Print all the recent activity
if (!empty($course->showrecent)) {
print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
print_recent_activity($course);
print_side_block_end();
}
echo "<BR>";
}
// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
print_spacer(1, 120, true);
}
echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
echo "</TD></TR></TABLE>\n";
echo "</td></tr></table>\n";
?>
-43
View File
@@ -1,43 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Moodle Docs: Background</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>Background</H2>
<P>Moodle is an active and evolving work in progress.</P>
<P>I've been working on it, in some way or other, for several years. It started
in the 90's when I was webmaster at <a href="http://dougiamas.com/">Curtin University
of Technology</a> and a system administrator of their WebCT installation. I
encountered many frustrations with the WebCT beast and developed an itch that
needed scratching - there had to be a better way (no, not Blackboard :-)</P>
<P>I also know a lot of people in schools and smaller institutions (and some big
ones!) who want to make better use of the Internet but don't know where to start
in the maze of technologies and pedagogies that are out there. I've always hoped
there would be a Free alternative that such people could use to help them move
their teaching skills into the online environment.</P>
<P>My strong beliefs in the unrealised possibilities of Internet-based education
led me to complete a Masters and then a PhD in Education, combining my former
career in Computer Science with newly constructed knowledge about the nature
of learning and collaboration.</P>
<P>Since then Moodle has progressed through several very different prototypes
to achieve something I'm ready to call version 1.0 and release upon an unsuspecting
world (August 20, 2002). I've been using it in several courses and find it an
extremely usable and reliable tool for building high-quality online courses
- others are reporting the same. Given the context in which it's been designed,
it works particularly well for smaller institutions, or for smaller, more intimate
classes.</P>
<P>When compared to the big commercial tools such as WebCT or Blackboard I think
it still falls short in some areas (such as scalability and standards support),
but it comes out ahead in many others (see <a href="features.html">Features</a>).
</P>
<P>&nbsp;</P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id$</FONT></P>
</BODY>
</HTML>
-22
View File
@@ -1,22 +0,0 @@
<HEAD>
<!-- $Id$ -->
<TITLE>Moodle Docs: Table of Contents</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<FONT SIZE=2 FACE="san-serif">
<P><B>Moodle Documentation</B></P>
<LI><A TARGET="main" HREF="intro.html">Introduction</A>
<LI><A TARGET="main" HREF="background.html">Background</A>
<LI><A TARGET="main" HREF="features.html">Features</A>
<LI><A TARGET="main" HREF="install.html">Installation</A>
<LI><A TARGET="main" HREF="teacher.html">Teacher Manual</A>
<LI><A TARGET="main" HREF="developer.html">Developer Manual</A>
<LI><A TARGET="main" HREF="future.html">Future</A>
<LI><A TARGET="main" HREF="credits.html">Credits</A>
<LI><A TARGET="main" HREF="licence.html">License</A>
</FONT>
</BODY>
+17
View File
@@ -0,0 +1,17 @@
<?PHP // $Id$
require("../config.php");
$info = document_file("files.php", false);
include($info->filepath);
print_header();
echo "<FONT SIZE=2 FACE=\"san-serif\">";
foreach ($string as $file => $filename) {
echo "<LI><A TARGET=\"main\" HREF=\"$CFG->wwwroot/doc/?file=$file\">$filename</A></LI>";
}
echo "</FONT>";
?>
-140
View File
@@ -1,140 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Moodle Docs: Credits</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>Credits</H2>
<P><B>Moodle </B>itself is Copyright &copy; 2001-2002, <A TARGET=_top HREF="http://dougiamas.com/">
Martin Dougiamas</A>. &nbsp;It is distributed under the <A HREF="licence.html">
GNU Public License</A>.</P>
<H3><BR>Special thanks</H3>
<UL>
<LI><B><A TARGET=_top HREF="http://pctaylor.com">Dr Peter C. Taylor</A></B>, at Curtin University of Technology in Perth, Australia, for working
with the prototypes and making many useful suggestions along the way
<LI><B>Art Lader</B>, at Aiken High School, SC, USA for many good deeds.
</UL>
<H3><BR>Translations</H3>
<BLOCKQUOTE>
<P>Many thanks to these people - each translation takes many hours of work.
<UL>
<LI><B>br - Portuguese (Brazilian)</B>, by Fabricio Valadares (webdesigner@unincor.br).
<LI><B>fi - Finnish</B>, by Petri Asikainen (paca@sci.fi).
<LI><B>fr - French</B>, by Sebastien Nameche (seb@gaia.anet.fr)
</UL>
</BLOCKQUOTE>
<H3><BR>Other contributors</H3>
<BLOCKQUOTE>
<P>Thanks to all of you contributing ideas and code, especially Dustin Rue, James Miller, Matt Hope, Petri Asikainen ... and also:</P>
<UL>
<LI>everyone who contributes to the <A TARGET=_top HREF="http://bugs.moodle.com">bug tracker</A>, and
<LI>everyone enrolled in the "<A TARGET=_top HREF="http://moodle.com/course/">Using Moodle</A>" course at moodle.com</A>
</UL>
</BLOCKQUOTE>
<H3><BR>Moodle libraries</H3>
<BLOCKQUOTE>
<P>Some of Moodle's libraries were written by other people, and are being
redistributed as part of Moodle under the LGPL. My thanks go out to the
authors of all these excellent products - without them Moodle would be missing
important functionality. &nbsp;Copyright information for this software is included below:</P>
<P><B>ADOdb &nbsp; </B>- &nbsp;lib/adodb<BR>
</P>
<BLOCKQUOTE>
<P>Database abstraction library for MySQL, PostgreSQL, MSSQL, Oracle,
Interbase, Foxpro, Access, ADO, Sybase, DB2 and ODBC.</P>
<P>Version: 2.00 14 May 2002&nbsp;<BR>
Copyright &copy; 2000, 2001 John Lim (jlim@natsoft.com.my)<BR>
License: Dual LGPL and BSD-style<BR>
URL: &nbsp;<A HREF="http://php.weblogs.com/adodb" TARGET="newpage">http://php.weblogs.com/adodb</A><BR>
</P>
</BLOCKQUOTE>
<P><B>Graph Class</B> &nbsp; - &nbsp;lib/graphlib.php </P>
<BLOCKQUOTE>
<P>Class to draw line, point, bar, and area graphs, including numeric
x-axis and double y-axis.</P>
<P> Version: 1.6.3<BR>
Copyright &copy;&nbsp;2000&nbsp; Herman Veluwenkamp,&nbsp;hermanV@mindless.com<BR>
License: LGPL<BR>
</P>
</BLOCKQUOTE>
<P><B>PHP mailer</B> &nbsp; - &nbsp;lib/class.phpmailer.php<BR>
</P>
<BLOCKQUOTE>Class for sending email using either sendmail, PHP mail(),
or SMTP.&nbsp; Methods are based upon the standard AspEmail(tm) classes.<BR>
<BR>
Version 1.25, Created 07/02/2001<BR>
Copyright &copy; 2001 Brent R. Matzelle &lt;bmatzelle@yahoo.com&gt;<BR>
License: LGPL<BR>
URL: &nbsp; <A HREF="http://phpmailer.sourceforge.net" TARGET="newpage">http://phpmailer.sourceforge.net</A><BR>
<BR>
</BLOCKQUOTE>
<P><B>SMTP class &nbsp; </B>- &nbsp;lib/class.smtp.php<BR>
</P>
<BLOCKQUOTE>Class that can be used to connect and communicate with
any SMTP server. <BR>
It implements all the SMTP functions defined in RFC821 except TURN.<BR>
<BR>
Version: 03/26/2001 <BR>
Copyright &copy; 2001 &nbsp;Chris Ryan &lt;chris@greatbridge.com&gt;<BR>
<BR>
</BLOCKQUOTE>
<P><B>PHP Simple Excel File Generator</B>&nbsp; - &nbsp; lib/psxlsgen.php</P>
<BLOCKQUOTE>Class to generate very simple MS Excel files (xls)
via PHP.<BR>
<BR>
Version: 0.3b<BR>
Copyright &copy; 2001 &nbsp;Erol Ozcan &lt;eozcan@superonline.com&gt;<BR>
License: GNU LGPL<BR>
URL: <A HREF="http://psxlsgen.sourceforge.net" TARGET="newpage">http://psxlsgen.sourceforge.net</A><BR>
</BLOCKQUOTE>
<P><B>IP-Atlas</B>&nbsp; - &nbsp; lib/ipatlas</P>
<BLOCKQUOTE>PHP scripts to show the location of an IP address on a map.<BR>
<BR>
Version: 1.0<BR>
Copyright &copy; 2002 &nbsp; Ivan Kozik<BR>
License: GNU GPL<BR>
URL: <A HREF="http://www.xpenguin.com/ip-atlas.php" TARGET="newpage">http://www.xpenguin.com/ip-atlas.php</A><BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE><BR>
</BLOCKQUOTE>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id$</FONT></P>
</BODY>
</HTML>
-34
View File
@@ -1,34 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Moodle Docs: Background</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>Features</H2>
Here is a big list of some of the features in Moodle 1.0:
<UL><LI>Supports a social constructionist pedagogy (collaboration, activities, critical reflection, etc)</LI><LI>Suitable for 100% online classes as well as supplementing face-to-face learning<LI>Simple, lightweight, browser-compatible interface</LI><LI>Plug-in "themes" allow you to customise the colours, fonts, layout etc</LI><LI>Easy to install on most platforms</LI><LI>Easy administration - students can create their own accounts. Email addresses are verified.</LI><LI>One account works for the whole server</LI><LI>Security - teachers can add an "enrolment key" to their courses to keep out non-students. They can give out this key face-to-face or via personal email etc</LI><LI>Students are encouraged to build an online profile including photos, description etc</LI><LI>Every user can specify their own timezone, and every date in Moodle is translated to that timezone (eg posting dates, assignment due dates etc)</LI><LI>Choice of course formats such as by week, by topic or a discussion-focussed social format</LI><LI>Flexible array of course modules - Forums, Journals, Readings, Choices, Surveys, Assignments.</LI><LI>New modules can be written and plugged in to existing Moodle installations</LI><LI>The code is clearly-written PHP under a GPL license - easy to modify and localise</LI><LI>Full database abstraction supports all major brands of database (except for initial table definition)</LI><LI>Ready for internationalisation - supports plug-in languages and locale-based date formats etc</LI><LI>Mail integration - copies of forum posts, teacher feedback etc can be mailed in HTML or plain text.</LI><LI>Recent changes to the course since the last login are displayed on the course home page</LI><LI>Full user logging and tracking - activity reports for each student are available with graphs and details about each module (last access, number of times read) as well as a detailed "story" of each students involvement including postings, journal entries etc on one page.</LI>
</UL>
<B>Forum Module</B>
<UL><LI>Different types of forums are available, such as teacher-only, course news, open-to-all, and one-thread-per-user.</LI><LI>All postings have the authors photo attached.</LI><LI>Discussions can be viewed nested, flat or threaded, oldest or newest first.</LI><LI>Individual forums can be subscribed to by each person so that copies are forwarded via email, or the teacher can force subscription for all</LI>
</UL>
<B>Survey Module</B>
<UL><LI>Built-in surveys (COLLES, ATTLS) have been proven as instruments for analysing online classes</LI><LI>Online survey reports always available, including many graphs. Data is downloadable as an Excel spreadsheet or CSV text file.</LI><LI>Survey interface prevents partly-finished surveys.</LI><LI>Feedback is provided to the student of their results compared to the class averages</UL>
<B>Readings Module</B>
<UL><LI>Supports display of any electronic content</LI><LI>Files can be uploaded and managed on the server, or created on the fly using web forms (text or HTML)</LI><LI>External content on the web can be linked to or seamlessly included within the course interface.</LI></UL>
<B>Choice Module</B>
<UL><LI>Like a poll. Can either be used to vote on something, or to get feedback from every student (eg research consent)</LI></UL>
<B>Journal Module</B>
<UL><LI>Journals are private between student and teacher.</LI><LI>Each journal entry can be directed by an open question.</LI><LI>For each particular journal entry, the whole class can be assessed on one page in one form.</LI><LI>Teacher feedback is appended to the journal entry page, and notification is mailed out.</LI></UL>
<B>Assignment Module</B>
<UL><LI>Assignments can be specified with a due date and a maximum grade.</LI><LI>Students can upload their assignments (any file format) to the server - they are date-stamped.</LI><LI>Late assignments are allowed, but the amount of lateness is shown clearly to the teacher</LI><LI>For each particular assignment, the whole class can be assessed (grade and comment) on one page in one form.</LI><LI>Teacher feedback is appended to the assignment page for each student, and notification is mailed out.</LI></UL>
<P>&nbsp;</P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id: features.html,v 1.2 2001/12/09
10:34:19 martin Exp $</FONT></P>
</BODY>
</HTML>
-46
View File
@@ -1,46 +0,0 @@
<HEAD>
<TITLE>Moodle Docs: Future</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>Future</H2>
<P>I'm committed to continuing my work on Moodle and on keeping it Open and Free.
I have a deeply-held belief in the importance of unrestricted education and
empowered teaching, and Moodle is the main way I can contribute to the realisation
of these ideals.
<P>As Moodle gains in maturity, I hope its directions are influenced by the community
of developers and users. A dynamic database of proposed features and their status
can be found at <A TARGET=_top HREF="http://bugs.moodle.org/">bugs.moodle.org</A>.
Your <a href="developer.html">contributions</a> in the form of ideas, code,
feedback and promotion are all very welcome.
<P>Now that 1.0.1 has been released, most of my efforts will concentrate on the
macro level (supporting larger classes and integrating into larger institutions)
and the micro level (improving support for decisions and processes, for both
teachers and learners).
<P>The next 6 months or so I will have to slow down my own development a little
(because I have a PhD thesis to finish). During this time there'll be a number
of small upgrades 1.0.2, 1.0.3 etc that I expect will contain minor new features
and polishing. I'll also be working with people adding new plugins (support for
more databases, new modules and new themes).
<P>Sometime in the first half of 2003 you can expect a major release (1.1, maybe 1.5) that has
new features like:
<UL>
<LI>Full user account management (eg connection to external databases, import/export etc)
<LI>Full grade management
<LI>Ability to define groups and group work
<LI>Automatic linking in texts to uploaded readings (like Wiki)
<LI>Online support for teachers to design and maintain classes
<LI>Online support for students in collaboration processes
</UL>
<P ALIGN="CENTER">&nbsp;</P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id$</FONT></P>
</BODY>
-8
View File
@@ -1,8 +0,0 @@
<HEAD>
<TITLE>Moodle Documentation</TITLE>
</HEAD>
<FRAMESET COLS="200,*">
<FRAME NAME="contents" SRC="contents.html">
<FRAME NAME="main" SRC="intro.html">
</FRAMESET>
+49
View File
@@ -0,0 +1,49 @@
<?PHP // $Id$
require("../config.php");
optional_variable($file, ""); // docs file to view
optional_variable($frame, ""); // docs file to view
optional_variable($sub, ""); // sub-section (named anchor)
optional_variable($lang, ""); // override current language
if (!empty($lang)) {
$SESSION->lang = $lang;
}
if (!empty($sub)) {
$sub = "#$sub";
} else {
$sub = "";
}
if (empty($file)) {
$include = false;
if (empty($frame)) {
$file = "intro.html";
} else {
$file = $frame;
}
} else {
$include = true;
}
document_file($file, $include);
if ($include) {
exit;
}
?>
<HEAD>
<TITLE>Moodle Documentation</TITLE>
</HEAD>
<FRAMESET ROWS="70,*">
<FRAME NAME="top" SRC="top.php">
<FRAMESET COLS="200,*">
<FRAME NAME="contents" SRC="contents.php">
<FRAME NAME="main" SRC="index.php?file=<?PHP echo "$file$sub"; ?>">
</FRAMESET>
</FRAMESET>
+116 -41
View File
@@ -1,11 +1,15 @@
<HEAD>
<TITLE>Moodle Docs: Installation</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
<LINK REL="stylesheet" HREF="../theme/standard/styles.php" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>Installing Moodle</H2>
<P>This guide explains how to install Moodle for the first time.</P>
<P>This guide explains how to install Moodle for the first time. It goes into some detail
about some of the steps, in order to cover the wide variety of small differences between
web server setups, so this document may look long and complicated. Don't be put off by this
- I usually set Moodle up in a few minutes!</P>
<P>Take your time and work through this document carefully - it will save you time later on.</P>
<P>Sections in this document:</P>
<OL>
<LI><A HREF="#requirements">Requirements</A></LI>
@@ -22,24 +26,32 @@
<H3><A NAME="requirements"></A>1. Requirements</H3>
<blockquote>
<p>Moodle is primarily developed in Linux using PHP, Apache and MySQL, and regularly
tested under Windows XP and Mac OS X environments.</p>
tested with PostgreSQL and in Windows XP and Mac OS X environments.</p>
<p>All you should need are:</p>
<ul>
<ol>
<li>a working installation of <A HREF="http://www.php.net/">PHP</A> (version
4.1.0 or better), including the <A HREF="http://www.boutell.com/gd/">GD</A>
library for manipulating images.</li>
<li>a working database server (<A HREF="http://www.mysql.com/">MySQL</A> for
now, but soon it will support PostgreSQL, MSSQL, Oracle, Interbase, Foxpro,
Access, ADO, Sybase, DB2 or ODBC).</li>
</ul>
4.1.0 or later), with the following features enabled (most PHP installations
these days will have all of these):
<ul>
<LI>JPEG and/or PNG image editing support via the <A HREF="http://www.boutell.com/gd/">GD library</A></li>
<LI>Sessions support</LI>
<LI>File uploading allowed</LI>
</UL>
</LI>
<li>a working database server: <A HREF="http://www.mysql.com/">MySQL</A> or <A HREF="http://www.postgresql.org/">PostgreSQL</A> are recommended. (MSSQL, Oracle, Interbase, Foxpro, Access, ADO, Sybase, DB2 or ODBC are also theoretically supported but will require you to manually set up the database tables).</li>
</ol>
<p>On a Windows platform, the quickest way to satisfy these requirements is
to download <A HREF="http://www.phpgeek.com/">PHPTriad</A>, <A HREF="http://www.foxserv.net/">FoxServ</A>,
to download <A HREF="http://www.foxserv.net/">FoxServ</A>,
or <A HREF="http://www.easyphp.org/">EasyPHP</A> which will install Apache,
PHP, and MySQL for you. Make sure you enable the GD module so Moodle can process
images - you may have to edit php.ini and remove the comment (;) from this
line: 'extension=php_gd.dll'.</p>
<p>On Mac OS X I highly recommend the <a href="http://fink.sourceforge.net/">fink</a>
project.</p>
project as a way to download easily-maintainable packages for all of this.</p>
<p>If you're on Linux or another Unix then I'll assume you can figure all this out for yourself! ;-) </p>
</blockquote>
<P>&nbsp;</P>
<H3><A NAME="downloading"></A>2. Download</H3>
@@ -65,6 +77,7 @@
index.php - the front page of the site</p>
<ul>
<li>admin/ - code to administrate the whole server </li>
<li>auth/ - plugin modules to authenticate users </li>
<li>course/ - code to display and manage courses </li>
<li>doc/ - help documentation for Moodle (eg this page)</li>
<li>files/ - code to display and manage uploaded files</li>
@@ -83,20 +96,38 @@
<blockquote>
<p>Moodle will also need some space on your hard disk to store uploaded files,
such as course documents and user pictures.</p>
<p>Create a directory for this purpose somewhere <B>away</B> from the web server
documents directory (we don't want these files to be directly accessible from
the web), and ensure that the web server software has permission to write
<p>Create a directory for this purpose somewhere. For security, it's best that
this directory is NOT accessible directly via the web. The easiest way to do this
is to simply locate it OUTSIDE the web directory, otherwise protect it
by creating a file in the data directory called .htaccess, containing this line:
<blockquote>
<PRE>deny from all</PRE>
</blockquote>
<p>To make sure that Moodle can save uploaded files in this directory, check that
the web server software (eg Apache) has permission to write
to this directory. On Unix machines, this means setting the owner of the directory
to be something like &quot;nobody&quot; or &quot;apache&quot;.</p>
<p>On many shared hosting servers, you will probably need to restrict all file access
to your "group" (to prevent other webhost customers from looking at or changing your files),
but provide full read/write access to everyone else (which will allow the web server
to access your files). Speak to your server administrator if you are having
trouble setting this up securely.</p>
</blockquote>
<P>&nbsp;</P>
<H3><A NAME="database"></A>5. Create a database</H3>
<blockquote>
<p>You need to create an empty database (eg "moodle") in your database system
<p>You need to create an empty database (eg "moodle") in your database system
along with a special user (eg "moodleuser") that has access to that database
(and that database only. For example, don't use the "root" user for the moodle
database in a production system - it's a security hazard). </p>
<p>eg for MySQL: </p>
(and that database only). You could use the "root" user if you wanted to, but
this is not recommended for a production system: if hackers manage to discover
the password then your whole database system would be at risk, rather than
just one database.
</p>
<p>Example command lines for MySQL: </p>
<PRE>
# mysql -u root -p
> CREATE DATABASE moodle;
@@ -104,9 +135,18 @@
TO moodleuser@localhost IDENTIFIED BY 'yourpassword';
> quit
# mysqladmin -p reload
</PRE>
<p>Example command lines for PostgreSQL: </p>
<PRE>
# su - postgres
> psql -c "create user moodleuser createdb;" template1
> psql -c "create database moodle;" -U moodleuser template1
> psql -c "alter user moodleuser nocreatedb;" template1
</PRE>
<p>(For MySQL I highly recommend the use of <a href="http://phpmyadmin.sourceforge.net/">phpMyAdmin</a>
to manage your databases).</p>
<p>As of version 1.0.8, Moodle now supports table prefixes, and so can safely share
a database with tables from other applications.</p>
</blockquote>
<P>&nbsp;</P>
<H3><A NAME="webserver" id="webserver"></A>6. Check your web server settings</H3>
@@ -120,18 +160,43 @@
</blockquote>
<p>Just make sure index.php is in the list (and preferably towards the start
of the list, for efficiency).</p>
<p>Secondly, check your PHP configuration file (usually called php.ini) and
make sure uploading has been turned on:</p>
<p>Secondly, Moodle requires a number of PHP settings to be active for it to
work. <B>On most servers these will already be the default settings.</B>
However, some PHP servers (and some of the more recent PHP versions) may
have things set differently. These are defined in PHP's configuration
file (usually called php.ini):</p>
<blockquote>
<pre>file_uploads = On</pre>
<pre>file_uploads = 1
magic_quotes_gpc = 1
short_open_tag = 1
session.auto_start = 0
</pre>
</blockquote>
<p>If you don't have access to httpd.conf or php.ini on your server, or you
have Moodle on a server with other applications that require different
settings, then you can OVERRIDE all of the default settings.
<p>To do this, you need to create a file called <B>.htaccess</B> in Moodle's
main directory that contains definitions for these settings.
This only works on Apache servers and only when Overrides have been allowed.
<BLOCKQUOTE><PRE>
DirectoryIndex index.php index.html index.htm
php_value magic_quotes_gpc 1
php_value file_uploads 1
php_value short_open_tag 1
php_value session.auto_start 0</BLOCKQUOTE></PRE>
<P>You can also do things like define the maximum size for uploaded files:
<BLOCKQUOTE><PRE>
php_value upload_max_filesize 2M
php_value post_max_size 2M
</BLOCKQUOTE></PRE>
<p>The easiest thing to do is just copy the sample file from lib/htaccess
and edit it to suit your needs. It contains further instructions. For
example, in a Unix shell:
<blockquote>
<pre>cp lib/htaccess .htaccess</pre>
</blockquote>
<p>Most distributions of PHP have this turned on by default, but you may want
to check it anyway. </p>
<p>If you don't have access to httpd.conf or php.ini on your server, another
way you can set both of the above settings (and more) is to put definitions in a
.htaccess file in Moodle's main directory. This only works on Apache servers
and only when Overrides have been allowed. A sample .htaccess file
is included with Moodle (called lib/htaccess) that includes further information.
</blockquote>
<p>&nbsp;</p>
@@ -142,7 +207,8 @@
<p>To start with, make a copy of config-dist.php and call it config.php. We
do this so that your config.php won't be overwritten in case you upgrade Moodle
later on. </p>
<p>Edit config.php to specify the database details that you just defined, as
<p>Edit config.php to specify the database details that you just defined (including
a table prefix - notice this is REQUIRED for PostgreSQL), as
well as the site address, file system directory and data directory.
The config file has detailed directions.</p>
<p>For the rest of this installation document we will assume your site is at:
@@ -151,15 +217,15 @@
<P>&nbsp;</P>
<H3><A NAME="admin"></A>8. Go to the admin page</H3>
<blockquote>
<p>The admin page should now be working at: http://example.com/moodle/admin.
<p>The admin page should now be working at: <u>http://example.com/moodle/admin</u>.
If you try and access the front page of your site you'll be taken there automatically
anyway. The first time you access this admin page, you will be presented with
a GPL agreement with which you need to agree before you can continue with the setup.</p>
<P>(Moodle will also try to set some cookies in your browser. If you have
your browser set up to let you choose to accept cookies, then you <B>must</B>
accept the Moodle cookies, or Moodle won't work properly.)
<p>Now Moodle will start setting set up your database. Firstly, the main database
tables are created. You should see a number of SQL statements followed by
<p>Now Moodle will start setting up your database and creating tables to store data.
Firstly, the main database tables are created. You should see a number of SQL statements followed by
status messages (in green or red) that look like this:</p>
<blockquote>
<p>CREATE TABLE course ( id int(10) unsigned NOT NULL auto_increment, category
@@ -183,8 +249,7 @@
<p>Scroll down the very bottom of the page and press the &quot;Continue&quot;
link.</p>
<p>Next you will see a similar page that sets up all the tables required by
each Moodle module. As before, they should all be green, otherwise you may
be a problem in the module code.</p>
each Moodle module. As before, they should all be green.</p>
<p>Scroll down the very bottom of the page and press the &quot;Continue&quot;
link.</p>
@@ -195,7 +260,13 @@
come back and edit these later on using the admin interface. Scroll down
to the bottom and click &quot;Save changes&quot;.</p>
<p>Next is a form where you can define parameters for your Moodle site and the
<p>If (and only if) you find yourself getting stuck on this page or the next
page, unable to continue, then your server probably has what I call the
"buggy referrer" problem. This is easy to fix: just edit
your config.php and set the variable buggy_referrer to <i>true</i>, then
try the page again.</p>
<p>The next page is a form where you can define parameters for your Moodle site and the
front page, such as the name, format, description and so on.
Fill this out (you can always go back and change these later) and then press
@@ -241,7 +312,12 @@
where this script is run regularly (eg every five minutes). This provides
a &quot;heartbeat&quot; so that the script can perform functions at periods
defined by each module.</p>
<p>Test that the script works by running it directly from your browser:</p>
<P>Note that the machine performing the cron <B>does not need to be the same
machine that is running Moodle</B>. For example, if you have a limited web hosting
service that does not have cron, then you can might choose to run cron on another
server or on your home computer. All that matters is that the cron.php file is
called every five minutes or so.</p>
<p>First, test that the script works by running it directly from your browser:</p>
<blockquote>
<PRE>http://example.com/moodle/admin/cron.php</PRE>
</blockquote>
@@ -277,9 +353,8 @@
<PRE>*/5 * * * * wget -q -O /dev/null http://example.com/moodle/admin/cron.php</PRE>
</blockquote>
<p>On Windows systems: The simplest way is to use my package <A TITLE="Click to download this package (150k)" HREF="http://moodle.com/download/moodle-cron-for-windows.zip">moodle-cron-for-windows.zip</A>
which makes this whole thing very easy.</p>
<p>Other platforms: you will need to find another way to do this (please let
me know so I can update this documentation).<br>
which makes this whole thing very easy. You can also explore using the built-in
Windows feature for "Scheduled Tasks".</p>
</p>
</blockquote>
<H3><A NAME="course"></A>10. Create a new course</H3>
@@ -301,7 +376,7 @@
on course-building.</p>
</blockquote>
<P>&nbsp;</P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="." TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id$</FONT></P>
</BODY>
-37
View File
@@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Moodle Docs: Introduction</TITLE>
<LINK REL="stylesheet" HREF="../theme/standard/styles.css" TYPE="TEXT/CSS">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>Introduction</H2>
<P>Moodle is a software package for producing internet-based courses and web sites.
It's an ongoing development project designed to support a <A HREF="http://dougiamas.com/writing/herdsa2002/">social constructionist</A> framework of education. </P>
<P>Moodle is provided freely as <A HREF="http://www.opensource.org/docs/definition_plain.html">
Open Source</A> software (under the <A HREF="http://www.gnu.org/copyleft/gpl.html">
GNU Public License</A>). Basically this means Moodle is copyrighted, but that you have additional
freedoms. You are allowed to copy, use and modify Moodle <B>provided</B> that you agree: to provide
the source to others; to not modify or remove the original license, and apply this same
license to any derivative work.
<P>Moodle will run on any computer that can run <A HREF="http://www.php.net/">
PHP</A>, and can support many types of database (particularly <a href="http://www.mysql.com/">MySQL</a>).</P>
<P>The word Moodle is an acronym for Modular Object-Oriented Dynamic Learning
Environment, which is mostly useful to programmers and education theorists.&nbsp;
&nbsp;It's also a verb that describes the process of lazily meandering through
something, doing things as it occurs to you to do them, an enjoyable tinkering
that often leads to insight and creativity. As such it applies both to the way
Moodle was developed, and to the way a student or teacher might approach studying
or teaching an online course.</P>
<P><BR>
</P>
<P ALIGN="CENTER"><FONT SIZE="1"><A HREF="index.html" TARGET="_top">Moodle Documentation</A></FONT></P>
<P ALIGN="CENTER"><FONT SIZE="1">Version: $Id$</FONT></P>
</BODY>
</HTML>
+20
View File
@@ -0,0 +1,20 @@
<?PHP // $Id$
require("../config.php");
if (empty($CFG->langmenu)) {
$langmenu = "";
} else {
$currlang = current_language();
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
if (! $site = get_site()) {
error("Site is misconfigured");
}
$strdocumentation = get_string("documentation");
print_header("$site->shortname: $strdocumentation", "$site->fullname", "$strdocumentation", "", "", true, $langmenu, navmenu($site));
?>

Some files were not shown because too many files have changed in this diff Show More