Index: openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql 21 Feb 2005 22:16:32 -0000 1.4
+++ openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql 13 Mar 2005 22:08:44 -0000 1.5
@@ -127,7 +127,7 @@
db_transaction {
array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password]
}
-set admin_user_id [auth::test::get_admin_user_id]
+set admin_user_id [as::actions::get_admin_user_id]
set administration_name [db_string admin_name "select first_names || '' '' || last_name from persons where
person_id = :admin_user_id"]
set system_name [ad_system_name]
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql 8 Feb 2005 22:55:58 -0000 1.1
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql 13 Mar 2005 22:08:45 -0000 1.2
@@ -87,7 +87,7 @@
db_transaction {
array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password]
}
-set admin_user_id [auth::test::get_admin_user_id]
+set admin_user_id [as::actions::get_admin_user_id]
set administration_name [db_string admin_name "select first_names || \'\' \'\' || last_name from persons where person_id
= :admin_user_id"]
set system_name [ad_system_name]
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 14 Feb 2005 18:39:48 -0000 1.6
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 13 Mar 2005 22:08:45 -0000 1.7
@@ -172,7 +172,7 @@
db_transaction {
array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password]
}
-set admin_user_id [auth::test::get_admin_user_id]
+set admin_user_id [as::actions::get_admin_user_id]
set administration_name [db_string admin_name "select first_names || \'\' \'\' || last_name from
persons where person_id = :admin_user_id"]
set system_name [ad_system_name]
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql 4 Feb 2005 21:02:24 -0000 1.3
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql 13 Mar 2005 22:08:45 -0000 1.4
@@ -15,7 +15,7 @@
array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names\\
-last_name $last_name -password $password]
}
-set admin_user_id [auth::test::get_admin_user_id]
+set admin_user_id [as::actions::get_admin_user_id]
set administration_name [db_string admin_name "select first_names || \' \' || last_name from persons where person_id
= :admin_user_id"]
set system_name [ad_system_name]
Index: openacs-4/packages/assessment/tcl/as-apm-action-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/assessment/tcl/as-apm-action-procs-oracle.xql 27 Feb 2005 17:07:17 -0000 1.2
+++ openacs-4/packages/assessment/tcl/as-apm-action-procs-oracle.xql 13 Mar 2005 22:08:45 -0000 1.3
@@ -3,6 +3,14 @@
oracle8.1.6
+
+
+ select q.user_id from
+ (select user_id
+ from users
+ where acs_permission.permission_p(:context_root_id, user_id, 'admin') = 't') q where rownum = 1
+
+
begin
Index: openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql 27 Feb 2005 17:07:17 -0000 1.4
+++ openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql 13 Mar 2005 22:08:45 -0000 1.5
@@ -3,6 +3,16 @@
postgresql7.2
+
+
+
+ select user_id
+ from users
+ where acs_permission__permission_p(:context_root_id, user_id, 'admin') = 't'
+ limit 1
+
+
+
select as_action__default_actions ($package_id,$user_id,$package_id)
Index: openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl 3 Mar 2005 22:46:41 -0000 1.4
+++ openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl 13 Mar 2005 22:08:45 -0000 1.5
@@ -5,13 +5,21 @@
}
namespace eval as::actions {}
+
+ad_proc -private as::actions::get_admin_user_id {} {
+ Return the user id of a site-wide-admin on the system
+} {
+ set context_root_id [acs_lookup_magic_object security_context_root]
+
+ return [db_string select_user_id {}]
+}
ad_proc -public as::actions::insert_actions {
{-package_id}
{-node_id}
} {
} {
- set user_id [auth::test::get_admin_user_id]
+ set user_id [as::actions::get_admin_user_id]
db_exec_plsql insert_default {}
}