Index: openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql 26 Apr 2003 01:03:28 -0000 1.4.2.1 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql 3 May 2003 23:51:16 -0000 1.4.2.2 @@ -2,32 +2,6 @@ oracle8.1.6 - - - - begin - :1 := content_revision.new(title => :title, - item_id => :item_id, - v_content => null); - end; - - - - - - - - update - cr_revisions - set - content = empty_blob() - where - revision_id = :revision_id - returning content into :1 - - - - select r.mime_type, i.storage_type, i.storage_area_key, r.revision_id @@ -146,16 +120,6 @@ - - - - update cr_revisions - set filename = :filename, - content_length = :tmp_size - where revision_id = :revision_id - - - Index: openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql,v diff -u -r1.4 -r1.4.4.1 --- openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 15 Nov 2001 01:47:13 -0000 1.4 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 3 May 2003 23:51:16 -0000 1.4.4.1 @@ -2,33 +2,6 @@ postgresql7.1 - - - - select content_revision__new(:title, - null, - now(), - 'text/plain', - ' ', - :item_id - ) - - - - - - - - update - cr_revisions - set - content = '[cr_create_content_file $item_id $revision_id $path]' - where - revision_id = :revision_id - - - - select i.storage_type, i.storage_area_key, r.mime_type, r.revision_id @@ -151,15 +124,6 @@ ); - - - - update cr_revisions - set content = :filename, - content_length = :tmp_size - where revision_id = :revision_id - - Index: openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 6 Feb 2003 12:55:23 -0000 1.7.2.2 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 3 May 2003 23:51:16 -0000 1.7.2.3 @@ -1,24 +1,5 @@ # upload an item revision from a file -ad_proc -public cr_revision_upload { title item_id path } { - - set revision_id [db_exec_plsql get_revision_id "begin - :1 := content_revision.new(title => :title, - item_id => :item_id, - v_content => null); - end;"] - - db_dml dml_revision_from_file "update - cr_revisions - set - content = empty_blob() - where - revision_id = :revision_id - returning content into :1" -blob_files [list $path] - - return $revision_id -} - ad_proc -public cr_write_content { -item_id -revision_id Index: openacs-4/packages/acs-content-repository/tcl/revision-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/revision-procs.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/acs-content-repository/tcl/revision-procs.xql 15 Nov 2001 01:47:13 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs.xql 3 May 2003 23:51:16 -0000 1.2.4.1 @@ -1,33 +1,6 @@ - - - - select content_revision__new(:title, - null, - now(), - 'text/plain', - ' ', - :item_id - ) - - - - - - - - update - cr_revisions - set - content = '[cr_create_content_file $item_id $revision_id $path]' - where - revision_id = :revision_id - - - - select i.storage_type, i.storage_area_key, r.mime_type, i.item_id @@ -53,6 +26,16 @@ + + + update cr_revisions + set content = :filename, + mime_type = :mime_type, + content_length = :tmp_size + where revision_id = :revision_id + + + select content_type Index: openacs-4/packages/acs-kernel/acs-kernel.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v diff -u -r1.17.2.8 -r1.17.2.9 --- openacs-4/packages/acs-kernel/acs-kernel.info 21 Apr 2003 01:00:55 -0000 1.17.2.8 +++ openacs-4/packages/acs-kernel/acs-kernel.info 3 May 2003 23:51:31 -0000 1.17.2.9 @@ -13,7 +13,7 @@ 2002-10-27 OpenACS - + Index: openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql,v diff -u -r1.3.2.2 -r1.3.2.3 --- openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 15 Feb 2003 20:56:27 -0000 1.3.2.2 +++ openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 3 May 2003 23:51:44 -0000 1.3.2.3 @@ -161,26 +161,28 @@ create or replace view registered_users as select p.email, p.url, pe.first_names, pe.last_name, u.*, mr.member_state - from parties p, persons pe, users u, group_member_map m, membership_rels mr + from parties p, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo where party_id = person_id and person_id = user_id and u.user_id = m.member_id and m.rel_id = mr.rel_id - and m.group_id = (select acs.magic_object_id('registered_users') from dual) + and amo.name = 'registered_users' + and m.group_id = amo.object_id and mr.member_state = 'approved' and u.email_verified_p = 't'; create or replace view cc_users as select o.*, pa.*, pe.*, u.*, mr.member_state, mr.rel_id -from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr +from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo where o.object_id = pa.party_id -and pa.party_id = pe.person_id -and pe.person_id = u.user_id -and u.user_id = m.member_id -and m.group_id = acs.magic_object_id('registered_users') -and m.rel_id = mr.rel_id -and m.container_id = m.group_id; + and pa.party_id = pe.person_id + and pe.person_id = u.user_id + and u.user_id = m.member_id + and amo.name = 'registered_users' + and m.group_id = amo.object_id + and m.rel_id = mr.rel_id + and m.container_id = m.group_id; ----------------------------------- -- Community Core Initialization -- Index: openacs-4/packages/acs-kernel/sql/oracle/acs-permissions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-permissions-create.sql,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-kernel/sql/oracle/acs-permissions-create.sql 15 Feb 2003 03:23:55 -0000 1.4.2.1 +++ openacs-4/packages/acs-kernel/sql/oracle/acs-permissions-create.sql 3 May 2003 23:51:44 -0000 1.4.2.2 @@ -2,40 +2,22 @@ -- acs-kernel/sql/acs-permissions-create.sql -- -- The ACS core permissioning system. The knowledge level of system --- allows you to define a hierarchichal system of privilages, and --- associate them with low level operations on object types. The +-- allows you to define a hierarchichal system of privilages. The -- operational level allows you to grant to any party a privilege on -- any object. -- -- @author Rafael Schloming (rhs@mit.edu) -- -- @creation-date 2000-08-13 -- --- @cvs-id $Id$ +-- @cvs-id acs-permissions-create.sql,v 1.4.2.1 2003/02/15 03:23:55 donb Exp -- --------------------------------------------- --- KNOWLEDGE LEVEL: PRIVILEGES AND ACTIONS -- +-- KNOWLEDGE LEVEL: PRIVILEGES -- --------------------------------------------- --- suggestion: acs_methods, acs_operations, acs_transactions? --- what about cross-type actions? new-stuff? site-wide search? - ---create table acs_methods ( --- object_type not null constraint acs_methods_object_type_fk --- references acs_object_types (object_type), --- method varchar2(100) not null, --- constraint acs_methods_pk --- primary key (object_type, method) ---); - ---comment on table acs_methods is ' --- Each row in the acs_methods table directly corresponds to a --- transaction on an object. For example an sql statement that updates a --- bboard message would require an entry in this table. ---' - create table acs_privileges ( privilege varchar2(100) not null constraint acs_privileges_pk primary key, @@ -55,20 +37,8 @@ -- create bitmap index acs_priv_hier_child_priv_idx on acs_privilege_hierarchy (child_privilege); create index acs_priv_hier_child_priv_idx on acs_privilege_hierarchy (child_privilege); ---create table acs_privilege_method_rules ( --- privilege not null constraint acs_priv_method_rules_priv_fk --- references acs_privileges (privilege), --- object_type varchar2(100) not null, --- method varchar2(100) not null, --- constraint acs_privilege_method_rules_pk --- primary key (privilege, object_type, method), --- constraint acs_priv_meth_rul_type_meth_fk --- foreign key (object_type, method) references acs_methods ---); - comment on table acs_privileges is ' - The rows in this table correspond to aggregations of specific - methods. Privileges share a global namespace. This is to avoid a + Privileges share a global namespace. This is to avoid a situation where granting the foo privilege on one type of object can have an entirely different meaning than granting the foo privilege on another type of object. @@ -79,32 +49,6 @@ privilege is a superset of the bar privilege. '; ---comment on table acs_privilege_method_rules is ' --- The privilege method map allows us to create rules that specify which --- methods a certain privilege is allowed to invoke in the context of a --- particular object_type. Note that the same privilege can have --- different methods for different object_types. This is because each --- method corresponds to a piece of code, and the code that displays an --- instance of foo will be different than the code that displays an --- instance of bar. If there are no methods defined for a particular --- (privilege, object_type) pair, then that privilege is not relavent to --- that object type, for example there is no way to moderate a user, so --- there would be no additional methods that you could invoke if you --- were granted moderate on a user. ---' - ---create or replace view acs_privilege_method_map ---as select r1.privilege, pmr.object_type, pmr.method --- from acs_privileges r1, acs_privileges r2, acs_privilege_method_rules pmr --- where r2.privilege in (select distinct rh.child_privilege --- from acs_privilege_hierarchy rh --- start with privilege = r1.privilege --- connect by prior child_privilege = privilege --- union --- select r1.privilege --- from dual) --- and r2.privilege = pmr.privilege; - create or replace package acs_privilege as @@ -244,12 +188,6 @@ create or replace view all_object_party_privilege_map as select * from acs_object_party_privilege_map; - ---create or replace view acs_object_party_method_map ---as select opp.object_id, opp.party_id, pm.object_type, pm.method --- from acs_object_party_privilege_map opp, acs_privilege_method_map pm --- where opp.privilege = pm.privilege; - create or replace package acs_permission as Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql,v diff -u -r1.6.4.4 -r1.6.4.5 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 2 Mar 2003 22:33:33 -0000 1.6.4.4 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 3 May 2003 23:52:05 -0000 1.6.4.5 @@ -106,27 +106,30 @@ create view registered_users as select p.email, p.url, pe.first_names, pe.last_name, u.*, mr.member_state - from parties p, persons pe, users u, group_member_map m, membership_rels mr + from parties p, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo where party_id = person_id and person_id = user_id and u.user_id = m.member_id and m.rel_id = mr.rel_id - and m.group_id = acs__magic_object_id('registered_users') + and amo.name = 'registered_users' + and m.group_id = amo.object_id and mr.member_state = 'approved' and u.email_verified_p = 't'; create view cc_users as select o.*, pa.*, pe.*, u.*, mr.member_state, mr.rel_id -from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr +from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo where o.object_id = pa.party_id -and pa.party_id = pe.person_id -and pe.person_id = u.user_id -and u.user_id = m.member_id -and m.group_id = acs__magic_object_id('registered_users') -and m.rel_id = mr.rel_id -and m.container_id = m.group_id; + and pa.party_id = pe.person_id + and pe.person_id = u.user_id + and u.user_id = m.member_id + and amo.name = 'registered_users' + and m.group_id = amo.object_id + and m.rel_id = mr.rel_id + and m.container_id = m.group_id; + ----------------------------------- -- Community Core Initialization -- ----------------------------------- Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql,v diff -u -r1.19.4.2 -r1.19.4.3 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql 11 Mar 2003 02:31:49 -0000 1.19.4.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql 3 May 2003 23:52:05 -0000 1.19.4.3 @@ -2,8 +2,7 @@ -- acs-kernel/sql/acs-permissions-create.sql -- -- The ACS core permissioning system. The knowledge level of system --- allows you to define a hierarchichal system of privilages, and --- associate them with low level operations on object types. The +-- allows you to define a hierarchichal system of privilages. The -- operational level allows you to grant to any party a privilege on -- any object. -- @@ -19,23 +18,6 @@ -- KNOWLEDGE LEVEL: PRIVILEGES AND ACTIONS -- --------------------------------------------- --- suggestion: acs_methods, acs_operations, acs_transactions? --- what about cross-type actions? new-stuff? site-wide search? - ---create table acs_methods ( --- object_type not null constraint acs_methods_object_type_fk --- references acs_object_types (object_type), --- method varchar2(100) not null, --- constraint acs_methods_pk --- primary key (object_type, method) ---); - ---comment on table acs_methods is ' --- Each row in the acs_methods table directly corresponds to a --- transaction on an object. For example an sql statement that updates a --- bboard message would require an entry in this table. ---' - create table acs_privileges ( privilege varchar(100) not null constraint acs_privileges_pk primary key, @@ -201,6 +183,20 @@ on acs_privilege_hierarchy for each row execute procedure acs_priv_hier_ins_del_tr (); +create or replace function acs_priv_del_tr () returns opaque as ' +begin + + delete from acs_privilege_descendant_map + where privilege = old.privilege; + + return old; + +end;' language 'plpgsql'; + +create trigger acs_priv_del_tr before delete +on acs_privileges for each row +execute procedure acs_priv_del_tr (); + create function priv_recurse_subtree(varbit, varchar) returns integer as ' declare @@ -256,20 +252,8 @@ end;' language 'plpgsql'; ---create table acs_privilege_method_rules ( --- privilege not null constraint acs_priv_method_rules_priv_fk --- references acs_privileges (privilege), --- object_type varchar2(100) not null, --- method varchar2(100) not null, --- constraint acs_privilege_method_rules_pk --- primary key (privilege, object_type, method), --- constraint acs_priv_meth_rul_type_meth_fk --- foreign key (object_type, method) references acs_methods ---); - comment on table acs_privileges is ' - The rows in this table correspond to aggregations of specific - methods. Privileges share a global namespace. This is to avoid a + Privileges share a global namespace. This is to avoid a situation where granting the foo privilege on one type of object can have an entirely different meaning than granting the foo privilege on another type of object. @@ -280,20 +264,6 @@ privilege is a superset of the bar privilege. '; ---comment on table acs_privilege_method_rules is ' --- The privilege method map allows us to create rules that specify which --- methods a certain privilege is allowed to invoke in the context of a --- particular object_type. Note that the same privilege can have --- different methods for different object_types. This is because each --- method corresponds to a piece of code, and the code that displays an --- instance of foo will be different than the code that displays an --- instance of bar. If there are no methods defined for a particular --- (privilege, object_type) pair, then that privilege is not relavent to --- that object type, for example there is no way to moderate a user, so --- there would be no additional methods that you could invoke if you --- were granted moderate on a user. ---' - create function acs_privilege__create_privilege (varchar,varchar,varchar) returns integer as ' declare Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql 21 Apr 2003 01:02:34 -0000 1.1.2.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql 3 May 2003 23:52:33 -0000 1.1.2.2 @@ -1,5 +1,6 @@ -drop view user_tab_comments; +-- PG 7.2 doesn't have create or replace view (7.3 does but we don't require it yet) +drop view user_tab_comments; create view user_tab_comments as select upper(c.relname) as table_name, case @@ -11,3 +12,50 @@ from pg_class c left outer join pg_description d on (c.oid = d.objoid) where d.objsubid = 0; + +-- ****************************************************************** +-- * Community Core API +-- ****************************************************************** + +drop view registered_users; +create view registered_users +as + select p.email, p.url, pe.first_names, pe.last_name, u.*, mr.member_state + from parties p, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo + where party_id = person_id + and person_id = user_id + and u.user_id = m.member_id + and m.rel_id = mr.rel_id + and amo.name = 'registered_users' + and m.group_id = amo.object_id + and mr.member_state = 'approved' + and u.email_verified_p = 't'; + +drop view cc_users; +create view cc_users +as +select o.*, pa.*, pe.*, u.*, mr.member_state, mr.rel_id +from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr, acs_magic_objects amo +where o.object_id = pa.party_id + and pa.party_id = pe.person_id + and pe.person_id = u.user_id + and u.user_id = m.member_id + and amo.name = 'registered_users' + and m.group_id = amo.object_id + and m.rel_id = mr.rel_id + and m.container_id = m.group_id; + +create function acs_priv_del_tr () returns opaque as ' +begin + + delete from acs_privilege_descendant_map + where privilege = old.privilege; + + return old; + +end;' language 'plpgsql'; + +create trigger acs_priv_del_tr before delete +on acs_privileges for each row +execute procedure acs_priv_del_tr (); + Index: openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl 5 Mar 2003 14:52:43 -0000 1.2.2.1 +++ openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl 3 May 2003 23:52:47 -0000 1.2.2.2 @@ -3,7 +3,7 @@ @author Lars Pind (lars@collaboraid.biz) @creation-date 2003-01-14 - @cvs-id $Id$ + @cvs-id msg-type-procs.tcl,v 1.2.2.1 2003/03/05 14:52:43 lars Exp } namespace eval acs_sc::msg_type {} @@ -16,8 +16,6 @@ @param specification Msg type specification in the format required by the SQL proc, namely 'foo:integer,bar:[string]' } { - ns_log Notice "LARS: Creating msg_type $name with spec $specification" - db_exec_plsql insert_msg_type {} } @@ -57,7 +55,6 @@ @param name Name of new msg_type @param spec Spec in ad_page_contract style format, namely { foo:integer bar:string,multiple } } { - ns_log Notice "LARS: msg-type-parse-spec, name=$name, spec=$spec" db_transaction { Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl,v diff -u -r1.13.2.7 -r1.13.2.8 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 5 Mar 2003 18:13:39 -0000 1.13.2.7 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 3 May 2003 23:53:08 -0000 1.13.2.8 @@ -4,7 +4,7 @@ @creation-date 2002-05-03 @author Lars Pind - @cvs-id $Id$ + @cvs-id bug-tracker-procs.tcl,v 1.13.2.7 2003/03/05 18:13:39 lars Exp } @@ -959,7 +959,6 @@ {-comment:required} {-format:required} } { - ns_log Notice "LARS: Format=$format, comment=$comment, formatted = [ad_html_text_convert -from $format -to text/html -- $comment]" return [ad_html_text_convert -from $format -to text/html -- $comment] }