147 Commits

Author SHA1 Message Date
toyomoyo
f9a59efa64 adding some capabilities 2006-08-29 08:43:59 +00:00
moodler
0468976c9a SWEEPING CLEANUP
The API was changed slightly so that has_capability now takes the
whole $context object (we almost always have it anyway)

The $kill thing was removed.   If you want to assert a capability
then use:

    require_capability('capname', $context);

with optional variables to modify the error message

Misc bugs here and there also removed and code tidied
2006-08-14 05:55:40 +00:00
moodler
dabfd0ed85 Removed tabs 2006-08-09 13:45:49 +00:00
moodler
bbbf2d4015 ROLES AND PERMISSIONS - FIRST CHECK-IN
=======================================

WARNING:  DEV IS CURRENTLY VERY UNSTABLE.

This is a mega-checkin of the new Roles system.   A lot of changes have
been made in core and modules.

Currently there are a lot of rough edges and known problems.  We are
working hard on these .. .the reason for getting this into HEAD at this
stage is enable us to move faster (our branch was diverging from HEAD
too much).

Please keep an eye on http://docs.moodle.org/en/Roles for current status
and information for developers on how to use the new Roles system.
2006-08-08 05:13:06 +00:00
martinlanghoff
07b76bad6a chat: Prevent user from submitting a 2nd message before his 1st is received.
Some users reported that mod/chat was silently dropping some messages. The
user's browser may not be able to keep up with the rate at which he submits
chat messages. This update keeps things sane.

Merged from MOODLE_16_STABLE

Author: Donal McMullan <donal@catalyst.net.nz>
2006-07-12 02:29:12 +00:00
martinlanghoff
930413b133 mod/chat: Normal method - introducing "Stream" updates.
This is an alternative version of jsupdate.php that acts
as a long-running daemon. It will feed/stall/feed JS updates
to the client. From the module configuration select "Stream"
updates.

The client connection is not forever though. Once we reach
CHAT_MAX_CLIENT_UPDATES (currently 1000), it will force
the client to re-fetch it.

This buys us all the benefits that chatd has, minus the setup,
as we are using apache to do the daemon handling.

Chat still defaults to the normal update method, which is now
optimised to take advantage of keepalives -- so this change is
safe. The instructions in the config page also indicate that this
mode may not be well supported everywhere. It hasn't been
tested on IIS for starters.

In terms of relative cost -- if each hit on jsupdate.php incurs
on ~20 db queries and delivers one update to the client, each hit
on jsupdate takes ~20 queries, and then roughly 2~3 queries to
serve each of the next 1000 updates. On busy sites, the difference
is huge.

There is still room for enhancements in both keepalive and stream
update methods. I am pretty sure we can trim DB queries more.
2006-04-19 02:20:48 +00:00
martinlanghoff
a6d1886fa5 mod/chat: Normal method -- collate 2 SELECTs into one
We really don't need to ask about the user table _twice_ here. Just ask for the
right fields, and done.
2006-04-17 21:06:28 +00:00
martinlanghoff
46c859760c mod/chat: Normal method -- faster, lighter DB updates
Use set_field() keyed on PK instead of update_record() or set_field()
keyed on non-PKs.
2006-04-17 21:05:51 +00:00
martinlanghoff
c5e817f02c mod/chat - Normal method - users pane only uses keepalive when refreshing fast
To avoid wasting server resources, user's pane now only uses keepalive
when the refresh is lower than apache's timeout.
2006-04-17 21:05:17 +00:00
martinlanghoff
6169ea259a mod/chat - Normal method now supports HTTP Keep-Alive - users pane
User's pane now also uses keepalives -- if the refresh freq is below
the disconnect timeout, then it is a win. Otherwise it wastes memory
at the server end.
2006-04-17 21:04:47 +00:00
martinlanghoff
dfd1d9e272 mod/chat - Normal method now support HTTP Keep-Alive
By using output buffering, we now support HTTP Keep-Alive, which means
that each client gets tightly bound to a single apache child - this means
that we get

 + lower resource usage on the webserver
 + _much_ lower resource usage on webserver and dbserver if pconnects are used
 + a good case for further caching (memcache/mmcache)

Using ab via localhost or fast LAN using keepalives is actually slower from the
client perspective -- still lighter on the server. Via slower links (DSL/modem)
the responses are faster.
2006-04-17 21:04:19 +00:00
martinlanghoff
4d5525c650 mod/chat: make http-chat more database friendly and change msg insertion to use POST
+ we are now more conservative in the fields it asks from the db
+ also more conservative with upates to chat_users
+ messages are now added via POST requests instead of GET
2006-04-17 21:03:44 +00:00
moodler
16ad40e145 Fix for chat character sets bug 5010 2006-04-16 16:01:40 +00:00
skodak
107e7612b5 short php tags once more 2006-03-07 21:46:34 +00:00
stronk7
b49f9e8932 And chat is using current_charset() too.
Merged from MOODLE_16_UTF8. Abandoning the branch.
2006-01-05 16:31:29 +00:00
stronk7
aa5c32fda7 Extended theme support to the chat window. Bug 3376.
(http://moodle.org/bugs/bug.php?op=show&bugid=3376)

Merged from MOODLE_15_STABLE
2005-09-10 22:57:21 +00:00
stronk7
200371e9f7 Now chat->name works under filterall. 2005-03-27 11:36:54 +00:00
moodler
3b9f38bc5d FIxed popup window for users in chat window 2005-02-25 12:40:03 +00:00
moodler
b9795750e5 Er, last fix was in wrong frame. :-) 2005-02-25 12:35:20 +00:00
moodler
18212a7afe Try to make all links "pop out" of the frame 2005-02-25 12:28:02 +00:00
gustav_delius
ec81373f50 In order to ensure that when a teacher hides a resource or an activity that students really can't get at it, even if they know the direct links to its pages, I have given an optional third argument $cm to the functions require_login() and require_course_login(). Pages showing information about a particular course module now pass the course module object in this third argument. The login functions will then test if either the course module is visible or the user is a teacher. If neither is the case then the user is redirected to the course homepage after being shown a message "Sorry, this activity is currently hidden".
(While I was at it I also turned the autologinguests off for most module pages, except on the index.php pages and the view.php pages for those modules that allow guests)
2005-02-16 10:40:48 +00:00
skodak
68eb9f32e4 added style sheet to message panel 2005-02-13 16:30:16 +00:00
skodak
2debdf0476 FF issue seems to be solved by explicit call to document.close() 2005-02-10 19:25:42 +00:00
skodak
a32c7772c6 fixed deleting of old users when using chatd, other minor fixes, reverting of changes in chatmsg - found some weird problems in FF 2005-02-10 19:14:53 +00:00
skodak
475bd5cb71 fixed problems with forced course language 2005-02-08 21:30:47 +00:00
skodak
a776c371e7 fixed typos in chat_force_language(), added encoding to message page, minor cleanup 2005-02-08 21:23:19 +00:00
skodak
3dfd307fe0 maybe fixed double posts, fixed javascript errors, solved problems with reloading 2005-02-07 20:33:44 +00:00
skodak
516121bd0d radical chat clean up, see forum for details 2005-02-03 20:39:27 +00:00
gustav_delius
8f0cd6ef0f Resolved problems with previous replacement of
& to &amp; and fixed redirect() to entity encode the
inut where needed.
Julian Sedding
2004-09-21 11:41:58 +00:00
gustav_delius
839f2456bb XHTML compliance
- fixed (hopefully) all <img> tags
- global replace on <br> to <br />
- &amp; in URLs
- got the forum module XHTML compliant
Julian Sedding
2004-09-16 17:13:57 +00:00
gustav_delius
b4510d5333 closed some input tags 2004-09-12 22:23:51 +00:00
gustav_delius
1c61c8d6bc fixed capitalization and quoting of attribute values 2004-09-12 15:06:29 +00:00
defacer
43c9195b84 Fix for bug 1759:
One notice in debug mode removed.
2004-08-22 17:03:33 +00:00
moodler
fdff1f63a3 Fixes when displaying lists of users in group mode 2004-04-08 15:12:35 +00:00
moodler
6a5b5a20f4 Ack! Stupid typo fixed - thanks, Bobo! 2004-04-08 14:28:38 +00:00
moodler
bded7f70b5 Get coursemodule so the groups checking works correctly 2004-03-12 13:29:33 +00:00
moodler
84a2fdd706 Preliminary support for groups in Chat.
It's not well tested yet - I'm hoping to do some testing on moodle.org
with some real people and get this refined enough for the Beta release
later today.
2004-02-24 06:35:57 +00:00
moodler
62a575d157 Chat room text is now filtered 2004-02-16 17:39:05 +00:00
moodler
315915628d Keep guests out of chat 2003-11-03 10:22:24 +00:00
moodler
b5012f3eb5 COnfiguration variables can now be edited via GUI 2003-08-23 14:03:14 +00:00
moodler
eafd2784b4 Added a simple help popup for chat 2003-08-11 15:06:57 +00:00
moodler
d2c538f1fb No need for body colour 2003-07-25 08:18:27 +00:00
moodler
fcd3a1ee42 New feature - chat scheduling. Can now set a time for the next chat,
as well as rotating weekly or daily period.

Also some small fixes.
2003-07-25 06:47:06 +00:00
moodler
7d494f1c2e Need to escape slashes here 2003-07-10 06:38:02 +00:00
moodler
7d79236935 Simple beeping is now added ... users can now beep each other
and also beep everyone using "beep all"

There are no controls as yet to disable beeping on a per-user
basis but this would come next
2003-07-09 12:53:26 +00:00
moodler
f7e648da70 Some minor improvements 2003-07-07 09:45:08 +00:00
moodler
1515a89e2d Very early version of new chat module, made by Martin using ARSC as
an inspiration.

Works OK already on most newish browsers .. see mod/chat/README.txt for details.
2003-07-07 06:44:16 +00:00