Index: openacs-4/packages/acs-kernel/sql/postgresql/authentication-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/authentication-package-create.sql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-kernel/sql/postgresql/authentication-package-create.sql	12 Mar 2004 18:48:50 -0000	1.7
+++ openacs-4/packages/acs-kernel/sql/postgresql/authentication-package-create.sql	7 Jul 2011 10:46:02 -0000	1.8
@@ -3,50 +3,42 @@
 -- @author Peter Marklund
 -- @creation-date 2003-08-21
 
-create or replace function authority__new (
-    integer, -- authority_id
-    varchar, -- object_type
-    varchar, -- short_name
-    varchar, -- pretty_name
-    boolean, -- enabled_p
-    integer, -- sort_order
-    integer, -- auth_impl_id
-    integer, -- pwd_impl_id
-    varchar, -- forgotten_pwd_url
-    varchar, -- change_pwd_url
-    integer, -- register_impl_id
-    varchar, -- register_url
-    varchar, -- help_contact_text
-    integer, -- creation_user
-    varchar, -- creation_ip
-    integer  -- context_id
-)
-returns integer as '
-declare
-    p_authority_id alias for $1; -- default null,
-    p_object_type alias for $2; -- default ''authority''
-    p_short_name alias for $3;
-    p_pretty_name alias for $4;
-    p_enabled_p alias for $5; -- default ''t''
-    p_sort_order alias for $6;
-    p_auth_impl_id alias for $7; -- default null
-    p_pwd_impl_id alias for $8; -- default null
-    p_forgotten_pwd_url alias for $9; -- default null
-    p_change_pwd_url alias for $10; -- default null
-    p_register_impl_id alias for $11; -- default null
-    p_register_url alias for $12; -- default null
-    p_help_contact_text alias for $13; -- default null,
-    p_creation_user alias for $14; -- default null
-    p_creation_ip alias for $15; -- default null
-    p_context_id alias for $16; -- default null
+
+
+-- added
+select define_function_args('authority__new','authority_id;null,object_type;authority,short_name,pretty_name,enabled_p;t,sort_order,auth_impl_id;null,pwd_impl_id;null,forgotten_pwd_url;null,change_pwd_url;null,register_impl_id;null,register_url;null,help_contact_text;null,creation_user;null,creation_ip;null,context_id;null');
+
+--
+-- procedure authority__new/16
+--
+CREATE OR REPLACE FUNCTION authority__new(
+   p_authority_id integer,      -- default null,
+   p_object_type varchar,       -- default 'authority'
+   p_short_name varchar,
+   p_pretty_name varchar,
+   p_enabled_p boolean,         -- default 't'
+   p_sort_order integer,
+   p_auth_impl_id integer,      -- default null
+   p_pwd_impl_id integer,       -- default null
+   p_forgotten_pwd_url varchar, -- default null
+   p_change_pwd_url varchar,    -- default null
+   p_register_impl_id integer,  -- default null
+   p_register_url varchar,      -- default null
+   p_help_contact_text varchar, -- default null,
+   p_creation_user integer,     -- default null
+   p_creation_ip varchar,       -- default null
+   p_context_id integer         -- default null
+
+) RETURNS integer AS $$
+DECLARE
   
     v_authority_id           integer;
     v_object_type            varchar;    
     v_sort_order             integer;
   
-begin
+BEGIN
     if p_object_type is null then
-        v_object_type := ''authority'';
+        v_object_type := 'authority';
     else
         v_object_type := p_object_type;
     end if;
@@ -66,7 +58,7 @@
         p_creation_user,
         p_creation_ip,
         p_context_id,
-        ''t'',
+        't',
         p_short_name,
         null
     );
@@ -81,15 +73,25 @@
                                   p_help_contact_text);
 
    return v_authority_id;
-end;
-' language 'plpgsql';
+END;
 
-create or replace function authority__del (integer)
-returns integer as '
-declare
-  p_authority_id            alias for $1;
-begin
+$$ LANGUAGE plpgsql;
+
+
+
+-- added
+select define_function_args('authority__del','authority_id');
+
+--
+-- procedure authority__del/1
+--
+CREATE OR REPLACE FUNCTION authority__del(
+   p_authority_id integer
+) RETURNS integer AS $$
+DECLARE
+BEGIN
   perform acs_object__delete(p_authority_id);
 
   return 0; 
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
