Index: openacs-4/packages/dotlrn/www/spam-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/spam-oracle.xql,v
diff -u -r1.2.6.4 -r1.2.6.5
--- openacs-4/packages/dotlrn/www/spam-oracle.xql 14 Sep 2004 15:34:27 -0000 1.2.6.4
+++ openacs-4/packages/dotlrn/www/spam-oracle.xql 19 Aug 2005 11:02:15 -0000 1.2.6.5
@@ -6,48 +6,68 @@
select '$from' as from_addr,
- '[db_quote $sender_first_names]' as sender_first_names,
- '[db_quote $sender_last_name]' as sender_last_name,
+ '$sender_first_names' as sender_first_names,
+ '$sender_last_name' as sender_last_name,
parties.email,
- decode(acs_objects.object_type,
- 'user',
+ CASE
+ WHEN
+ acs_objects.object_type = 'user'
+ THEN
(select first_names
from persons
- where person_id = parties.party_id),
- 'group',
+ where person_id = parties.party_id)
+ WHEN
+ acs_objects.object_type = 'group'
+ THEN
(select group_name
from groups
- where group_id = parties.party_id),
- 'rel_segment',
+ where group_id = parties.party_id)
+ WHEN
+ acs_objects.object_type = 'rel_segment'
+ THEN
(select segment_name
from rel_segments
- where segment_id = parties.party_id),
- '') as first_names,
- decode(acs_objects.object_type,
- 'user',
+ where segment_id = parties.party_id)
+ ELSE
+ ''
+ END as first_names,
+ CASE
+ WHEN
+ acs_objects.object_type = 'user'
+ THEN
(select last_name
from persons
- where person_id = parties.party_id),
- '') as last_name,
+ where person_id = parties.party_id)
+ ELSE
+ ''
+ END as last_name,
'$safe_community_name' as community_name,
'$community_url' as community_url
from acs_rels,
parties,
acs_objects
where (acs_rels.object_id_one = $community_id
and acs_rels.object_id_two = parties.party_id
- and (acs_rels.rel_type in ($rel_types_str)
- or acs_rels.object_id_two in ($recipients_str))
- and parties.party_id = acs_objects.object_id
+ and parties.party_id = acs_objects.object_id
and parties.party_id in (select acs_rels.object_id_two
from acs_rels, membership_rels
- where acs_rels.object_id_one =
- acs.magic_object_id('registered_users')
- and acs_rels.rel_id =
- membership_rels.rel_id
- and membership_rels.member_state
- = 'approved'))
+ where acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'approved' ))
+ $who_will_receive_this_clause
+
+
+ and parties.party_id in ($recipients_str)
+
+
+
+
+
+ and acs_rels.rel_type in ($rel_types_str)
+
+
+