1 package fnd_ldap_util as
2 /* $Header: AFSCOLTS.pls 120.7.12000000.2 2007/03/30 17:17:38 rsantis ship $ */
3 --
4 /*****************************************************************************/
5
6 type ldap_user_type is record (
7 object_name varchar2(1024)
8 , uid varchar2(1024)
9 , sn varchar2(4000)
10 , cn varchar2(4000)
11 , userPassword varchar2(4000)
12 , telephoneNumber varchar2(4000)
13 , street varchar2(4000)
14 , postalCode varchar2(4000)
15 , physicalDeliveryOfficeName varchar2(4000)
16 , st varchar2(4000)
17 , l varchar2(4000)
18 , displayName varchar2(4000)
19 , givenName varchar2(4000)
20 , homePhone varchar2(4000)
21 , mail varchar2(4000)
22 , c varchar2(4000)
23 , facsimileTelephoneNumber varchar2(4000)
24 , description varchar2(4000)
25 , orclisEnabled varchar2(4000)
26 , orclActiveStartDate varchar2(4000)
27 , orclActiveEndDate varchar2(4000)
28 , orclGUID varchar2(4000)
29 );
30
31 -- Start of Package Globals
32
33 G_SUCCESS constant pls_integer := 1;
34 G_FAILURE constant pls_integer := 0;
35 G_TRUE constant pls_integer := 1;
36 G_FALSE constant pls_integer := 0;
37
38 G_MAIL constant varchar2(4) := 'MAIL';
39 G_FACSIMILETELEPHONENUMBER constant varchar2(24) := 'FACSIMILETELEPHONENUMBER';
40 G_COM_PROD_ORCLECTX constant varchar2(4000) := 'cn=Common,cn=Products,cn=OracleContext';
41
42 G_INTERNAL constant varchar2(9) := '#INTERNAL';
43 G_LDAP_SYNCH constant varchar2(10) := 'LDAP_SYNCH';
44 G_HOST constant varchar2(4) := 'HOST';
45 G_PORT constant varchar2(4) := 'PORT';
46 G_USERNAME constant varchar2(8) := 'USERNAME';
47 G_EPWD constant varchar2(4) := 'EPWD';
48 G_LDAP_PWD constant varchar2(8) := 'LDAP_PWD';
49 G_DBLDAPAUTHLEVEL constant varchar2(15) := 'dbldapauthlevel';
50 G_DBWALLETDIR constant varchar2(11) := 'dbwalletdir';
51 G_DBWALLETPASS constant varchar2(12) := 'dbwalletpass';
52 -- default DAS operation url base
53 G_DEFAULT_BASE constant varchar2(100) := 'cn=OperationURLs,cn=DAS,cn=Products,cn=OracleContext';
54 -- End of Package Globals
55 --
56 -------------------------------------------------------------------------------
57 /*
58 ** Name : get_oid_session
59 ** Type : Public, FND Internal
60 ** Desc :
61 ** Pre-Reqs :
62 ** Parameters :
63 */
64 function get_oid_session return dbms_ldap.session;
65
66 function c_get_oid_session(flag in out nocopy pls_integer) return dbms_ldap.session;
67 procedure c_unbind(ldap in out nocopy dbms_ldap.session , flag in out nocopy pls_integer);
68 --
69 -------------------------------------------------------------------------------
70 /*
71 ** Name : unbind
72 ** Type : Public, FND Internal
73 ** Desc : This function unbinds an ldap_session
74 ** Pre-Reqs :
75 ** Parameters :
76 ** Notes :
77 */
78 function unbind(p_session in out nocopy dbms_ldap.session) return pls_integer;
79 --
80 -------------------------------------------------------------------------------
81 /*
82 ** Name : get_orclappname
83 ** Type : Public, FND Internal
84 ** Desc : This function returns orclAppName from Workflow
85 ** Pre-Reqs :
86 ** Parameters :
87 ** Notes :
88 */
89 function get_orclappname return varchar2;
90 --
91 -------------------------------------------------------------------------------
92 /*
93 ** Name : get_users_nodes
94 ** Type : Public, FND Internal
95 ** Desc : This function gets the value of orclcommondefaultusercreatebase
96 from OID
97 ** Pre-Reqs :
98 ** Parameters :
99 ** Notes :
100 ** DEPRECATED AND REMOVED, use
101 ** get_user_create_base(username)
102 ** get_user_search_base(username)
103
104 **
105 */
106 -- function get_users_nodes return dbms_ldap.string_collection;
107
108 -------------------------------------------------------------------------------
109 /*
110 ** Name : get_user_create_base
111 ** Type : Public, FND Internal
112 ** Desc : This function returns the DN where the user should be created
113 ** Pre-Reqs :
114 ** Parameters :
115 ** Notes :
116 **
117 */
118 function get_user_create_base(username in out nocopy varchar2) return varchar2;
119
120 -------------------------------------------------------------------------------
121 /*
122 ** Name : get_user_search_base
123 ** Type : Public, FND Internal
124 ** Desc : This function returns the DN where the user can be searched
125 ** Pre-Reqs :
126 ** Parameters :
127 ** Notes :
128 **
129 */
130 function get_users_search_base(username in out nocopy varchar2) return varchar2;
131
132
133 --
134 -------------------------------------------------------------------------------
135 /*
136 ** Name : get_search_nodes
137 ** Type : Public, FND Internal
138 ** Desc : This function gets the value of orclcommonusersearchbase
139 from OID
140 ** Pre-Reqs :
141 ** Parameters :
142 ** Notes : REMOVED , use get_User_create_base(username)/ get_user_search_base(username)
143 */
144 -- function get_search_nodes return dbms_ldap.string_collection;
145 --
146 -------------------------------------------------------------------------------
147 /*
148 ** Name : get_mandatory_user_attrib
149 ** Type : Public, FND Internal
150 ** Desc : This function gets the value of orclcommonnicknameattribute from
151 OID
152 ** Pre-Reqs :
153 ** Parameters :
154 ** Notes :
155 */
156 function get_orclcommonnicknameattr(username in out nocopy varchar2) return varchar2;
157 --
158 -------------------------------------------------------------------------------
159 /*
160 ** Name : get_dn_for_guid
161 ** Type : Public, FND Internal
162 ** Desc : This function gets the dn for user specified by the guid
163 ** Pre-Reqs :
164 ** Parameters : orcl_guid
165 ** Notes :
166 */
167 function get_dn_for_guid(p_orclguid in fnd_user.user_guid%type) return varchar2;
168 --
169 -------------------------------------------------------------------------------
170 /*
171 ** Name : get_dn_for_guid
172 ** Type : Public, FND Internal
173 ** Desc : This function gets the dn for user specified by the guid
174 ** Pre-Reqs :
175 ** Parameters : orcl_guid
176 ** Notes :
177 */
178 function get_dn_for_guid(p_orclguid in fnd_user.user_guid%type,
179 p_ldap_session in dbms_ldap.session) return varchar2;
180 --
181 -------------------------------------------------------------------------------
182 /*
183 ** Name : get_default_realm
184 ** Type : Public, FND Internal
185 ** Desc : This function gets the default realm from OID
186 ** Pre-Reqs :
187 ** Parameters :
188 ** Notes : removed , use get_realm(username) instead
189 */
190 -- function get_default_realm return varchar2;
191
192 -------------------------------------------------------------------------------
193 /*
194 ** Name : get_realm
195 ** Type : Public, FND Internal
196 ** Desc : This function gets the default realm from OID
197 ** Pre-Reqs :
198 ** Parameters :
199 ** Notes : removed , use get_realm(username) instead
200 */
201 -- function get_default_realm(username in out nocopy varchar2) return varchar2;
202
203 --
204 -------------------------------------------------------------------------------
205 /*
206 ** Name : get_guid_for_dn
207 ** Type : Private (? , probably others will need this ,
208 ** is it a candidate for the API ?
209 ** Desc : Given and DN return its orclguid
210 ** if DN is not found, the raise "NO_DATA_FOUND'
211
212 ** Parameters :
213 ** aDN: the application DN, for example
214 ** orclApplicationCommonName=PROD1,cn=EBusiness,cn=Products,cn=OracleContext,dc=us,dc=oracle,dc=com
215 ** Returns :
216 ** Its orclguid
217 ** If it is NULL then the DN does not have a orcGuild attribute
218 ** Exceptions:
219 ** DATA_NOT_FOUND if search_s raise DBMS_LDAP.GENERAL_EXCEPTION
220 ** NOte that this DBMS_LDAP exception maybe risen by other reasons
221 **
222 */
223 function get_guid_for_dn(ldapSession in dbms_ldap.session,p_dn in varchar2) return varchar2;
224
225 --
226 -------------------------------------------------------------------------------
227 /*
228 ** Name : proxy_as_user
229 ** Type : Public, FND Internal
230 ** Desc : This procedure proxies as the given user. This is used when we don't
231 ** want to expire a user's password in cases such as a user updating
232 ** one's own password
233 ** Pre-Reqs :
234 ** Parameters : p_orclguid: GUID of the user that acts a proxy user
235 ** x_ldap_session: returns a valid OID session. Must be released bu caller of
236 ** the API
237 ** Notes :
238 */
239 procedure proxy_as_user(p_orclguid in fnd_user.user_guid%type, x_ldap_session out nocopy dbms_ldap.session);
240 --
241 -------------------------------------------------------------------------------
242
243 /*
244 ** Name : get_DAS_OperationUrl
245 ** Type : Public, FND Internal
246 ** Desc : This functions return and URL suitable for the requested operation
247 ** Support multiple realms specific definitions.
248 ** Pre-Reqs :
249 ** Parameters : p_orclguid: GUID of the user that acts a proxy user
250 ** x_ldap_session: returns a valid OID session. Must be released bu caller of
251 ** the API
252 ** Notes :
253 ** There are lot of Urls, most used maybe
254 ** Password Change
255 ** TimeZone
256 ** Edit My Profile
257 ** View User Profile
258 ** Reset Password
259 */
260
261 function get_DAS_OperationUrl(p_realm in varchar2, p_operation in varchar2) return varchar2;
262 --
263 -------------------------------------------------------------------------------
264 /*
265 ** Name : add_attribute_M
266 ** Type : Public, FND Internal
267 ** Desc : This procedure add an attribute to an entry when then attribute has
268 ** multiple values
269 ** Pre-Reqs :
270 ** Parameters : p_orclguid: GUID of the user that acts a proxy user
271 ** x_ldap_session: returns a valid OID session. Must be released bu caller of
272 ** the API
273 ** Notes :
274 */
275 procedure add_attribute_M(x_ldap in out nocopy dbms_ldap.session, dn in varchar2, name in varchar2, value in varchar2 );
276 --
277 -------------------------------------------------------------------------------
278
279 end fnd_ldap_util;