| |
155 |
155 |
) RETURNS integer AS $$ |
| |
156 |
156 |
DECLARE |
| |
157 |
157 |
BEGIN |
| |
158 |
158 |
|
| |
159 |
159 |
|
| |
160 |
160 |
delete from as_action_params where action_id=del__action_id; |
| |
161 |
161 |
|
| |
162 |
162 |
delete from as_actions where action_id = del__action_id; |
| |
163 |
163 |
|
| |
164 |
164 |
PERFORM acs_object__delete (del__action_id); |
| |
165 |
165 |
return del__action_id; |
| |
166 |
166 |
|
| |
167 |
167 |
END; |
| |
168 |
168 |
$$ LANGUAGE plpgsql; |
| |
169 |
169 |
|
| |
170 |
170 |
|
| |
171 |
171 |
|
| |
172 |
172 |
select define_function_args('as_action__default_actions','context_id,creation_user,package_id'); |
| |
173 |
173 |
|
| |
174 |
174 |
|
| |
175 |
|
|
| |
|
175 |
|
| |
176 |
176 |
|
| |
177 |
177 |
CREATE OR REPLACE FUNCTION as_action__default_actions( |
| |
178 |
178 |
new__context_id integer, |
| |
179 |
179 |
new__creation_user integer, |
| |
180 |
180 |
new__package_id integer |
| |
181 |
181 |
) RETURNS integer AS $$ |
| |
182 |
182 |
DECLARE |
| |
183 |
183 |
v_action_id integer; |
| |
184 |
184 |
v_parameter_id integer; |
| |
185 |
185 |
BEGIN |
| |
186 |
186 |
v_action_id := as_action__new ( |
| |
187 |
187 |
null, |
| |
188 |
188 |
'Register User', |
| |
189 |
189 |
'Register new users', |
| |
190 |
190 |
'set password [ad_generate_random_string] |
| |
191 |
191 |
db_transaction { |
| |
192 |
192 |
array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password] |
| |
193 |
193 |
} |
| |
194 |
194 |
set admin_user_id [as::actions::get_admin_user_id] |
| |
195 |
195 |
set administration_name [db_string admin_name "select first_names || '' '' || last_name from |