68: -- initializing
69: l_module_source := G_MODULE_SOURCE || 'delete_user: ';
70: x_result := fnd_ldap_util.G_SUCCESS;
71:
72: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
73: then
74: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
75: end if;
76:
70: x_result := fnd_ldap_util.G_SUCCESS;
71:
72: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
73: then
74: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
75: end if;
76:
77: --scheruku :: Added logic to get orclguid from fnd_user
78: -- l_apps_user_key_type := fnd_oid_util.get_fnd_user(p_user_name => p_user_name);
80: l_orclguid := p_user_guid;
81:
82: if(l_orclguid IS NULL)
83: then
84: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
85: then
86: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
87: 'NULL guid in FND_USER');
88: end if;
82: if(l_orclguid IS NULL)
83: then
84: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
85: then
86: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
87: 'NULL guid in FND_USER');
88: end if;
89: x_result := fnd_ldap_util.G_FAILURE;
90: else
87: 'NULL guid in FND_USER');
88: end if;
89: x_result := fnd_ldap_util.G_FAILURE;
90: else
91: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
92: then
93: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
94: 'FND_USER GUID::'||l_orclguid);
95: end if;
89: x_result := fnd_ldap_util.G_FAILURE;
90: else
91: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
92: then
93: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
94: 'FND_USER GUID::'||l_orclguid);
95: end if;
96: l_filter := 'orclguid='||l_orclguid;
97: --ldapSession := fnd_ldap_util.get_oid_session;
145: x_result := fnd_ldap_util.G_SUCCESS;
146: end if;
147: end if;-- fnd_user guid null check if block ends here
148:
149: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
150: then
151: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
152: end if;
153:
147: end if;-- fnd_user guid null check if block ends here
148:
149: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
150: then
151: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
152: end if;
153:
154: exception
155: when others then
152: end if;
153:
154: exception
155: when others then
156: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
157: then
158: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
159: end if;
160: x_result := fnd_ldap_util.G_FAILURE;
154: exception
155: when others then
156: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
157: then
158: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
159: end if;
160: x_result := fnd_ldap_util.G_FAILURE;
161:
162: end delete_user;
194:
195: begin
196: l_module_source := G_MODULE_SOURCE || 'change_password: ';
197:
198: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
199: then
200: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
201: end if;
202:
196: l_module_source := G_MODULE_SOURCE || 'change_password: ';
197:
198: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
199: then
200: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
201: end if;
202:
203: select user_id into l_user_id
204: from fnd_user
212: val_z => l_local_login,
213: defined_z => l_profile_defined);
214:
215: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL) then
216: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
217: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
218: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Local user dont sych '|| p_user_name);
219: end if;
220: l_to_synch := FALSE;
213: defined_z => l_profile_defined);
214:
215: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL) then
216: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
217: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
218: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Local user dont sych '|| p_user_name);
219: end if;
220: l_to_synch := FALSE;
221: else
214:
215: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL) then
216: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
217: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
218: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Local user dont sych '|| p_user_name);
219: end if;
220: l_to_synch := FALSE;
221: else
222: fnd_profile.get_specific(name_z => 'APPS_SSO_LDAP_SYNC',
223: user_id_z => l_user_id,
224: val_z => l_allow_sync,
225: defined_z => l_profile_defined);
226: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N) then
227: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
228: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
229: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Synch profile is disabled for user ...dont sych '|| p_user_name);
230: end if;
231: l_to_synch := FALSE;
224: val_z => l_allow_sync,
225: defined_z => l_profile_defined);
226: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N) then
227: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
228: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
229: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Synch profile is disabled for user ...dont sych '|| p_user_name);
230: end if;
231: l_to_synch := FALSE;
232: else
225: defined_z => l_profile_defined);
226: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N) then
227: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
228: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
229: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Synch profile is disabled for user ...dont sych '|| p_user_name);
230: end if;
231: l_to_synch := FALSE;
232: else
233: l_to_synch := TRUE;
242: x_result := update_user(usertype, p_expire_password);
243:
244: else
245: x_result := fnd_ldap_util.G_SUCCESS;
246: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
247: then
248: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
249: 'User is a local user or synch is disabled for this user.');
250: end if;
244: else
245: x_result := fnd_ldap_util.G_SUCCESS;
246: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
247: then
248: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
249: 'User is a local user or synch is disabled for this user.');
250: end if;
251: end if;
252:
249: 'User is a local user or synch is disabled for this user.');
250: end if;
251: end if;
252:
253: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
254: then
255: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
256: end if;
257:
251: end if;
252:
253: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
254: then
255: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
256: end if;
257:
258: if x_result <> fnd_ldap_util.G_SUCCESS then
259: -- raise no_such_user_exp;
274:
275: exception
276: when no_such_user_exp then
277: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
278: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
279: then
280: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
281: end if;
282: x_result := fnd_ldap_util.G_FAILURE;
276: when no_such_user_exp then
277: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
278: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
279: then
280: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
281: end if;
282: x_result := fnd_ldap_util.G_FAILURE;
283: when others then
284: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
281: end if;
282: x_result := fnd_ldap_util.G_FAILURE;
283: when others then
284: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
285: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
286: then
287: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
288: end if;
289: --x_result := fnd_ldap_util.G_FAILURE;
283: when others then
284: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
285: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
286: then
287: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
288: end if;
289: --x_result := fnd_ldap_util.G_FAILURE;
290: -- bug 4573677
291: raise;
335:
336: begin
337: l_module_source := G_MODULE_SOURCE || 'change_user_name: ';
338:
339: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
340: then
341: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
342: end if;
343:
337: l_module_source := G_MODULE_SOURCE || 'change_user_name: ';
338:
339: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
340: then
341: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
342: end if;
343:
344: /** to do - what if there are multiple linked users ? **/
345:
346: decode_dates(p_user_name => p_old_user_name,
347: x_orclisEnabled => l_orclisEnabled,
348: x_user_id => l_user_id);
349:
350: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
351: then
352: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
353: end if;
354:
348: x_user_id => l_user_id);
349:
350: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
351: then
352: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
353: end if;
354:
355:
356: l_to_synch := TRUE;
361: defined_z => l_profile_defined);
362:
363: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL)
364: then
365: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
366: then
367: if(l_profile_defined)
368: then
369: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
365: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
366: then
367: if(l_profile_defined)
368: then
369: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
370: 'APPS_SSO_LOCAL_LOGIN profile defined');
371: else
372: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
373: 'APPS_SSO_LOCAL_LOGIN profile not defined');
368: then
369: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
370: 'APPS_SSO_LOCAL_LOGIN profile defined');
371: else
372: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
373: 'APPS_SSO_LOCAL_LOGIN profile not defined');
374:
375: end if;
376: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
372: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
373: 'APPS_SSO_LOCAL_LOGIN profile not defined');
374:
375: end if;
376: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
377: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
378: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
379: 'Local user dont sych '|| p_old_user_name);
380: end if;
374:
375: end if;
376: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
377: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
378: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
379: 'Local user dont sych '|| p_old_user_name);
380: end if;
381: l_to_synch := FALSE;
382: else
386: defined_z => l_profile_defined);
387:
388: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
389: then
390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
391: then
392: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
393: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
394: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
388: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
389: then
390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
391: then
392: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
393: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
394: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
395: 'Synch profile is disabled for user ...dont sych '|| p_old_user_name);
396: end if;
390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
391: then
392: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
393: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
394: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
395: 'Synch profile is disabled for user ...dont sych '|| p_old_user_name);
396: end if;
397: l_to_synch := FALSE;
398: else
425: l_old_nick_name := upper(fnd_oid_util.get_oid_nickname(p_user_guid => p_user_guid));
426:
427: if(l_old_nick_name = p_old_user_name)
428: then
429: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
430: then
431: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
432: 'Nickname of the oid user for the old fnd username is same: '|| l_old_nick_name);
433: end if;
427: if(l_old_nick_name = p_old_user_name)
428: then
429: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
430: then
431: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
432: 'Nickname of the oid user for the old fnd username is same: '|| l_old_nick_name);
433: end if;
434:
435: l_new_user_name_exists := user_exists(p_user_name => p_new_user_name);
435: l_new_user_name_exists := user_exists(p_user_name => p_new_user_name);
436:
437: if(l_new_user_name_exists = FND_LDAP_UTIL.G_FALSE)
438: then
439: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
440: then
441: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
442: 'User with following value for nickname(new) attribute does not exist:: '||p_new_user_name);
443: end if;
437: if(l_new_user_name_exists = FND_LDAP_UTIL.G_FALSE)
438: then
439: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
440: then
441: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
442: 'User with following value for nickname(new) attribute does not exist:: '||p_new_user_name);
443: end if;
444: x_result := update_user(usertype);
445: if (x_result <> fnd_ldap_util.G_SUCCESS)
446: then
447: raise no_such_user_exp;
448: end if;
449: else -- if(l_new_user_name_exists = FND_LDAP_UTIL.G_TRUE)
450: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
451: then
452: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
453: 'User with following value for nickname(new) attribute does exist:: '||p_new_user_name);
454: end if;
448: end if;
449: else -- if(l_new_user_name_exists = FND_LDAP_UTIL.G_TRUE)
450: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
451: then
452: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
453: 'User with following value for nickname(new) attribute does exist:: '||p_new_user_name);
454: end if;
455: raise invalid_new_user_exp;
456: end if;
456: end if;
457:
458: else -- if(l_old_nick_name != p_old_user_name)
459:
460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
461: then
462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current Nickname: '|| l_old_nick_name);
463: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current FND_USER user_name '|| p_old_user_name);
464: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
458: else -- if(l_old_nick_name != p_old_user_name)
459:
460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
461: then
462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current Nickname: '|| l_old_nick_name);
463: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current FND_USER user_name '|| p_old_user_name);
464: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
465: 'Nickname of the oid user for the old fnd username is not same: ');
466: end if;
459:
460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
461: then
462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current Nickname: '|| l_old_nick_name);
463: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current FND_USER user_name '|| p_old_user_name);
464: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
465: 'Nickname of the oid user for the old fnd username is not same: ');
466: end if;
467: if(l_old_nick_name = p_new_user_name)
460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
461: then
462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current Nickname: '|| l_old_nick_name);
463: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current FND_USER user_name '|| p_old_user_name);
464: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
465: 'Nickname of the oid user for the old fnd username is not same: ');
466: end if;
467: if(l_old_nick_name = p_new_user_name)
468: then
465: 'Nickname of the oid user for the old fnd username is not same: ');
466: end if;
467: if(l_old_nick_name = p_new_user_name)
468: then
469: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
470: then
471: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current OID nickname and new fnd username match '
472: || l_old_nick_name);
473: end if;
467: if(l_old_nick_name = p_new_user_name)
468: then
469: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
470: then
471: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current OID nickname and new fnd username match '
472: || l_old_nick_name);
473: end if;
474:
475: x_result := fnd_ldap_util.G_SUCCESS;
473: end if;
474:
475: x_result := fnd_ldap_util.G_SUCCESS;
476: else --if(l_old_nick_name != p_new_user_name)
477: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
478: then
479: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current OID nickname and new fnd username dont match '
480: || l_old_nick_name);
481: end if;
475: x_result := fnd_ldap_util.G_SUCCESS;
476: else --if(l_old_nick_name != p_new_user_name)
477: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
478: then
479: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Current OID nickname and new fnd username dont match '
480: || l_old_nick_name);
481: end if;
482:
483: l_new_user_name_exists := user_exists(p_user_name => p_new_user_name);
483: l_new_user_name_exists := user_exists(p_user_name => p_new_user_name);
484:
485: if(l_new_user_name_exists = FND_LDAP_UTIL.G_FALSE)
486: then
487: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
488: then
489: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'New fnd user_name does not exist in OID ');
490: end if;
491: x_result := fnd_ldap_util.G_SUCCESS;
485: if(l_new_user_name_exists = FND_LDAP_UTIL.G_FALSE)
486: then
487: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
488: then
489: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'New fnd user_name does not exist in OID ');
490: end if;
491: x_result := fnd_ldap_util.G_SUCCESS;
492: else
493: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
489: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'New fnd user_name does not exist in OID ');
490: end if;
491: x_result := fnd_ldap_util.G_SUCCESS;
492: else
493: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
494: then
495: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'New fnd user_name does exist in OID ');
496: end if;
497: raise invalid_new_user_exp;
491: x_result := fnd_ldap_util.G_SUCCESS;
492: else
493: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
494: then
495: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'New fnd user_name does exist in OID ');
496: end if;
497: raise invalid_new_user_exp;
498: end if;
499: end if;
500: end if;
501: else
502: x_result := fnd_ldap_util.G_SUCCESS;
503:
504: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
505: then
506: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User is a local user or Synch profile is disabled.');
507: end if;
508: end if;
502: x_result := fnd_ldap_util.G_SUCCESS;
503:
504: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
505: then
506: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User is a local user or Synch profile is disabled.');
507: end if;
508: end if;
509:
510: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
506: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User is a local user or Synch profile is disabled.');
507: end if;
508: end if;
509:
510: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
511: then
512: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
513: end if;
514:
508: end if;
509:
510: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
511: then
512: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
513: end if;
514:
515: exception
516: when invalid_new_user_exp then
514:
515: exception
516: when invalid_new_user_exp then
517: fnd_message.set_name ('FND', 'FND_SSO_INVALID_NEW_USER_NAME');
518: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
519: then
520: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
521: end if;
522: x_result := fnd_ldap_util.G_FAILURE;
516: when invalid_new_user_exp then
517: fnd_message.set_name ('FND', 'FND_SSO_INVALID_NEW_USER_NAME');
518: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
519: then
520: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
521: end if;
522: x_result := fnd_ldap_util.G_FAILURE;
523: when no_such_user_exp then
524: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
521: end if;
522: x_result := fnd_ldap_util.G_FAILURE;
523: when no_such_user_exp then
524: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
525: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
526: then
527: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
528: end if;
529: x_result := fnd_ldap_util.G_FAILURE;
523: when no_such_user_exp then
524: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
525: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
526: then
527: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
528: end if;
529: x_result := fnd_ldap_util.G_FAILURE;
530: when others then
531: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
528: end if;
529: x_result := fnd_ldap_util.G_FAILURE;
530: when others then
531: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
532: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
533: then
534: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
535: end if;
536: x_result := fnd_ldap_util.G_FAILURE;
530: when others then
531: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
532: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
533: then
534: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
535: end if;
536: x_result := fnd_ldap_util.G_FAILURE;
537: end change_user_name;
538: --
563: user_name fnd_user.user_name%type;
564:
565: begin
566: l_module_source := G_MODULE_SOURCE || 'create_user: ';
567: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
568: then
569: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
570: end if;
571:
565: begin
566: l_module_source := G_MODULE_SOURCE || 'create_user: ';
567: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
568: then
569: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
570: end if;
571:
572: l_enabled := fnd_oid_util.G_ENABLED;
573:
658: else
659: fnd_message.set_name ('FND', 'FND_SSO_USER_EXISTS');
660: end if;
661:
662: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
663: then
664: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
665: end if;
666: exception
660: end if;
661:
662: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
663: then
664: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
665: end if;
666: exception
667: when others then
668: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
664: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
665: end if;
666: exception
667: when others then
668: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
669: then
670: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
671: end if;
672: raise;
666: exception
667: when others then
668: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
669: then
670: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
671: end if;
672: raise;
673:
674: end create_user;
705: begin
706: l_module_source := G_MODULE_SOURCE || 'create_user: ';
707: -- set default value to failure. change to success when user created successfully
708: retval := fnd_ldap_util.G_FAILURE;
709: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
710: then
711: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
712: end if;
713:
707: -- set default value to failure. change to success when user created successfully
708: retval := fnd_ldap_util.G_FAILURE;
709: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
710: then
711: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
712: end if;
713:
714:
715: ldapSession := fnd_ldap_util.c_get_oid_session(flag);
718: -- only proceed if user doesn't exist and all mandatory attributes are present
719: if (result = fnd_ldap_util.G_FAILURE) and (p_ldap_user.sn is not null) and
720: (p_ldap_user.cn is not null) /*and (p_ldap_user.userPassword is not null)*/ then
721:
722: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
723: then
724: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User ' || p_ldap_user.sn || ' does not exist and mandatory attributes are present');
725: end if;
726:
720: (p_ldap_user.cn is not null) /*and (p_ldap_user.userPassword is not null)*/ then
721:
722: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
723: then
724: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User ' || p_ldap_user.sn || ' does not exist and mandatory attributes are present');
725: end if;
726:
727:
728:
743: dbms_ldap.populate_mod_array(modptr => modArray, mod_op => dbms_ldap.mod_add, mod_type => modtype, modval => modvalues);
744: end loop;
745:
746: retval := create_user_nodes(ldapSession, modArray, p_ldap_user,l_userDN);
747: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
748: then
749: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User creation failed');
750: end if;
751:
745:
746: retval := create_user_nodes(ldapSession, modArray, p_ldap_user,l_userDN);
747: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
748: then
749: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User creation failed');
750: end if;
751:
752:
753: if (retval = fnd_ldap_util.G_SUCCESS) then
751:
752:
753: if (retval = fnd_ldap_util.G_SUCCESS) then
754: l_guid := fnd_ldap_util.get_guid_for_dn(ldapSession,l_userDN);
755: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
756: then
757: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Creating susbscriptions');
758: end if;
759:
753: if (retval = fnd_ldap_util.G_SUCCESS) then
754: l_guid := fnd_ldap_util.get_guid_for_dn(ldapSession,l_userDN);
755: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
756: then
757: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Creating susbscriptions');
758: end if;
759:
760: retval := create_user_subscription(l_guid);
761: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
757: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Creating susbscriptions');
758: end if;
759:
760: retval := create_user_subscription(l_guid);
761: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
762: then
763: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Subscription creation failed');
764: end if;
765:
759:
760: retval := create_user_subscription(l_guid);
761: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
762: then
763: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Subscription creation failed');
764: end if;
765:
766: end if;
767:
767:
768: -- if retval=false or result=false, that means partial creation, therefore
769: -- delete all created entries (rollback)
770: if ( (retval <> fnd_ldap_util.G_SUCCESS) ) then
771: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
772: then
773: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Deleting user due previous fail');
774: end if;
775:
769: -- delete all created entries (rollback)
770: if ( (retval <> fnd_ldap_util.G_SUCCESS) ) then
771: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
772: then
773: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Deleting user due previous fail');
774: end if;
775:
776: result := delete_user_by_name(ldapSession, p_ldap_user.cn);
777: end if;
786: val_z => l_link,
787: defined_z => l_profile_defined);
788:
789: if (l_link = 'Y') then
790: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
791: then
792: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User exists but APPS_SSO_LINK_SAME_NAMES is Enabled, adding user to subscription list');
793: end if;
794: --AQUI
788:
789: if (l_link = 'Y') then
790: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
791: then
792: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User exists but APPS_SSO_LINK_SAME_NAMES is Enabled, adding user to subscription list');
793: end if;
794: --AQUI
795: l_guid:= get_user_guid(p_ldap_user.uid);
796: retval := create_user_subscription(l_guid);
799:
800: end if;
801: fnd_ldap_util.c_unbind(ldapSession,flag);
802:
803: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
804: then
805: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
806: end if;
807:
801: fnd_ldap_util.c_unbind(ldapSession,flag);
802:
803: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
804: then
805: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
806: end if;
807:
808: return retval;
809:
808: return retval;
809:
810: exception
811: when others then
812: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
813: then
814: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
815: end if;
816: raise;
810: exception
811: when others then
812: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
813: then
814: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
815: end if;
816: raise;
817:
818: end create_user;
836: begin
837: l_module_source := G_MODULE_SOURCE || 'create_user_nodes: ';
838: -- set default value to failure. change to success when user created successfully
839: retval := fnd_ldap_util.G_FAILURE;
840: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
841: then
842: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
843: end if;
844:
838: -- set default value to failure. change to success when user created successfully
839: retval := fnd_ldap_util.G_FAILURE;
840: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
841: then
842: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
843: end if;
844:
845: user_name := p_ldap_user.uid ;
846: dn :=fnd_oid_plug.getDN(user_name);
843: end if;
844:
845: user_name := p_ldap_user.uid ;
846: dn :=fnd_oid_plug.getDN(user_name);
847: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
848: then
849: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Usename:'||user_name||' dn:'||dn);
850: end if;
851:
845: user_name := p_ldap_user.uid ;
846: dn :=fnd_oid_plug.getDN(user_name);
847: if ((retval <> fnd_ldap_util.G_SUCCESS) and (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL))
848: then
849: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Usename:'||user_name||' dn:'||dn);
850: end if;
851:
852: result := dbms_ldap.add_s(ld => p_ldap_session, entrydn => dn , modptr => p_mod_array);
853: if result = dbms_ldap.SUCCESS then
853: if result = dbms_ldap.SUCCESS then
854: --result := dbms_ldap.get_session_info(p_ldap_session, 1, l_data);
855: retval := fnd_ldap_util.G_SUCCESS;
856: userDN := dn;
857: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
858: then
859: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'created DN' || userDN);
860: end if;
861:
855: retval := fnd_ldap_util.G_SUCCESS;
856: userDN := dn;
857: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
858: then
859: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'created DN' || userDN);
860: end if;
861:
862: else
863: retval := fnd_ldap_util.G_FALSE;
861:
862: else
863: retval := fnd_ldap_util.G_FALSE;
864: userDN := null;
865: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
866: then
867: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Nothig was created');
868: end if;
869: end if;
863: retval := fnd_ldap_util.G_FALSE;
864: userDN := null;
865: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
866: then
867: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Nothig was created');
868: end if;
869: end if;
870: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
871: then
866: then
867: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Nothig was created');
868: end if;
869: end if;
870: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
871: then
872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval = ' || retval);
873: end if;
874:
868: end if;
869: end if;
870: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
871: then
872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval = ' || retval);
873: end if;
874:
875: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
876: then
871: then
872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval = ' || retval);
873: end if;
874:
875: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
876: then
877: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'End');
878: end if;
879: return retval;
873: end if;
874:
875: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
876: then
877: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'End');
878: end if;
879: return retval;
880:
881: exception
879: return retval;
880:
881: exception
882: when others then
883: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
884: then
885: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
886: end if;
887: raise;
881: exception
882: when others then
883: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
884: then
885: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
886: end if;
887: raise;
888:
889: end create_user_nodes;
916: begin
917: l_module_source := G_MODULE_SOURCE || 'create_user_subscription: ';
918: -- set default value to failure. change to success when user created successfully
919: retval := fnd_ldap_util.G_FAILURE;
920: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
921: then
922: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin guid='||p_guid);
923: end if;
924:
918: -- set default value to failure. change to success when user created successfully
919: retval := fnd_ldap_util.G_FAILURE;
920: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
921: then
922: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin guid='||p_guid);
923: end if;
924:
925: ldapSession := fnd_ldap_util.c_get_oid_session(flag);
926:
945: --retval := add_uniquemember(p_ldap_user);
946: fnd_ldap_util.add_attribute_M(ldapSession,acctNode,'uniqueMember',userDN);
947: retval:= fnd_ldap_util.G_SUCCESS;
948: else
949: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
950: then
951: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Failed! retval='||retval||' subsNode:'||subsNode);
952: end if;
953: end if;
947: retval:= fnd_ldap_util.G_SUCCESS;
948: else
949: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
950: then
951: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Failed! retval='||retval||' subsNode:'||subsNode);
952: end if;
953: end if;
954:
955: dbms_ldap.free_mod_array(modptr => modArray);
954:
955: dbms_ldap.free_mod_array(modptr => modArray);
956: fnd_ldap_util.c_unbind(ldapSession,flag);
957:
958: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
959: then
960: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
961: end if;
962:
956: fnd_ldap_util.c_unbind(ldapSession,flag);
957:
958: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
959: then
960: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
961: end if;
962:
963: return retval;
964:
963: return retval;
964:
965: exception
966: when others then
967: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
968: then
969: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
970: end if;
971: raise;
965: exception
966: when others then
967: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
968: then
969: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
970: end if;
971: raise;
972:
973: end create_user_subscription;
994: no_such_user_exp exception;
995:
996: begin
997: l_module_source := G_MODULE_SOURCE || 'decode_dates: ';
998: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
999: then
1000: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1001: end if;
1002:
996: begin
997: l_module_source := G_MODULE_SOURCE || 'decode_dates: ';
998: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
999: then
1000: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1001: end if;
1002:
1003: open fnd_dates;
1004: fetch fnd_dates into l_rec;
1017: if ((l_rec.l_start_date is not null and l_rec.l_start_date > sysdate)
1018: or
1019: (l_rec.l_end_date is not null and l_rec.l_end_date <= sysdate))
1020: then
1021: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1022: then
1023: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User is disabled');
1024: end if;
1025: x_orclisEnabled := fnd_oid_util.G_DISABLED;
1019: (l_rec.l_end_date is not null and l_rec.l_end_date <= sysdate))
1020: then
1021: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1022: then
1023: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'User is disabled');
1024: end if;
1025: x_orclisEnabled := fnd_oid_util.G_DISABLED;
1026:
1027: else
1027: else
1028: x_orclisEnabled := fnd_oid_util.G_ENABLED;
1029: end if;
1030:
1031: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1032: then
1033: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1034: end if;
1035:
1029: end if;
1030:
1031: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1032: then
1033: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1034: end if;
1035:
1036: exception
1037: when others then
1034: end if;
1035:
1036: exception
1037: when others then
1038: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1039: then
1040: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1041: end if;
1042: raise_application_error(-20001, 'FND_SSO_USER_NOT_FOUND');
1036: exception
1037: when others then
1038: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1039: then
1040: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1041: end if;
1042: raise_application_error(-20001, 'FND_SSO_USER_NOT_FOUND');
1043:
1044: end decode_dates;
1056: l_guid fnd_user.user_guid%type;
1057:
1058: begin
1059: l_module_source := G_MODULE_SOURCE || 'delete_user: ';
1060: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1061: then
1062: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1063: end if;
1064: -- subsNode := 'cn=' || p_cn || ',cn=ACCOUNTS,cn=subscription_data,cn=subscriptions,' || fnd_ldap_util.get_orclappname;
1058: begin
1059: l_module_source := G_MODULE_SOURCE || 'delete_user: ';
1060: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1061: then
1062: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1063: end if;
1064: -- subsNode := 'cn=' || p_cn || ',cn=ACCOUNTS,cn=subscription_data,cn=subscriptions,' || fnd_ldap_util.get_orclappname;
1065: -- result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => subsNode);
1066: l_guid := get_user_guid(p_ldap_session,p_cn);
1065: -- result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => subsNode);
1066: l_guid := get_user_guid(p_ldap_session,p_cn);
1067: delete_user(p_ldap_session,l_guid,result);
1068:
1069: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1070: then
1071: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End res='||result);
1072: end if;
1073: return result;
1067: delete_user(p_ldap_session,l_guid,result);
1068:
1069: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1070: then
1071: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End res='||result);
1072: end if;
1073: return result;
1074:
1075: exception
1073: return result;
1074:
1075: exception
1076: when others then
1077: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1078: then
1079: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1080: end if;
1081: raise;
1075: exception
1076: when others then
1077: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1078: then
1079: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1080: end if;
1081: raise;
1082:
1083: end delete_user_by_name;
1094: l_result pls_integer;
1095:
1096: begin
1097: l_module_source := G_MODULE_SOURCE || 'delete_user_nodes: ';
1098: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1099: then
1100: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1101: end if;
1102:
1096: begin
1097: l_module_source := G_MODULE_SOURCE || 'delete_user_nodes: ';
1098: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1099: then
1100: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1101: end if;
1102:
1103:
1104:
1103:
1104:
1105: usersNode := fnd_ldap_util.get_dn_for_guid(p_orclguid => p_orclguid);
1106:
1107: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1108: then
1109: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'DN for user with GUID::'
1110: ||p_orclguid||' DN::'||usersNode);
1111: end if;
1105: usersNode := fnd_ldap_util.get_dn_for_guid(p_orclguid => p_orclguid);
1106:
1107: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1108: then
1109: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'DN for user with GUID::'
1110: ||p_orclguid||' DN::'||usersNode);
1111: end if;
1112:
1113: l_result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => usersNode);
1111: end if;
1112:
1113: l_result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => usersNode);
1114:
1115: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1116: then
1117: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1118: end if;
1119: return l_result;
1113: l_result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => usersNode);
1114:
1115: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1116: then
1117: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1118: end if;
1119: return l_result;
1120: end delete_user_nodes;
1121: --
1132: l_entry dbms_ldap.message := null;
1133:
1134: begin
1135: l_module_source := G_MODULE_SOURCE || 'delete_user_subscription ';
1136: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1137: then
1138: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1139: end if;
1140:
1134: begin
1135: l_module_source := G_MODULE_SOURCE || 'delete_user_subscription ';
1136: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1137: then
1138: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1139: end if;
1140:
1141: -- delete subcriptions with orclOwnerGUID
1142: subsNode := 'cn=ACCOUNTS,cn=subscription_data,cn=subscriptions,' || fnd_ldap_util.get_orclappname;
1148: l_result := dbms_ldap.delete_s(ld => p_ldap_session, entrydn => 'orclOwnerGUID=' || l_user_guid||','||subsNode);
1149: end if;
1150: end if;
1151:
1152: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1153: then
1154: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1155: end if;
1156: return l_result;
1150: end if;
1151:
1152: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1153: then
1154: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1155: end if;
1156: return l_result;
1157: end delete_user_subscription;
1158: --
1173: begin
1174: l_module_source := G_MODULE_SOURCE || 'delete_uniquemember: ';
1175: -- set default value to failure. change to success when added successfully
1176: retval := fnd_ldap_util.G_FAILURE;
1177: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1178: then
1179: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1180: end if;
1181:
1175: -- set default value to failure. change to success when added successfully
1176: retval := fnd_ldap_util.G_FAILURE;
1177: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1178: then
1179: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1180: end if;
1181:
1182: subsNode := 'cn=ACCOUNTS,cn=subscription_data,cn=subscriptions,' || fnd_ldap_util.get_orclappname;
1183:
1195: end if;
1196:
1197: dbms_ldap.free_mod_array(modptr => modArray);
1198:
1199: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1200: then
1201: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1202: end if;
1203:
1197: dbms_ldap.free_mod_array(modptr => modArray);
1198:
1199: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1200: then
1201: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1202: end if;
1203:
1204: return retval;
1205:
1204: return retval;
1205:
1206: exception
1207: when others then
1208: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1209: then
1210: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1211: end if;
1212: raise;
1206: exception
1207: when others then
1208: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1209: then
1210: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1211: end if;
1212: raise;
1213:
1214: end delete_uniquemember;
1231:
1232: begin
1233: l_module_source := G_MODULE_SOURCE || 'disable_user: ';
1234:
1235: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1236: then
1237: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1238: end if;
1239:
1233: l_module_source := G_MODULE_SOURCE || 'disable_user: ';
1234:
1235: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1236: then
1237: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1238: end if;
1239:
1240: usertype.orclisEnabled := fnd_oid_util.G_DISABLED;
1241: usertype.orclGUID := p_user_guid;
1241: usertype.orclGUID := p_user_guid;
1242:
1243: x_result := update_user(usertype);
1244:
1245: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1246: then
1247: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1248: end if;
1249:
1243: x_result := update_user(usertype);
1244:
1245: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1246: then
1247: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1248: end if;
1249:
1250: if x_result <> fnd_ldap_util.G_SUCCESS then
1251: raise no_such_user_exp;
1253:
1254: exception
1255: when no_such_user_exp then
1256: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
1257: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1258: then
1259: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1260: end if;
1261: x_result := fnd_ldap_util.G_FAILURE;
1255: when no_such_user_exp then
1256: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
1257: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1258: then
1259: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1260: end if;
1261: x_result := fnd_ldap_util.G_FAILURE;
1262: when others then
1263: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1260: end if;
1261: x_result := fnd_ldap_util.G_FAILURE;
1262: when others then
1263: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1264: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1265: then
1266: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1267: end if;
1268: x_result := fnd_ldap_util.G_FAILURE;
1262: when others then
1263: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1264: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1265: then
1266: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1267: end if;
1268: x_result := fnd_ldap_util.G_FAILURE;
1269:
1270: end disable_user;
1290: flag pls_integer;
1291: begin
1292: l_module_source := G_MODULE_SOURCE || 'get_attribute_value: ';
1293:
1294: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1295: then
1296: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
1297: end if;
1298:
1292: l_module_source := G_MODULE_SOURCE || 'get_attribute_value: ';
1293:
1294: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1295: then
1296: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
1297: end if;
1298:
1299: ldapSession := fnd_ldap_util.c_get_oid_session(flag);
1300:
1310: l_attribute_value := l_attrs(0);
1311:
1312: fnd_ldap_util.c_unbind(ldapSession,flag);
1313:
1314: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1315: then
1316: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'End');
1317: end if;
1318: return l_attribute_value;
1312: fnd_ldap_util.c_unbind(ldapSession,flag);
1313:
1314: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1315: then
1316: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'End');
1317: end if;
1318: return l_attribute_value;
1319:
1320: exception
1318: return l_attribute_value;
1319:
1320: exception
1321: when others then
1322: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1323: then
1324: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
1325: end if;
1326: raise;
1320: exception
1321: when others then
1322: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1323: then
1324: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
1325: end if;
1326: raise;
1327:
1328: end get_attribute_value;
1348: ldapSession dbms_ldap.session;
1349: flag pls_integer;
1350: begin
1351: l_module_source := G_MODULE_SOURCE || 'get_user_guid_and_count: ';
1352: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1353: then
1354: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin p_username='||p_user_name);
1355: end if;
1356: search_filter := fnd_oid_plug.getSearchFilter(p_user_name);
1350: begin
1351: l_module_source := G_MODULE_SOURCE || 'get_user_guid_and_count: ';
1352: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1353: then
1354: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin p_username='||p_user_name);
1355: end if;
1356: search_filter := fnd_oid_plug.getSearchFilter(p_user_name);
1357: search_base := '' ; -- going with this , as is what SSO Login does
1358: -- Other options are
1357: search_base := '' ; -- going with this , as is what SSO Login does
1358: -- Other options are
1359: -- search_base := fnd_ldap_util.get_default_realm;
1360: -- search_base := fnd_ldap_util.get_user_base_dn(fnd_ldap_util.get_default_realm);
1361: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1362: then
1363: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' filter : ' || search_filter);
1364: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' search_base : ' || search_base);
1365: end if;
1359: -- search_base := fnd_ldap_util.get_default_realm;
1360: -- search_base := fnd_ldap_util.get_user_base_dn(fnd_ldap_util.get_default_realm);
1361: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1362: then
1363: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' filter : ' || search_filter);
1364: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' search_base : ' || search_base);
1365: end if;
1366:
1367: ldapSession := fnd_ldap_util.c_get_oid_session(flag);
1360: -- search_base := fnd_ldap_util.get_user_base_dn(fnd_ldap_util.get_default_realm);
1361: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1362: then
1363: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' filter : ' || search_filter);
1364: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' search_base : ' || search_base);
1365: end if;
1366:
1367: ldapSession := fnd_ldap_util.c_get_oid_session(flag);
1368:
1368:
1369: l_attrs(0) := 'orclguid';
1370: result := dbms_ldap.search_s(ld => ldapSession, base => search_base, scope => dbms_ldap.SCOPE_SUBTREE, filter => search_filter , attrs => l_attrs, attronly => 0, res => l_message);
1371:
1372: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1373: then
1374: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' dbms_ldap.search_s returned '||result);
1375: end if;
1376: -- get the counter
1370: result := dbms_ldap.search_s(ld => ldapSession, base => search_base, scope => dbms_ldap.SCOPE_SUBTREE, filter => search_filter , attrs => l_attrs, attronly => 0, res => l_message);
1371:
1372: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1373: then
1374: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' dbms_ldap.search_s returned '||result);
1375: end if;
1376: -- get the counter
1377: n := dbms_ldap.count_entries(ldapSession,l_message);
1378: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1374: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' dbms_ldap.search_s returned '||result);
1375: end if;
1376: -- get the counter
1377: n := dbms_ldap.count_entries(ldapSession,l_message);
1378: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1379: then
1380: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' FOUND N='||n);
1381: end if;
1382: if (n=0) then
1376: -- get the counter
1377: n := dbms_ldap.count_entries(ldapSession,l_message);
1378: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1379: then
1380: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' FOUND N='||n);
1381: end if;
1382: if (n=0) then
1383: -- not found
1384: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1380: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' FOUND N='||n);
1381: end if;
1382: if (n=0) then
1383: -- not found
1384: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1385: then
1386: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' NOT FOUND');
1387: end if;
1388: orclguid:=null;
1382: if (n=0) then
1383: -- not found
1384: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1385: then
1386: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' NOT FOUND');
1387: end if;
1388: orclguid:=null;
1389: else
1390: -- get the first entry
1390: -- get the first entry
1391: l_entry := dbms_ldap.first_entry(ldapSession, l_message);
1392: l_attrs := dbms_ldap.get_values(ldapSession, l_entry, 'orclguid');
1393: orclguid := l_attrs(0);
1394: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1395: then
1396: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' FOUND orclguid='||orclguid);
1397: end if;
1398: end if ;
1392: l_attrs := dbms_ldap.get_values(ldapSession, l_entry, 'orclguid');
1393: orclguid := l_attrs(0);
1394: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1395: then
1396: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' FOUND orclguid='||orclguid);
1397: end if;
1398: end if ;
1399:
1400:
1399:
1400:
1401: fnd_ldap_util.c_unbind(ldapSession,flag);
1402:
1403: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1404: then
1405: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, ' END orclguid='||orclguid||' n='||n);
1406: end if;
1407: return orclguid;
1401: fnd_ldap_util.c_unbind(ldapSession,flag);
1402:
1403: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1404: then
1405: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, ' END orclguid='||orclguid||' n='||n);
1406: end if;
1407: return orclguid;
1408:
1409:
1426:
1427: begin
1428: l_module_source := G_MODULE_SOURCE || 'get_user_guid: ';
1429: -- retval := fnd_ldap_util.G_FAILURE;
1430: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1431: then
1432: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1433: end if;
1434:
1428: l_module_source := G_MODULE_SOURCE || 'get_user_guid: ';
1429: -- retval := fnd_ldap_util.G_FAILURE;
1430: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1431: then
1432: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1433: end if;
1434:
1435: ldapSession := p_ldap_session;
1436: --usersNodes := fnd_ldap_util.get_users_nodes;
1437: --usersNode := 'cn=' || p_user_name || ',' || usersNodes(0);
1438: searchBase := fnd_oid_plug.getSearchBase(p_user_name);
1439: searchFilter := fnd_oid_plug.getSearchFilter(p_user_name);
1440:
1441: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1442: then
1443: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'base='||searchBase||' ('||searchFilter||')');
1444: end if;
1445:
1439: searchFilter := fnd_oid_plug.getSearchFilter(p_user_name);
1440:
1441: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1442: then
1443: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'base='||searchBase||' ('||searchFilter||')');
1444: end if;
1445:
1446: l_attrs(0) := 'orclguid';
1447: result := dbms_ldap.search_s(ld => ldapSession, base => searchBase, scope => dbms_ldap.SCOPE_SUBTREE, filter => searchFilter, attrs => l_attrs, attronly => 0, res => l_message);
1456: end if;
1457:
1458: l_user_guid := orclguid;
1459:
1460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1461: then
1462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'GUID found = ' || l_user_guid);
1463: end if;
1464:
1458: l_user_guid := orclguid;
1459:
1460: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1461: then
1462: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'GUID found = ' || l_user_guid);
1463: end if;
1464:
1465: --result := fnd_ldap_util.unbind(ldapSession);
1466:
1463: end if;
1464:
1465: --result := fnd_ldap_util.unbind(ldapSession);
1466:
1467: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1468: then
1469: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1470: end if;
1471: return l_user_guid;
1465: --result := fnd_ldap_util.unbind(ldapSession);
1466:
1467: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1468: then
1469: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1470: end if;
1471: return l_user_guid;
1472:
1473: exception
1471: return l_user_guid;
1472:
1473: exception
1474: when others then
1475: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1476: then
1477: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1478: -- print stack just for 7306960
1479: result:= -99;
1473: exception
1474: when others then
1475: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1476: then
1477: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1478: -- print stack just for 7306960
1479: result:= -99;
1480: dummy := fnd_ldap_util.c_get_oid_session(result);
1481: end if;
1511: l_nickname varchar2(256);
1512:
1513: begin
1514: l_module_source := G_MODULE_SOURCE || 'link_user: ';
1515: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1516: then
1517: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1518: end if;
1519:
1513: begin
1514: l_module_source := G_MODULE_SOURCE || 'link_user: ';
1515: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1516: then
1517: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1518: end if;
1519:
1520:
1521: l_orclguid := get_user_guid(p_user_name);
1548: fnd_message.set_name('FND', 'FND_SSO_USER_NOT_FOUND');
1549: x_result := fnd_ldap_util.G_FAILURE;
1550: end if;
1551:
1552: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1553: then
1554: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1555: end if;
1556:
1550: end if;
1551:
1552: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1553: then
1554: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1555: end if;
1556:
1557: exception
1558: when others then
1555: end if;
1556:
1557: exception
1558: when others then
1559: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1560: then
1561: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1562: end if;
1563: raise;
1557: exception
1558: when others then
1559: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1560: then
1561: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1562: end if;
1563: raise;
1564:
1565: end link_user;
1575: num_attributes number;
1576:
1577: begin
1578: l_module_source := G_MODULE_SOURCE || 'process_attributes: ';
1579: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1580: then
1581: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1582: end if;
1583:
1577: begin
1578: l_module_source := G_MODULE_SOURCE || 'process_attributes: ';
1579: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1580: then
1581: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1582: end if;
1583:
1584: num_attributes := 0;
1585:
1683: x_att_values(num_attributes) := p_ldap_user.orclActiveEndDate;
1684: num_attributes := num_attributes + 1;
1685: end if;
1686:
1687: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1688: then
1689: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1690: end if;
1691:
1685: end if;
1686:
1687: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1688: then
1689: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1690: end if;
1691:
1692: return num_attributes;
1693:
1692: return num_attributes;
1693:
1694: exception
1695: when others then
1696: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1697: then
1698: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1699: end if;
1700: raise;
1694: exception
1695: when others then
1696: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1697: then
1698: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1699: end if;
1700: raise;
1701:
1702: end process_attributes;
1723: dummy pls_integer;
1724:
1725: begin
1726: l_module_source := G_MODULE_SOURCE || 'unlink_user: ';
1727: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1728: then
1729: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1730: end if;
1731:
1725: begin
1726: l_module_source := G_MODULE_SOURCE || 'unlink_user: ';
1727: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1728: then
1729: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1730: end if;
1731:
1732: open linked_users;
1733: fetch linked_users into l_rec;
1737: -- no other user linked
1738: if (not l_found)
1739: then
1740:
1741: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1742: then
1743: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'No other FND users linked to this OID User');
1744: end if;
1745: l_user_exists := user_exists_by_guid( p_user_guid);
1739: then
1740:
1741: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1742: then
1743: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'No other FND users linked to this OID User');
1744: end if;
1745: l_user_exists := user_exists_by_guid( p_user_guid);
1746:
1747: if (l_user_exists = fnd_ldap_util.G_SUCCESS) then
1759:
1760: -- other users linked
1761: else
1762:
1763: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1764: then
1765: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Other FND users linked to this OID User');
1766: end if;
1767:
1761: else
1762:
1763: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1764: then
1765: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Other FND users linked to this OID User');
1766: end if;
1767:
1768: x_result := fnd_ldap_util.G_FAILURE;
1769: fnd_message.set_name ('FND', 'FND_SSO_USER_MULT_LINKED');
1769: fnd_message.set_name ('FND', 'FND_SSO_USER_MULT_LINKED');
1770:
1771: end if;
1772: if ( l_ldap_session is not null) then fnd_ldap_util.c_unbind(l_ldap_session,dummy); end if ;
1773: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1774: then
1775: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1776: end if;
1777:
1771: end if;
1772: if ( l_ldap_session is not null) then fnd_ldap_util.c_unbind(l_ldap_session,dummy); end if ;
1773: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1774: then
1775: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1776: end if;
1777:
1778: exception
1779: when others then
1776: end if;
1777:
1778: exception
1779: when others then
1780: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1781: then
1782: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1783: end if;
1784: raise;
1778: exception
1779: when others then
1780: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1781: then
1782: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1783: end if;
1784: raise;
1785:
1786: end unlink_user;
1838: begin
1839:
1840: l_module_source := G_MODULE_SOURCE || 'update_user[proc]: ';
1841:
1842: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1843: then
1844: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1845: end if;
1846:
1840: l_module_source := G_MODULE_SOURCE || 'update_user[proc]: ';
1841:
1842: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1843: then
1844: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
1845: end if;
1846:
1847: /** to do - what if there are multiple linked users ? **/
1848:
1850: x_orclisEnabled => l_orclisEnabled,
1851: x_user_id => l_user_id);
1852:
1853:
1854: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1855: then
1856: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
1857: end if;
1858:
1852:
1853:
1854: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1855: then
1856: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
1857: end if;
1858:
1859: l_to_synch := TRUE;
1860: fnd_profile.get_specific(
1864: defined_z => l_profile_defined);
1865:
1866: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL)
1867: then
1868: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1869: then
1870: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1871: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
1872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1866: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL)
1867: then
1868: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1869: then
1870: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1871: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
1872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1873: 'Local user dont sych '|| p_user_name);
1874: end if;
1868: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1869: then
1870: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1871: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
1872: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1873: 'Local user dont sych '|| p_user_name);
1874: end if;
1875: l_to_synch := FALSE;
1876: else
1880: defined_z => l_profile_defined);
1881:
1882: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
1883: then
1884: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1885: then
1886: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1887: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
1888: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1882: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
1883: then
1884: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1885: then
1886: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1887: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
1888: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1889: 'Synch profile is disabled for user ...dont sych '|| p_user_name);
1890: end if;
1884: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1885: then
1886: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1887: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
1888: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1889: 'Synch profile is disabled for user ...dont sych '|| p_user_name);
1890: end if;
1891: l_to_synch := FALSE;
1892: else
1923: x_result := update_user(usertype);
1924:
1925: else
1926: x_result := fnd_ldap_util.G_SUCCESS;
1927: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1928: then
1929: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1930: 'User is a local user or synch is disabled for this user.');
1931: end if;
1925: else
1926: x_result := fnd_ldap_util.G_SUCCESS;
1927: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1928: then
1929: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
1930: 'User is a local user or synch is disabled for this user.');
1931: end if;
1932: end if;
1933:
1930: 'User is a local user or synch is disabled for this user.');
1931: end if;
1932: end if;
1933:
1934: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1935: then
1936: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1937: end if;
1938:
1932: end if;
1933:
1934: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1935: then
1936: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
1937: end if;
1938:
1939: if x_result <> fnd_ldap_util.G_SUCCESS then
1940: raise no_such_user_exp;
1952:
1953: exception
1954: when no_such_user_exp then
1955: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
1956: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1957: then
1958: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1959: end if;
1960: x_result := fnd_ldap_util.G_FAILURE;
1954: when no_such_user_exp then
1955: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
1956: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1957: then
1958: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1959: end if;
1960: x_result := fnd_ldap_util.G_FAILURE;
1961: when others then
1962: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1959: end if;
1960: x_result := fnd_ldap_util.G_FAILURE;
1961: when others then
1962: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1963: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1964: then
1965: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1966: end if;
1967: x_result := fnd_ldap_util.G_FAILURE;
1961: when others then
1962: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
1963: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
1964: then
1965: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
1966: end if;
1967: x_result := fnd_ldap_util.G_FAILURE;
1968:
1969: end update_user;
1996:
1997: begin
1998: l_module_source := G_MODULE_SOURCE || 'update_user: ';
1999:
2000: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2001: then
2002: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2003: end if;
2004:
1998: l_module_source := G_MODULE_SOURCE || 'update_user: ';
1999:
2000: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2001: then
2002: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2003: end if;
2004:
2005: if (p_password is not null) then
2006: change_password(p_user_guid,
2017: x_orclisEnabled => l_orclisEnabled,
2018: x_user_id => l_user_id);
2019:
2020:
2021: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2022: then
2023: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
2024: end if;
2025:
2019:
2020:
2021: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2022: then
2023: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'USER id:: '||l_user_id);
2024: end if;
2025:
2026: l_to_synch := TRUE;
2027: fnd_profile.get_specific(
2031: defined_z => l_profile_defined);
2032:
2033: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL)
2034: then
2035: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2036: then
2037: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2038: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
2039: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2033: if (not l_profile_defined or l_local_login = fnd_oid_util.G_LOCAL)
2034: then
2035: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2036: then
2037: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2038: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
2039: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2040: 'Local user dont sych '|| p_user_name);
2041: end if;
2035: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2036: then
2037: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2038: 'value of APPS_SSO_LOCAL_LOGIN:: '|| l_local_login);
2039: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2040: 'Local user dont sych '|| p_user_name);
2041: end if;
2042: l_to_synch := FALSE;
2043: else
2047: defined_z => l_profile_defined);
2048:
2049: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
2050: then
2051: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2052: then
2053: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2054: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
2055: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2049: if (not l_profile_defined or l_allow_sync = fnd_oid_util.G_N)
2050: then
2051: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2052: then
2053: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2054: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
2055: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2056: 'Synch profile is disabled for user ...dont sych '|| p_user_name);
2057: end if;
2051: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2052: then
2053: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2054: 'value of APPS_SSO_LDAP_SYNC '|| l_allow_sync);
2055: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2056: 'Synch profile is disabled for user ...dont sych '|| p_user_name);
2057: end if;
2058: l_to_synch := FALSE;
2059: else
2086: x_result := update_user(usertype);
2087:
2088: else
2089: x_result := fnd_ldap_util.G_SUCCESS;
2090: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2091: then
2092: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2093: 'User is a local user or synch is disabled for this user.');
2094: end if;
2088: else
2089: x_result := fnd_ldap_util.G_SUCCESS;
2090: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2091: then
2092: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source,
2093: 'User is a local user or synch is disabled for this user.');
2094: end if;
2095: end if;
2096:
2093: 'User is a local user or synch is disabled for this user.');
2094: end if;
2095: end if;
2096:
2097: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2098: then
2099: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2100: end if;
2101:
2095: end if;
2096:
2097: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2098: then
2099: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2100: end if;
2101:
2102: if x_result <> fnd_ldap_util.G_SUCCESS then
2103: raise no_such_user_exp;
2115:
2116: exception
2117: when no_such_user_exp then
2118: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
2119: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2120: then
2121: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2122: end if;
2123: x_result := fnd_ldap_util.G_FAILURE;
2117: when no_such_user_exp then
2118: fnd_message.set_name ('FND', 'FND_SSO_USER_NOT_FOUND');
2119: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2120: then
2121: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2122: end if;
2123: x_result := fnd_ldap_util.G_FAILURE;
2124: when others then
2125: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
2122: end if;
2123: x_result := fnd_ldap_util.G_FAILURE;
2124: when others then
2125: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
2126: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2127: then
2128: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2129: end if;
2130: --x_result := fnd_ldap_util.G_FAILURE;
2124: when others then
2125: fnd_message.set_name ('FND', 'FND_SSO_UNEXP_ERROR');
2126: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2127: then
2128: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2129: end if;
2130: --x_result := fnd_ldap_util.G_FAILURE;
2131: -- bug 4573677
2132: raise;
2160: begin
2161: l_module_source := G_MODULE_SOURCE || 'update_user: ';
2162: -- set default value to failure. change to success when user updated successfully
2163: retval := fnd_ldap_util.G_FAILURE;
2164: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2165: then
2166: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2167: end if;
2168:
2162: -- set default value to failure. change to success when user updated successfully
2163: retval := fnd_ldap_util.G_FAILURE;
2164: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2165: then
2166: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2167: end if;
2168:
2169: /* result := user_exists(username => p_ldap_user.sn); */
2170: result := user_exists_by_guid(p_ldap_user.orclGUID);
2177: x_atts => l_atts, x_att_values => l_att_values);
2178: if (num_attributes>0)
2179: then
2180: modArray := dbms_ldap.create_mod_array(num => num_attributes);
2181: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2182: then
2183: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' num_attributes='||num_attributes);
2184: end if;
2185:
2179: then
2180: modArray := dbms_ldap.create_mod_array(num => num_attributes);
2181: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2182: then
2183: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' num_attributes='||num_attributes);
2184: end if;
2185:
2186: for i in 0..l_atts.count-1 loop
2187: modtype := l_atts(i);
2195: -- 7306960
2196: -- fnd_ldap_util.c_unbind(ldapSession,flag);
2197: else
2198: retval :=fnd_ldap_util.G_SUCCESS;
2199: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2200: then
2201: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' num_attributes=0 -> No changes to OiD');
2202: end if;
2203: end if;
2197: else
2198: retval :=fnd_ldap_util.G_SUCCESS;
2199: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2200: then
2201: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, ' num_attributes=0 -> No changes to OiD');
2202: end if;
2203: end if;
2204: -- bug 7306960
2205: fnd_ldap_util.c_unbind(ldapSession,flag);
2204: -- bug 7306960
2205: fnd_ldap_util.c_unbind(ldapSession,flag);
2206: end if;
2207:
2208: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2209: then
2210: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2211: end if;
2212:
2206: end if;
2207:
2208: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2209: then
2210: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2211: end if;
2212:
2213: return retval;
2214:
2213: return retval;
2214:
2215: exception
2216: when others then
2217: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2218: then
2219: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2220: end if;
2221: raise;
2215: exception
2216: when others then
2217: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2218: then
2219: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2220: end if;
2221: raise;
2222:
2223: end update_user;
2247: begin
2248: l_module_source := G_MODULE_SOURCE || 'update_user: ';
2249: -- set default value to failure. change to success when user updated successfully
2250: retval := fnd_ldap_util.G_FAILURE;
2251: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2252: then
2253: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2254: end if;
2255:
2249: -- set default value to failure. change to success when user updated successfully
2250: retval := fnd_ldap_util.G_FAILURE;
2251: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2252: then
2253: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2254: end if;
2255:
2256: result := user_exists_by_guid( p_ldap_user.orclGUID);
2257:
2281: dbms_ldap.free_mod_array(modptr => modArray);
2282: result := fnd_ldap_util.unbind(ldapSession);
2283: end if;
2284:
2285: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2286: then
2287: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2288: end if;
2289:
2283: end if;
2284:
2285: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2286: then
2287: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2288: end if;
2289:
2290: return retval;
2291:
2290: return retval;
2291:
2292: exception
2293: when others then
2294: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2295: then
2296: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2297: end if;
2298: raise;
2292: exception
2293: when others then
2294: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2295: then
2296: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2297: end if;
2298: raise;
2299:
2300: end update_user;
2311: begin
2312: l_module_source := G_MODULE_SOURCE || 'update_user_nodes: ';
2313: -- set default value to failure. change to success when user created successfully
2314: retval := fnd_ldap_util.G_FAILURE;
2315: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2316: then
2317: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2318: end if;
2319:
2313: -- set default value to failure. change to success when user created successfully
2314: retval := fnd_ldap_util.G_FAILURE;
2315: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2316: then
2317: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2318: end if;
2319:
2320: usersNode := fnd_ldap_util.get_dn_for_guid(p_orclguid, p_ldap_session);
2321: -- dbms_ldap.use_exception := true;
2325: if (retval = dbms_ldap.SUCCESS) then
2326: retval := fnd_ldap_util.G_SUCCESS;
2327: end if;
2328:
2329: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2330: then
2331: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2332: end if;
2333: return retval;
2327: end if;
2328:
2329: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2330: then
2331: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2332: end if;
2333: return retval;
2334:
2335: exception
2333: return retval;
2334:
2335: exception
2336: when others then
2337: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2338: then
2339: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
2340: end if;
2341: raise;
2335: exception
2336: when others then
2337: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2338: then
2339: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, sqlerrm);
2340: end if;
2341: raise;
2342:
2343: end update_user_nodes;
2368:
2369: begin
2370: l_module_source := G_MODULE_SOURCE || 'user_exists: ';
2371: retval := fnd_ldap_util.G_FAILURE;
2372: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2373: then
2374: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2375: end if;
2376:
2370: l_module_source := G_MODULE_SOURCE || 'user_exists: ';
2371: retval := fnd_ldap_util.G_FAILURE;
2372: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2373: then
2374: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
2375: end if;
2376:
2377: guid := get_user_guid(p_user_name);
2378: if (guid is not null ) then
2381: retval :=fnd_ldap_util.G_FAILURE;
2382: end if;
2383:
2384:
2385: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2386: then
2387: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval=' || retval);
2388: end if;
2389:
2383:
2384:
2385: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2386: then
2387: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval=' || retval);
2388: end if;
2389:
2390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2391: then
2386: then
2387: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'retval=' || retval);
2388: end if;
2389:
2390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2391: then
2392: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2393: end if;
2394:
2388: end if;
2389:
2390: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2391: then
2392: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'End');
2393: end if;
2394:
2395: return retval;
2396:
2395: return retval;
2396:
2397: exception
2398: when others then
2399: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2400: then
2401: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2402: end if;
2403: raise;
2397: exception
2398: when others then
2399: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2400: then
2401: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, sqlerrm);
2402: end if;
2403: raise;
2404:
2405: end user_exists;
2426: result boolean;
2427: l_module_source varchar2(256);
2428: begin
2429: l_module_source := G_MODULE_SOURCE || 'comparePassword: ';
2430: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2431: then
2432: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'BEGIN DN:'||user_dn);
2433: end if;
2434: l_result := dbms_ldap.compare_s(ld => ldapSession, dn => user_dn, attr => 'userpassword', value => p_password);
2428: begin
2429: l_module_source := G_MODULE_SOURCE || 'comparePassword: ';
2430: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2431: then
2432: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'BEGIN DN:'||user_dn);
2433: end if;
2434: l_result := dbms_ldap.compare_s(ld => ldapSession, dn => user_dn, attr => 'userpassword', value => p_password);
2435: result := l_result= dbms_ldap.COMPARE_TRUE;
2436: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2432: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'BEGIN DN:'||user_dn);
2433: end if;
2434: l_result := dbms_ldap.compare_s(ld => ldapSession, dn => user_dn, attr => 'userpassword', value => p_password);
2435: result := l_result= dbms_ldap.COMPARE_TRUE;
2436: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2437: then
2438: if (result) then
2439: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: Yes');
2440: else
2435: result := l_result= dbms_ldap.COMPARE_TRUE;
2436: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2437: then
2438: if (result) then
2439: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: Yes');
2440: else
2441: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: NO');
2442:
2443: end if;
2437: then
2438: if (result) then
2439: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: Yes');
2440: else
2441: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: NO');
2442:
2443: end if;
2444: end if;
2445:
2444: end if;
2445:
2446: return result;
2447: exception when others then
2448: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2449: then
2450: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, 'Exception: '||sqlcode||' - '||sqlerrm);
2451: end if;
2452: return false;
2446: return result;
2447: exception when others then
2448: if (fnd_log.LEVEL_EXCEPTION >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2449: then
2450: fnd_log.string(fnd_log.LEVEL_EXCEPTION, l_module_source, 'Exception: '||sqlcode||' - '||sqlerrm);
2451: end if;
2452: return false;
2453:
2454: end comparePassword;
2476:
2477: begin
2478: l_module_source := G_MODULE_SOURCE || 'validate_login: ';
2479:
2480: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2481: then
2482: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
2483: end if;
2484:
2478: l_module_source := G_MODULE_SOURCE || 'validate_login: ';
2479:
2480: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2481: then
2482: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
2483: end if;
2484:
2485:
2486: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2482: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'Begin');
2483: end if;
2484:
2485:
2486: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2487: then
2488: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Username: '||p_user_name);
2489: end if;
2490:
2484:
2485:
2486: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2487: then
2488: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Username: '||p_user_name);
2489: end if;
2490:
2491: if (p_user_name is null or p_password is null ) then
2492: fnd_message.set_name('FND','FND_SSO_USER_PASSWD_EMPTY');
2489: end if;
2490:
2491: if (p_user_name is null or p_password is null ) then
2492: fnd_message.set_name('FND','FND_SSO_USER_PASSWD_EMPTY');
2493: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2494: then
2495: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: refusing to validate empty username and/or password');
2496: end if;
2497: return fnd_ldap_util.G_FAILURE;
2491: if (p_user_name is null or p_password is null ) then
2492: fnd_message.set_name('FND','FND_SSO_USER_PASSWD_EMPTY');
2493: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2494: then
2495: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: refusing to validate empty username and/or password');
2496: end if;
2497: return fnd_ldap_util.G_FAILURE;
2498: end if;
2499:
2500: -- Find the DN of the linked guid
2501: begin
2502: select user_guid into l_user_guid from fnd_user where user_name=p_user_name;
2503: if (l_user_guid is null ) then
2504: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2505: then
2506: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: Null guid in FND_USER for: '||p_user_name);
2507: end if;
2508: fnd_message.set_name('FND','FND_SSO_NOT_LINKED');
2502: select user_guid into l_user_guid from fnd_user where user_name=p_user_name;
2503: if (l_user_guid is null ) then
2504: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2505: then
2506: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: Null guid in FND_USER for: '||p_user_name);
2507: end if;
2508: fnd_message.set_name('FND','FND_SSO_NOT_LINKED');
2509: return fnd_ldap_util.G_FAILURE;
2510: end if;
2508: fnd_message.set_name('FND','FND_SSO_NOT_LINKED');
2509: return fnd_ldap_util.G_FAILURE;
2510: end if;
2511: exception when no_data_found then
2512: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2513: then
2514: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: user not found');
2515: end if;
2516: fnd_message.set_name('FND','FND_SSO_LOGIN_FAILED'); -- do no disclusre the real causeL
2510: end if;
2511: exception when no_data_found then
2512: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2513: then
2514: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: user not found');
2515: end if;
2516: fnd_message.set_name('FND','FND_SSO_LOGIN_FAILED'); -- do no disclusre the real causeL
2517: return fnd_ldap_util.G_FAILURE;
2518: when others then
2515: end if;
2516: fnd_message.set_name('FND','FND_SSO_LOGIN_FAILED'); -- do no disclusre the real causeL
2517: return fnd_ldap_util.G_FAILURE;
2518: when others then
2519: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2520: then
2521: fnd_log.string(fnd_log.LEVEL_UNEXPECTED ,l_module_source, 'END with exception: '||sqlcode||'-'||sqlerrm);
2522: end if;
2523: fnd_message.set_name('FND','FND-9914'); -- unexpected error
2517: return fnd_ldap_util.G_FAILURE;
2518: when others then
2519: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2520: then
2521: fnd_log.string(fnd_log.LEVEL_UNEXPECTED ,l_module_source, 'END with exception: '||sqlcode||'-'||sqlerrm);
2522: end if;
2523: fnd_message.set_name('FND','FND-9914'); -- unexpected error
2524: return fnd_ldap_util.G_FAILURE;
2525: end;
2523: fnd_message.set_name('FND','FND-9914'); -- unexpected error
2524: return fnd_ldap_util.G_FAILURE;
2525: end;
2526:
2527: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2528: then
2529: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'GUID:'||l_user_guid);
2530: end if;
2531:
2525: end;
2526:
2527: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2528: then
2529: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'GUID:'||l_user_guid);
2530: end if;
2531:
2532:
2533: -- Obtain the user DN using the GUID
2533: -- Obtain the user DN using the GUID
2534: begin
2535: user_dn := fnd_Ldap_util.get_dn_for_guid(l_user_guid); -- may raise no data found for invalid guids
2536: exception when no_data_found then
2537: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2538: then
2539: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Guid['||l_user_guid||'] for '||p_user_name||' is not a valid guid');
2540: end if;
2541: fnd_message.set_name('FND','FND_SSO_USER_NOT_FOUND'); -- Carefull, this is INVALID GUID message, wrong acronym though
2535: user_dn := fnd_Ldap_util.get_dn_for_guid(l_user_guid); -- may raise no data found for invalid guids
2536: exception when no_data_found then
2537: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2538: then
2539: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Guid['||l_user_guid||'] for '||p_user_name||' is not a valid guid');
2540: end if;
2541: fnd_message.set_name('FND','FND_SSO_USER_NOT_FOUND'); -- Carefull, this is INVALID GUID message, wrong acronym though
2542: return fnd_ldap_util.G_FAILURE;
2543: end;
2541: fnd_message.set_name('FND','FND_SSO_USER_NOT_FOUND'); -- Carefull, this is INVALID GUID message, wrong acronym though
2542: return fnd_ldap_util.G_FAILURE;
2543: end;
2544:
2545: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2546: then
2547: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'DN:'||user_dn);
2548: end if;
2549:
2543: end;
2544:
2545: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2546: then
2547: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'DN:'||user_dn);
2548: end if;
2549:
2550:
2551:
2552: l_host := fnd_preference.get(FND_LDAP_UTIL.G_INTERNAL, FND_LDAP_UTIL.G_LDAP_SYNCH, FND_LDAP_UTIL.G_HOST);
2553: l_port := fnd_preference.get(FND_LDAP_UTIL.G_INTERNAL, FND_LDAP_UTIL.G_LDAP_SYNCH, FND_LDAP_UTIL.G_PORT);
2554:
2555: if (l_host is null or l_port is null) then
2556: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2557: then
2558: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Invalid OiD Setup: host:'||l_host||' port:'||l_port);
2559: end if;
2560:
2554:
2555: if (l_host is null or l_port is null) then
2556: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2557: then
2558: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Invalid OiD Setup: host:'||l_host||' port:'||l_port);
2559: end if;
2560:
2561: fnd_message.set_name('FND','FND-9903'); -- OID setup is incomplete
2562: return fnd_ldap_util.G_FAILURE;
2567: if (l_ldap_auth>0) then
2568: l_db_wlt_url := fnd_preference.get(FND_LDAP_UTIL.G_INTERNAL, FND_LDAP_UTIL.G_LDAP_SYNCH, FND_LDAP_UTIL.G_DBWALLETDIR);
2569: l_db_wlt_pwd := fnd_preference.eget(FND_LDAP_UTIL.G_INTERNAL, FND_LDAP_UTIL.G_LDAP_SYNCH, FND_LDAP_UTIL.G_DBWALLETPASS, FND_LDAP_UTIL.G_LDAP_PWD);
2570: if (l_db_wlt_url is null or l_db_wlt_pwd is null) then
2571: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2572: then
2573: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Invalid Wallet Setup: authLEvel:'
2574: ||l_ldap_auth||' url:'||l_db_wlt_url||' pwd:'||l_db_wlt_url);
2575: end if;
2569: l_db_wlt_pwd := fnd_preference.eget(FND_LDAP_UTIL.G_INTERNAL, FND_LDAP_UTIL.G_LDAP_SYNCH, FND_LDAP_UTIL.G_DBWALLETPASS, FND_LDAP_UTIL.G_LDAP_PWD);
2570: if (l_db_wlt_url is null or l_db_wlt_pwd is null) then
2571: if (fnd_log.LEVEL_UNEXPECTED >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2572: then
2573: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Invalid Wallet Setup: authLEvel:'
2574: ||l_ldap_auth||' url:'||l_db_wlt_url||' pwd:'||l_db_wlt_url);
2575: end if;
2576:
2577: fnd_message.set_name('FND','FND-9903'); -- OID setup is incomplete
2577: fnd_message.set_name('FND','FND-9903'); -- OID setup is incomplete
2578: return fnd_ldap_util.G_FAILURE;
2579: end if;
2580: else
2581: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2582: then
2583: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'WARNING: NON-SSL connection to OiD, check that the Net is secure');
2584: end if;
2585: end if;
2579: end if;
2580: else
2581: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2582: then
2583: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'WARNING: NON-SSL connection to OiD, check that the Net is secure');
2584: end if;
2585: end if;
2586:
2587: dbms_ldap.use_exception := TRUE;
2589: begin
2590: begin
2591: ldapSession := DBMS_LDAP.init(l_host, l_port);
2592: exception when dbms_ldap.init_failed then
2593: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2594: then
2595: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Cannot contact OID (init failed) at '||l_host||':'||l_port||':'||sqlcode||'-'||sqlerrm);
2596: end if;
2597: fnd_message.set_name('FND','FND_SSO_SYSTEM_NOT_AVAIL');
2591: ldapSession := DBMS_LDAP.init(l_host, l_port);
2592: exception when dbms_ldap.init_failed then
2593: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2594: then
2595: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'Cannot contact OID (init failed) at '||l_host||':'||l_port||':'||sqlcode||'-'||sqlerrm);
2596: end if;
2597: fnd_message.set_name('FND','FND_SSO_SYSTEM_NOT_AVAIL');
2598: return fnd_ldap_util.G_FAILURE;
2599: when others then
2604:
2605: begin
2606: l_retval := dbms_ldap.open_ssl(ldapSession, 'file:'||l_db_wlt_url, l_db_wlt_pwd, l_ldap_auth);
2607: exception when others then
2608: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2609: then
2610: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source,' Cannot establish SSL channel to OiD: '||sqlcode||'-'||sqlerrm);
2611: end if;
2612:
2606: l_retval := dbms_ldap.open_ssl(ldapSession, 'file:'||l_db_wlt_url, l_db_wlt_pwd, l_ldap_auth);
2607: exception when others then
2608: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2609: then
2610: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source,' Cannot establish SSL channel to OiD: '||sqlcode||'-'||sqlerrm);
2611: end if;
2612:
2613: fnd_message.set_name('FND','FND_SSO_INV_AUTH_MODE'); -- Invalid SSL authcode... it is enouggh description
2614: return fnd_ldap_util.G_FAILURE;
2613: fnd_message.set_name('FND','FND_SSO_INV_AUTH_MODE'); -- Invalid SSL authcode... it is enouggh description
2614: return fnd_ldap_util.G_FAILURE;
2615: end;
2616:
2617: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2618: then
2619: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Excellent!! Using SSL to contact OiD');
2620: end if;
2621: end if;
2615: end;
2616:
2617: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2618: then
2619: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Excellent!! Using SSL to contact OiD');
2620: end if;
2621: end if;
2622:
2623:
2633: -- first we check if the password is real,
2634:
2635: if (instr(l_message,':9000:')>0 )then
2636: fnd_message.set_name('FND','FND_SSO_PASSWORD_EXPIRED'); --Your account is locked
2637: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2638: then
2639: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account password expired ');
2640: end if;
2641: elsif (instr(l_message,':9001:')>0 )then
2635: if (instr(l_message,':9000:')>0 )then
2636: fnd_message.set_name('FND','FND_SSO_PASSWORD_EXPIRED'); --Your account is locked
2637: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2638: then
2639: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account password expired ');
2640: end if;
2641: elsif (instr(l_message,':9001:')>0 )then
2642: fnd_message.set_name('FND','FND_SSO_LOCKED'); --Your account is locked
2643: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2639: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account password expired ');
2640: end if;
2641: elsif (instr(l_message,':9001:')>0 )then
2642: fnd_message.set_name('FND','FND_SSO_LOCKED'); --Your account is locked
2643: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2644: then
2645: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account locked');
2646: end if;
2647:
2641: elsif (instr(l_message,':9001:')>0 )then
2642: fnd_message.set_name('FND','FND_SSO_LOCKED'); --Your account is locked
2643: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2644: then
2645: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account locked');
2646: end if;
2647:
2648: else
2649: if (comparePassword(ldapSession, user_dn , p_password) )then
2646: end if;
2647:
2648: else
2649: if (comparePassword(ldapSession, user_dn , p_password) )then
2650: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2651: then
2652: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD password match but ..');
2653: end if;
2654: if (instr(l_message,':9050:')>0) then
2648: else
2649: if (comparePassword(ldapSession, user_dn , p_password) )then
2650: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2651: then
2652: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD password match but ..');
2653: end if;
2654: if (instr(l_message,':9050:')>0) then
2655: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2656: then
2651: then
2652: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD password match but ..');
2653: end if;
2654: if (instr(l_message,':9050:')>0) then
2655: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2656: then
2657: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is disabled');
2658: end if;
2659: fnd_message.set_name('FND','FND_SSO_USER_DISABLED'); --Your account is disabled
2653: end if;
2654: if (instr(l_message,':9050:')>0) then
2655: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2656: then
2657: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is disabled');
2658: end if;
2659: fnd_message.set_name('FND','FND_SSO_USER_DISABLED'); --Your account is disabled
2660: elsif (instr(l_message,':9053:')>0) then
2661: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2657: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is disabled');
2658: end if;
2659: fnd_message.set_name('FND','FND_SSO_USER_DISABLED'); --Your account is disabled
2660: elsif (instr(l_message,':9053:')>0) then
2661: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2662: then
2663: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is not active: today is out of [start,end] dates ');
2664: end if;
2665: fnd_message.set_name('FND','FND_SSO_NOT_ACTIVE'); --Your account not active. Either past end_date or future start_date
2659: fnd_message.set_name('FND','FND_SSO_USER_DISABLED'); --Your account is disabled
2660: elsif (instr(l_message,':9053:')>0) then
2661: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2662: then
2663: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is not active: today is out of [start,end] dates ');
2664: end if;
2665: fnd_message.set_name('FND','FND_SSO_NOT_ACTIVE'); --Your account not active. Either past end_date or future start_date
2666: else --unknown reason
2667: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2663: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD account is not active: today is out of [start,end] dates ');
2664: end if;
2665: fnd_message.set_name('FND','FND_SSO_NOT_ACTIVE'); --Your account not active. Either past end_date or future start_date
2666: else --unknown reason
2667: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2668: then
2669: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'cannot bind because:'||l_message);
2670: end if;
2671: -- maybe is not the reason, but it is enough for return , I guess
2665: fnd_message.set_name('FND','FND_SSO_NOT_ACTIVE'); --Your account not active. Either past end_date or future start_date
2666: else --unknown reason
2667: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2668: then
2669: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'cannot bind because:'||l_message);
2670: end if;
2671: -- maybe is not the reason, but it is enough for return , I guess
2672: fnd_message.set_name('FND','FND_APPL_LOGIN_FAILED'); -- invalid username password
2673: end if;
2672: fnd_message.set_name('FND','FND_APPL_LOGIN_FAILED'); -- invalid username password
2673: end if;
2674:
2675: else
2676: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2677: then
2678: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD password did not match');
2679: end if;
2680: -- maybe is not the reason, but it is enough for return , I guess
2674:
2675: else
2676: if (fnd_log.LEVEL_STATEMENT>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2677: then
2678: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'OiD password did not match');
2679: end if;
2680: -- maybe is not the reason, but it is enough for return , I guess
2681: fnd_message.set_name('FND','FND_APPL_LOGIN_FAILED'); -- invalid username password
2682: end if;
2680: -- maybe is not the reason, but it is enough for return , I guess
2681: fnd_message.set_name('FND','FND_APPL_LOGIN_FAILED'); -- invalid username password
2682: end if;
2683: end if;
2684: if (fnd_log.LEVEL_PROCEDURE>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2685: then
2686: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: bind error: '||l_message);
2687: end if;
2688: return fnd_ldap_util.G_FAILURE;
2682: end if;
2683: end if;
2684: if (fnd_log.LEVEL_PROCEDURE>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2685: then
2686: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: bind error: '||l_message);
2687: end if;
2688: return fnd_ldap_util.G_FAILURE;
2689: when others then
2690: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2686: fnd_log.string(fnd_log.LEVEL_PROCEDURE, l_module_source, 'END: bind error: '||l_message);
2687: end if;
2688: return fnd_ldap_util.G_FAILURE;
2689: when others then
2690: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2691: then
2692: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: unexpected'||l_message);
2693: end if;
2694: return fnd_ldap_util.G_FAILURE;
2688: return fnd_ldap_util.G_FAILURE;
2689: when others then
2690: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2691: then
2692: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: unexpected'||l_message);
2693: end if;
2694: return fnd_ldap_util.G_FAILURE;
2695: end;
2696:
2695: end;
2696:
2697:
2698: l_retval:= dbms_ldap.unbind_s(ldapSession);
2699: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2700: then
2701: fnd_log.string(fnd_log.LEVEL_PROCEDURE , l_module_source, 'END: Valid Username/password');
2702: end if;
2703: return fnd_ldap_util.G_SUCCESS;
2697:
2698: l_retval:= dbms_ldap.unbind_s(ldapSession);
2699: if (fnd_log.LEVEL_PROCEDURE >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2700: then
2701: fnd_log.string(fnd_log.LEVEL_PROCEDURE , l_module_source, 'END: Valid Username/password');
2702: end if;
2703: return fnd_ldap_util.G_SUCCESS;
2704:
2705: exception when others then
2702: end if;
2703: return fnd_ldap_util.G_SUCCESS;
2704:
2705: exception when others then
2706: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2707: then
2708: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: unexpected '||sqlcode||' - '||sqlerrm);
2709: end if;
2710: fnd_message.set_name('FND','FND-9914'); -- unexpected error
2704:
2705: exception when others then
2706: if (fnd_log.LEVEL_UNEXPECTED>= fnd_log.G_CURRENT_RUNTIME_LEVEL)
2707: then
2708: fnd_log.string(fnd_log.LEVEL_UNEXPECTED, l_module_source, 'END: unexpected '||sqlcode||' - '||sqlerrm);
2709: end if;
2710: fnd_message.set_name('FND','FND-9914'); -- unexpected error
2711: return fnd_ldap_util.G_FAILURE;
2712: end validate_login;