169 Commits

Author SHA1 Message Date
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
9a9a2907c2 Add a target to the "made with moodle" link to avoid confusing students 2003-03-07 15:09:12 +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
moodler
3f3960656d Fixed link to picture file in print_picture_file 2003-02-11 01:53: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
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
750ab759ed Slightly better robustness for notice() when there is no referer 2003-01-26 06:04:14 +00:00
moodler
03f06a1412 Remove the ampersand thing ... it was actually a Mozilla display bug. :-) 2003-01-24 08:41:18 +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
37208cd23a Some robustness 2003-01-20 07:13:02 +00:00
moodler
6ed3da1da4 Cleaned up file argument processing a bit 2003-01-12 06:53:25 +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
moodler
ce78926df0 Small robustness fixes 2003-01-06 13:55:37 +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
8663bfdb08 Display months in local language for date_selector 2003-01-03 06:43:12 +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
b79f41cd42 Robust fix 2003-01-01 15:13:21 +00:00
moodler
6dd38d4656 Allow STRIKE tag 2002-12-30 13:02:21 +00:00
moodler
47f1da80d0 More little fixups for robustness 2002-12-30 05:13:43 +00:00
moodler
b9b8ab696f Fixed p() and s() to deal with zero better 2002-12-30 03:39:42 +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
9d378732e4 More little fixes 2002-12-29 04:17:32 +00:00
moodler
99988d1a87 This version installs smoothly for me on PostgreSQL 2002-12-23 14:19:45 +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
moodler
780db23080 Slight improvements to file security (scan for more bad characters) 2002-11-21 02:51:50 +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
3e50a13968 Fix to break out of frames 2002-11-10 08:08:23 +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
87a2fa0338 Tweaks 2002-10-25 07:17:23 +00:00
moodler
840aaba179 Added some more allowed HTML tags 2002-10-21 09:16:06 +00:00
moodler
4168490e17 Added paragraphs to allowed HTML tags 2002-10-21 04:12:54 +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
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
moodler
0be05df068 Find URLs at the beginning of lines ... 2002-10-18 17:05:17 +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
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
ff80e012b0 Miscellaneous little changes from today ... 2002-10-14 16:00:55 +00:00
moodler
1a072208ce Smilies are now replaced even in HTML text, and small fixes 2002-10-12 05:09:49 +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
0095d5cd3c Additions to cope with richtext editor being used in some forms. 2002-10-10 07:26:10 +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
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
08056730fa Improved interface for course/teachers.php ... instead of typing numbers
into a box there is now a menu for each user.   Much better!
2002-09-19 14:51:49 +00:00