Commit Graph

562 Commits

Author SHA1 Message Date
moodler c3a3c5b8b2 Fixed logic for $CFG->nofixday : http://moodle.org/mod/forum/discuss.php?d=23637 2005-05-12 06:37:24 +00:00
paca70 eeefd0b0df Use SITEID instead of hardcoded value.
SITEID could be != 1 in older installations.
2005-05-11 08:57:14 +00:00
moodler 4c20222852 A quick hack to allow anonymising of all names.
You can make everyone have the name "Bruce" if you want.   }-)
2005-05-10 06:18:30 +00:00
moodler 254dfbfa34 This should get you where you were trying to go in the first place
when the session timed out.

Not tested though.
2005-05-09 17:45:07 +00:00
moodler 42146c8cf4 Session error redirects to login page bug 3178 2005-05-09 17:42:17 +00:00
gustav_delius 4b97919fcd I have changed check_php_version() to use version_compare() in an attempt to fix bug 3176 2005-05-09 17:24:03 +00:00
moodler 7cbe6afeaa Cookies are not used with guests 2005-05-07 03:10:48 +00:00
stronk7 a8936222b1 Added some comments to remember why they are there... ;-) 2005-05-04 23:14:09 +00:00
stronk7 4e8f2e6ba3 Changed call from preg_replace() to preg_replace_callback() to avoid
some double backslashes present yet. This method doesn't addslashes()
automatically like the old one (so kses_stripslashes() is not needed).

All we have to to is to stripslashes() before calling kses and addslashes()
after it. Only in clean_param(), because params arrive always slashed
to Moodle. This seems to be the correct approach documented in:
http://sourceforge.net/project/shownotes.php?group_id=81853&release_id=302996
2005-05-04 23:09:43 +00:00
moodler 0549198cf0 A fix for kses problems with quotes ... 2005-05-04 18:25:35 +00:00
moodler f64c1ef666 Fix log entry for failed logins. Bug 3076. (SE) 2005-05-04 07:06:24 +00:00
defacer 28c66824e7 Fixing two bugs:
1. When user was using "Server's local time", and the server was set up to
   use DST, generated timestamps must have been wrong in DST periods (I
   haven't backtracked to test this, but the code reads this way).

2. On Eloy's Mac (let's not generalize without data), passing is_dst = 0 to
   gmmktime caused it to return WRONG results!

   The PHP docs clearly state that in_dst does NOT affect the return value,
   which is true for me but in Eloy's case it was a lie. Obviously PHP bug here.

Also, moved the if($applydst) check into the else branch because it would do
nothing at all if (abs($timezone) > 13) in any case.


I hope Eloy keeps finding more bugs because he promised me a beer for this fix ;-)
2005-05-01 16:50:35 +00:00
defacer 0c24431590 Fix for bug 3045:
Now usertimezone() gives a correct human-readable string in all cases.
2005-04-27 03:42:07 +00:00
moodler 0b78f2b1bd By default editing teachers should see all groups even if they are in a group 2005-04-26 08:00:56 +00:00
moodler efca05b447 Added a double-check that should stop the locale-switching that's been happening 2005-04-23 15:16:43 +00:00
moodler 29e91ef724 Embedding the session checking a little better 2005-04-23 15:02:00 +00:00
martinlanghoff d6ead3a251 Polish and fixes for language cache -- addresses bug 2891 2005-04-20 07:29:28 +00:00
defacer 273a80d7be Fixing bug 2935: HTML typo. 2005-04-19 20:45:15 +00:00
thepurpleblob d30bd73457 delDirContents function added - blasts a complete directory structure. 2005-04-19 15:11:44 +00:00
moodler 7c12949d10 Rationalised get_user_info_from_db() and sundry other small bits into
a single function called: get_complete_user_data()

This is to help shibboleth but will also help when this function
needs to be extended in future.
2005-04-17 12:08:46 +00:00
moodler 2a0f66b4f2 Fix bug in performance_info on IIS http://moodle.org/mod/forum/discuss.php?d=22013 2005-04-16 17:02:05 +00:00
moodler d6bf473ec2 Added file_get_contents for PHP before 4.3.0 2005-04-16 12:22:24 +00:00
moodler c70fa20146 New function shorten_text to truncate text neatly 2005-04-14 17:03:11 +00:00
defacer 4f2dbde9f8 Fix for bug 2916, silly silly named constant mistake.
Since we 're at it, fixed another bug: automatic recalculation of DST table
without having to logout if the user changes his timezone now works correctly.
2005-04-14 12:20:09 +00:00
moodler 4febb58f71 Slightly more correct version ;-) 2005-04-14 02:13:47 +00:00
moodler 1596edff55 Added general robustness to require_course_login 2005-04-13 06:59:13 +00:00
moodler e84a246a55 FIxed a problem I wasn't seeing because I was in debug mode.
get_record_sql now has a second parameter that specifies when
we are expecting to take one record from many (to help with debugging)
2005-04-11 12:07:49 +00:00
moodler 00b60650f2 Added a span around performanceinfo script name 2005-04-11 07:36:52 +00:00
martinlanghoff 6e6053bd18 Merged from MOODLE_14_STABLE. Added option to cache langlist in dataroot/cache/languages. If enabled saves around 10MB of memory and 40 includes (some really large). In HEAD we also get a nice option select in admin->variables. 2005-04-11 06:41:08 +00:00
moodler 8edffd15f6 LIMIT timezones returned to the latest one 2005-04-10 18:27:15 +00:00
moodler 5404e914fb Going back to the slower but always-accurate timezone list method 2005-04-10 17:51:48 +00:00
moodler 1bb1333b0b Centralised timezone list to a function 2005-04-10 17:35:17 +00:00
defacer dddb014acf 1. make_timestamp: It's easy to be a fool, but to do it like me requires innate talent.
2. usertime: I think that the way Moodle is written, if this compensates for DST lots
   of things are going to break. I found a few myself and decided to revert the behavior
   until such time as a proper code review can be made.
2005-04-10 09:41:46 +00:00
defacer c9e55a2583 LIMIT 1 was already being introduced by get_record_sql, and GMT offsets weren't working due to the bad query. 2005-04-10 09:31:21 +00:00
defacer 989585e933 Major step forward once more: calculate_user_dst_table() now always sees the
user's effective timezone correctly using get_user_timezone(). It also remembers
which timezone was in effect when it cached its calculations, so if the user's
effective timezone changes for any reason the table is automatically re-computed.

******
NOTICE
******

From this point onward, DST support should be working again, and there are no more
visible hurdles in the way. This means it should STAY working correctly until 1.5.
2005-04-09 10:12:30 +00:00
defacer 6dc8dddc62 Removed another unnecessary get_user_timezone_offset() call. 2005-04-09 09:50:08 +00:00
defacer 13e5588de8 Removed unneeded get_user_timezone_offset() call; usertime() does it anyway. 2005-04-09 09:47:01 +00:00
moodler 7b9e355e43 Fixed an error in the timezones 2005-04-09 08:44:49 +00:00
defacer e8904995f0 Introduce the "new" get_user_timezone, and implement get_user_timezone_offset in terms of it. 2005-04-08 20:32:40 +00:00
moodler 494b9296e9 Renamed get_user_timezone to get_user_timezone_offset, because Jon has
plans for that function name
2005-04-08 07:42:50 +00:00
defacer 2665e47afc usertime() now compensates for DST. 2005-04-08 05:39:53 +00:00
defacer 43b59916f6 get_user_timezone() should now be working for users with new-style timezone settings.
get_timezone_record() function added to cache some db queries.

I haven't been able to test this yet, will do later.
2005-04-08 05:28:39 +00:00
defacer b86e6ba918 is_executable() doesn't exist in PHP/Win < 5.0.0 2005-04-08 05:01:09 +00:00
martinlanghoff 853df85e56 Performance/footprint profiling patch complete -- is enabled by CFG->default>7 or by a few defines in your config.php. 2005-04-07 00:11:28 +00:00
martinlanghoff c2fd9e955a Improved performance info reporting and logging. Needs some work on the configuration front still. 2005-04-06 07:34:05 +00:00
moodler ddd7a47ac1 Removed a notice from isteacheredit 2005-04-06 06:26:38 +00:00
moodler dcc17b63b1 More improvements to isteacher() logic (and isadmin now uses $USER->admin too) 2005-04-06 06:20:59 +00:00
moodler 5e04ee0c4f More efficient logic for isteacher() 2005-04-06 05:53:24 +00:00
moodler b8cea9b2de Added some performance monitoring functions into the core 2005-04-01 10:00:18 +00:00
moodler fcaff7ffcd Updated formatting in getremoteaddr, and made add_to_log use it 2005-04-01 07:40:07 +00:00