Commit Graph

6638 Commits

Author SHA1 Message Date
Evan Prodromou
48535515e0 require mail for sms, not omb
darcs-hash:20080830070309-84dde-14a3492cb8132f6a8008d482caa753df2c79ff46.gz
2008-08-30 03:03:09 -04:00
Evan Prodromou
136f9a4016 don't clear old claims
darcs-hash:20080830070135-84dde-dc0cfc8e23c31c33617aa167f7c97d443b10539d.gz
2008-08-30 03:01:35 -04:00
Evan Prodromou
ac85a4b0fa less sleeping, slightly
darcs-hash:20080830064431-84dde-42629109de11f65da9d876aee168abdf7c4ced3d.gz
2008-08-30 02:44:31 -04:00
Evan Prodromou
755f192df0 correctly use attrs array rather than nonexistent attunction
darcs-hash:20080830062744-84dde-98c6419f4b66a570e9ef9de34d8d07e40aa1177d.gz
2008-08-30 02:27:44 -04:00
Evan Prodromou
c3adc854da log fetch
darcs-hash:20080830062246-84dde-823ceafa203aa034c52e0df55c21f241e35363fa.gz
2008-08-30 02:22:46 -04:00
Evan Prodromou
f76b4c8d72 debug xml input
darcs-hash:20080830060732-84dde-54d5d4c4a8747215bd5b224e4216f9fc1eb349a6.gz
2008-08-30 02:07:32 -04:00
Evan Prodromou
c3f4789735 better debugging output for forwarded messages
darcs-hash:20080830055938-84dde-d0c6b241502b674f974f75f6c22b13f9dca8134c.gz
2008-08-30 01:59:38 -04:00
Evan Prodromou
4e3b69014e get address from addresses
darcs-hash:20080830055640-84dde-2cd151d876f6586d827ecfc38e1b72d1cfb4950d.gz
2008-08-30 01:56:40 -04:00
Evan Prodromou
047db53726 better logging in ombqueuehandler
darcs-hash:20080830055416-84dde-fad0303b1d4b7265e7f01faf90e088e409c7d8b3.gz
2008-08-30 01:54:16 -04:00
Evan Prodromou
ca1f639fd6 log transport when claiming a notice
darcs-hash:20080830054933-84dde-58cc7aa6947612cda9987d532d85d9dd81e32410.gz
2008-08-30 01:49:33 -04:00
Evan Prodromou
439c14d986 use common log in error handler rather than echo
darcs-hash:20080830053052-84dde-279d1c52e9b8696079ba686009ce2d71725a690e.gz
2008-08-30 01:30:52 -04:00
Evan Prodromou
a586bbed24 typo preventing detection of addresses
darcs-hash:20080830052810-84dde-e90c46cc8d9a48a91098efd123c45108ce2903b6.gz
2008-08-30 01:28:10 -04:00
Evan Prodromou
706dc53d40 strtolower jids for comparison
darcs-hash:20080830052143-84dde-81ba3f1e687605d23e9bdc2c3672ac7ae36f9b60.gz
2008-08-30 01:21:43 -04:00
Evan Prodromou
4cdd90283b forward messages from queuehandler to listener
The queuehandler sends messages to the user. If the user replies, the
messages are typically sent directly to the queuehandler (including
resource), not the default bot JID.

We add a little code for the xmppqueuehandler to periodically service
its queue of received messages. Received messages are forwarded to the
listener to deal with. We use XEP 33, 'addresses', to note the
original sender.

The xmppdaemon checks to see if the 'from' on a message is the daemon
address. If so, it looks for a XEP 33 'addresses' stanza, with an
'ofrom' address, which shows who it was originally is from.

This should let us send from one resource ID and still process
incoming messages in a different connection.

darcs-hash:20080830040717-84dde-59c75bfb107a1dd5fd531106751b4544bfd15656.gz
2008-08-30 00:07:17 -04:00
Evan Prodromou
9907a2101d add 'raw' to payload to allow getting to the raw xml
darcs-hash:20080830000314-84dde-c83d970dbaf046fa37b4af13a23795abcc20e33b.gz
2008-08-29 20:03:14 -04:00
Evan Prodromou
9ad8f2766c strip script ending from end of xmppdaemon
darcs-hash:20080829202613-84dde-58f58a315ea0093c5b029b01492fd71d2fed014c.gz
2008-08-29 16:26:13 -04:00
Evan Prodromou
b17bb9861c lost $sent_to in jabber_public_notice
darcs-hash:20080829200859-84dde-d1c4c5897096a06dec8be14e81499d70a79c78d2.gz
2008-08-29 16:08:59 -04:00
Evan Prodromou
f5fe013657 many jabber queue management changes
Added a method to QueueManager to let subclasses do stuff when idle.
Needed so that XMPP queue manager can service its message queue.

Cleaned up jabber_broadcast_message quite a bit. Use custom joins
instead of loop-and-query, should fix some problems with users who are
getting messages even after turning off notification. Only build $msg
and $entry once, and use the XMPPHP function for messages with a
payload, rather than rolling our own.

darcs-hash:20080829200352-84dde-427e4ca8c81d4222a36f78e7c580b611ff0bf765.gz
2008-08-29 16:03:52 -04:00
Evan Prodromou
a0f726fb6c a little more robust confirm handler
darcs-hash:20080829182349-84dde-a6d4056d6fa2ecb4c5ed07f3a3a40576315ec4d9.gz
2008-08-29 14:23:49 -04:00
Evan Prodromou
c9782862d4 fix name of instantiated class
darcs-hash:20080829182112-84dde-c29ccd959e19e18cc2ceac1ba701f351f914c26b.gz
2008-08-29 14:21:12 -04:00
Evan Prodromou
c4d6789275 split public stream to its own queue handler
Add another queue handler for the public stream. Should further
parallelize the work of sending out messages.

darcs-hash:20080829181702-84dde-594505aa73d2380b13bd98917b70b02bac597d12.gz
2008-08-29 14:17:02 -04:00
Evan Prodromou
f652418863 harmonize csrf and queues
darcs-hash:20080829174012-84dde-4859ce0a34a50080f8376fa3278c3aa3e3a3046d.gz
2008-08-29 13:40:12 -04:00
Evan Prodromou
00c4fb2157 add a script to stop daemons, too
darcs-hash:20080828135011-84dde-40b44db4416cf83b8929bb0ed77741ed0f177f14.gz
2008-08-28 09:50:11 -04:00
Evan Prodromou
c9cf958d63 add a bash script to start all the daemons
darcs-hash:20080828134856-84dde-271585ac7d76f8f0d615e9f641dfbc25c61bfb28.gz
2008-08-28 09:48:56 -04:00
Evan Prodromou
dbf28603fa return results of broadcasting by sms
darcs-hash:20080828012635-84dde-166baf7800333ee79a6bad2e5427ac7623c7614f.gz
2008-08-27 21:26:35 -04:00
Evan Prodromou
241881238c misprint of omb as oms
darcs-hash:20080828012619-84dde-f7e993f345220d3642743e9f2567d7f8e6e4b6ce.gz
2008-08-27 21:26:19 -04:00
Evan Prodromou
cde3bc585f return correct values for success in handling messages
darcs-hash:20080828011002-84dde-8099da64841ab137e915249025857f34084c0f34.gz
2008-08-27 21:10:02 -04:00
Evan Prodromou
6b1f391306 $this->log to common_log in Queue_item
darcs-hash:20080828004503-84dde-c406172d750d0a5452d5cc62ecd7b27db381c575.gz
2008-08-27 20:45:03 -04:00
Evan Prodromou
27fff6ff04 XmppQueueHandler extends QueueHandler too
darcs-hash:20080828004224-84dde-01ba0a7b9105629b1eb8a28a1a9702912e7e9da6.gz
2008-08-27 20:42:24 -04:00
Evan Prodromou
972e03b158 extend QueueHandler
darcs-hash:20080828003829-84dde-dc44674785f853ebf37861e5e91fb0e0366258e9.gz
2008-08-27 20:38:29 -04:00
Evan Prodromou
08d5107cf1 correct return values from start() in queue handlers
darcs-hash:20080828003013-84dde-7c8323ef348960f58590e872b2c4ab37107ba60a.gz
2008-08-27 20:30:13 -04:00
Evan Prodromou
9cdb33ac0e don't clear claims immediately
darcs-hash:20080828002610-84dde-d9cb46cb08ac50b8efbdf5683baeb2de168fc4b1.gz
2008-08-27 20:26:10 -04:00
Evan Prodromou
2be3be1c29 correct presence in jabber function
darcs-hash:20080828001936-84dde-e4ec2fef30c49d1254d5358624a4391930811832.gz
2008-08-27 20:19:36 -04:00
Evan Prodromou
7887147603 change return in queue function
darcs-hash:20080828001414-d018c-fa900f60f0af20c01e8b83a74834ddf46829f4b2.gz
2008-08-27 20:14:14 -04:00
Evan Prodromou
cd5dc3246e got two lines reversed
darcs-hash:20080827211940-84dde-d5b404023a2fb6b74b6255dd91910c9ec7df3cc6.gz
2008-08-27 17:19:40 -04:00
Evan Prodromou
35ed6f473c change queue_item to use a compound primary key
Breaking up to use multiple queue handlers means we need multiple
queue items for the same notice. So, change the queue_item table to
have a compound pkey, (notice_id,transport).

darcs-hash:20080827211239-84dde-db118799bfd43be62fb02380829c64813c9334f8.gz
2008-08-27 17:12:39 -04:00
Evan Prodromou
f59ead93ee remove unimplemented methods from XmppDaemon
darcs-hash:20080827210429-84dde-90c22dbee16f74f53464dcd538a6dbcf49db4f28.gz
2008-08-27 17:04:29 -04:00
Evan Prodromou
b9f0ea6f0e break up monolithic xmppdaemon into multiple queue handlers
Eventually, the poor xmppdaemon has become overloaded with extra
tasks. So, I've broken it up. Now, we have 5 background scripts, and
more coming:

* xmppdaemon.php - handles incoming XMPP messages only.
* xmppqueuehandler.php - sends notices from the queue out through XMPP.
* smsqueuehandler.php - sends notices from the queue out over SMS
* ombqueuehandler.php - sends notices from the queue out over OMB
* xmppconfirmhandler.php - sends confirmation requests out over XMPP.

This is in addition to maildaemon.php, which takes incoming messages.

None of these are "true" daemons -- they don't daemonize themselves
automatically. Use nohup or another tool to background them. monit can
also be useful to keep them running.

At some point, these might become fork()'ing daemons, able to handle
more than one notice at a time. For now, I'm just running multiple
instances, hoping they don't interfere.

darcs-hash:20080827205407-84dde-97884a12f5f4e54c93bc785bd280683d1ee7e749.gz
2008-08-27 16:54:07 -04:00
Evan Prodromou
adeb19f1f7 clean up username entered at login
darcs-hash:20080829225258-84dde-6fee5f0beea62f023c13436b8d7044241bc0d01a.gz
2008-08-29 18:52:58 -04:00
Zach Copley
9fb08ec45e CSRF protection in remotesubscribe
darcs-hash:20080829054038-7b5ce-d0503a8eb7f89a9d2de4aadd4550f4342b943b09.gz
2008-08-29 01:40:38 -04:00
Zach Copley
a034e13bf0 CSRF protection in emailsettings
darcs-hash:20080829053337-7b5ce-6d94638c57d185e5d44e02ad458593a3f4de36d9.gz
2008-08-29 01:33:37 -04:00
Evan Prodromou
2dc50d7e37 CSRF protection in user registration
darcs-hash:20080829054017-84dde-c9268e5c815934dcbca2451dd6c9016f2ac4a03a.gz
2008-08-29 01:40:17 -04:00
Zach Copley
47726844a0 CSRF protection in recoverpassword
darcs-hash:20080829052824-7b5ce-39a8fd299b7a85793ad7a19fe00c93813ca882b6.gz
2008-08-29 01:28:24 -04:00
Evan Prodromou
98e941753b session token in userauthorization form
darcs-hash:20080829052847-84dde-a64918a75f8300ec8fb230202881691066147652.gz
2008-08-29 01:28:47 -04:00
Evan Prodromou
63438008e0 csrf protection in userauthorization
darcs-hash:20080829052732-84dde-0ebb7e32236b480cc3aa2eb7a4bb2b41ff6177d6.gz
2008-08-29 01:27:32 -04:00
Evan Prodromou
9b741c4f9a better client error on CSRF problem with subscribe/unsubscribe
darcs-hash:20080829051628-84dde-2a339a35c422afb9ec04f757771764ed43b2c28b.gz
2008-08-29 01:16:28 -04:00
Evan Prodromou
4272da4e9e CSRF protection for subscription/unsubscription
darcs-hash:20080829051104-84dde-9bd23c28c2c8a720046060a33ff3e5f246c47116.gz
2008-08-29 01:11:04 -04:00
Zach Copley
2e239e3fbb CSRF protection in imsettings.php
darcs-hash:20080829035707-7b5ce-69a9ff98390ff8b9671ede948d78fdb37371aac6.gz
2008-08-28 23:57:07 -04:00
Zach Copley
6be7cbc5cd CSRF protection in smssettings.php
darcs-hash:20080829035118-7b5ce-57613e88b29617ea422c7f7003e81ef885e3debb.gz
2008-08-28 23:51:18 -04:00
Evan Prodromou
6afb7f576e add csrf protection to profile settings
darcs-hash:20080829043909-84dde-c70a633c93ab89560bc300817bda66eebf6176cf.gz
2008-08-29 00:39:09 -04:00